Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjy Cook <benjycook@hotmail.com>2011-08-05 12:44:16 +0400
committerBenjy Cook <benjycook@hotmail.com>2011-08-05 12:44:16 +0400
commit9a9330d88c83b4c7ea76cd46a1fecd0c8e4e349e (patch)
tree1fc07013221e4ac698f538738c9de4a5b39a45fd /release/scripts
parent63c7bacc7b56dcca559d88a79190933c98017f36 (diff)
Post Retarget fixes - added an Update Constraints button, that recalculates all fixes. Useful for when the user makes some external change to the animation
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/modules/mocap_constraints.py7
-rw-r--r--release/scripts/startup/ui_mocap.py22
2 files changed, 26 insertions, 3 deletions
diff --git a/release/scripts/modules/mocap_constraints.py b/release/scripts/modules/mocap_constraints.py
index 8fd42d17392..75afbe62231 100644
--- a/release/scripts/modules/mocap_constraints.py
+++ b/release/scripts/modules/mocap_constraints.py
@@ -419,3 +419,10 @@ def unbakeConstraints(context):
if ik_con:
ik_con.mute = False
m_constraint.active = True
+
+
+def updateConstraints(obj, context):
+ fixes = obj.data.mocap_constraints
+ for fix in fixes:
+ fix.active = False
+ fix.active = True
diff --git a/release/scripts/startup/ui_mocap.py b/release/scripts/startup/ui_mocap.py
index 03d173df7a6..8ef4c1e7591 100644
--- a/release/scripts/startup/ui_mocap.py
+++ b/release/scripts/startup/ui_mocap.py
@@ -264,9 +264,10 @@ class MocapConstraintsPanel(bpy.types.Panel):
enduser_obj = context.active_object
enduser_arm = enduser_obj.data
layout.operator_menu_enum("mocap.addmocapfix", "type")
+ layout.operator("mocap.updateconstraints", text='Update Fixes')
bakeRow = layout.row()
- bakeRow.operator("mocap.bakeconstraints")
- bakeRow.operator("mocap.unbakeconstraints")
+ bakeRow.operator("mocap.bakeconstraints", text='Bake Fixes')
+ bakeRow.operator("mocap.unbakeconstraints", text='Unbake Fixes')
layout.separator()
for i, m_constraint in enumerate(enduser_arm.mocap_constraints):
box = layout.box()
@@ -588,6 +589,21 @@ class OBJECT_OT_UnbakeMocapConstraints(bpy.types.Operator):
return isinstance(context.active_object.data, bpy.types.Armature)
+class OBJECT_OT_UpdateMocapConstraints(bpy.types.Operator):
+ '''Updates all post-retarget fixes - needed after changes to armature object or pose'''
+ bl_idname = "mocap.updateconstraints"
+ bl_label = "Updates all fixes to target armature - neccesary to take under consideration changes to armature object or pose"
+
+ def execute(self, context):
+ updateConstraints(context.active_object, context)
+ return {"FINISHED"}
+
+ @classmethod
+ def poll(cls, context):
+ if context.active_object:
+ return isinstance(context.active_object.data, bpy.types.Armature)
+
+
class OBJECT_OT_GuessHierachyMapping(bpy.types.Operator):
'''Attemps to auto figure out hierarchy mapping'''
bl_idname = "mocap.guessmapping"
@@ -623,7 +639,7 @@ class OBJECT_OT_PathEditing(bpy.types.Operator):
@classmethod
def poll(cls, context):
if context.active_object:
- selected_objs = [obj for obj in context.selected_objects if obj != context.active_object]
+ selected_objs = [obj for obj in context.selected_objects if obj != context.active_object and isinstance(obj.data, bpy.types.Curve)]
return selected_objs
else:
return False