Skip to content

Commit

Permalink
show info to user if bvh file does not use the default rig (fix nbt: m…
Browse files Browse the repository at this point in the history
  • Loading branch information
Aranuvir authored and Aranuvir committed Mar 3, 2018
1 parent a55edf2 commit 1c7095e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions makehuman/plugins/3_libraries_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ def loadPose(self, filepath, apply_pose=True):
anim = self.loadMhp(filepath)
elif os.path.splitext(filepath)[1].lower() == '.bvh':
anim = self.loadBvh(filepath, convertFromZUp="auto")
if not anim:
log.error('Cannot load animation from %s' % filepath)
return
else:
log.error("Cannot load pose file %s: File type unknown." % filepath)
return
Expand All @@ -172,6 +175,11 @@ def loadMhp(self, filepath):

def loadBvh(self, filepath, convertFromZUp="auto"):
bvh_file = bvh.load(filepath, convertFromZUp)
if COMPARE_BONE not in bvh_file.joints:
msg = 'The pose file cannot be used. It uses a rig different from MakeHuman\'s defualt rig'
G.app.prompt('Error', msg, 'OK')
log.error('Pose file %s does not use the default rig.' % filepath)
return None
anim = bvh_file.createAnimationTrack(self.human.getBaseSkeleton())
if "root" in bvh_file.joints:
posedata = anim.getAtFramePos(0, noBake=True)
Expand Down

0 comments on commit 1c7095e

Please sign in to comment.