Bugfixing for retargeting - unconnected bones now retarget alot better. Also some placeholder code for a fix scale operator

This commit is contained in:
2011-07-18 18:44:54 +00:00
parent a6e2fba994
commit 0dcc7d05ab
3 changed files with 51 additions and 4 deletions

View File

@@ -191,6 +191,7 @@ class MocapPanel(bpy.types.Panel):
row.operator("mocap.samples", text='Samples to Beziers')
row.operator("mocap.denoise", text='Clean noise')
row.operator("mocap.rotate_fix", text='Fix BVH Axis Orientation')
row.operator("mocap.scale_fix", text='Auto scale Performer')
row2 = self.layout.row(align=True)
row2.operator("mocap.looper", text='Loop animation')
row2.operator("mocap.limitdof", text='Constrain Rig')
@@ -430,6 +431,27 @@ class OBJECT_OT_RotateFixArmature(bpy.types.Operator):
return isinstance(context.active_object.data, bpy.types.Armature)
class OBJECT_OT_ScaleFixArmature(bpy.types.Operator):
bl_idname = "mocap.scale_fix"
bl_label = "Scales performer armature to match target armature"
def execute(self, context):
enduser_obj = bpy.context.active_object
performer_obj = [obj for obj in bpy.context.selected_objects if obj != enduser_obj][0]
mocap_tools.scale_fix_armature(performer_obj, enduser_obj)
return {"FINISHED"}
@classmethod
def poll(cls, context):
if context.active_object:
activeIsArmature = isinstance(context.active_object.data, bpy.types.Armature)
performer_obj = [obj for obj in context.selected_objects if obj != context.active_object]
if performer_obj:
return activeIsArmature and isinstance(performer_obj[0].data, bpy.types.Armature)
else:
return False
class OBJECT_OT_AddMocapConstraint(bpy.types.Operator):
bl_idname = "mocap.addconstraint"
bl_label = "Add constraint to target armature"