[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38118] branches/soc-2011-pepper/release/ scripts/startup/ui_mocap.py: Added access to denoising and new constraints functionality to UI script

Benjy Cook benjycook at hotmail.com
Tue Jul 5 12:57:29 CEST 2011


Revision: 38118
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38118
Author:   benjycook
Date:     2011-07-05 10:57:29 +0000 (Tue, 05 Jul 2011)
Log Message:
-----------
Added access to denoising and new constraints functionality to UI script

Modified Paths:
--------------
    branches/soc-2011-pepper/release/scripts/startup/ui_mocap.py

Modified: branches/soc-2011-pepper/release/scripts/startup/ui_mocap.py
===================================================================
--- branches/soc-2011-pepper/release/scripts/startup/ui_mocap.py	2011-07-05 10:56:34 UTC (rev 38117)
+++ branches/soc-2011-pepper/release/scripts/startup/ui_mocap.py	2011-07-05 10:57:29 UTC (rev 38118)
@@ -85,6 +85,10 @@
         subtype="XYZ", default=(0.0, 0.0, 0.0),
         description="Target of Constraint - Point",
         update=updateConstraint)
+    targetDist = bpy.props.FloatProperty(name="Dist",
+        default=1,
+        description="Distance Constraint - Desired distance",
+        update=updateConstraint)
     targetSpace = bpy.props.EnumProperty(
         items=[("WORLD", "World Space", "Evaluate target in global space"),
             ("LOCAL", "Object space", "Evaluate target in object space"),
@@ -118,9 +122,12 @@
             #ik the whole chain up to the root, excluding
             chainLen = 0
             for parent_bone in self.parent_recursive:
-                chainLen+=1
+                chainLen += 1
                 if hasIKConstraint(parent_bone):
                     break
+                deformer_children = [child for child in parent_bone.children if child.bone.use_deform]
+                if len(deformer_children) > 1:
+                    break
             ik.chain_count = chainLen
             for bone in self.parent_recursive:
                 if bone.is_in_ik_chain:
@@ -168,6 +175,7 @@
 
 updateIKRetarget()
 
+
 class MocapPanel(bpy.types.Panel):
     # Motion capture retargeting panel
     bl_label = "Mocap tools"
@@ -260,6 +268,8 @@
                             box.prop(m_constraint, 'targetSpace')
                         if m_constraint.type == "point":
                             targetPropCol.prop(m_constraint, 'targetPoint')
+                        if m_constraint.type == "distance":
+                            targetPropCol.prop(m_constraint, 'targetDist')
                         checkRow = box.row()
                         checkRow.prop(m_constraint, 'active')
                         checkRow.prop(m_constraint, 'baked')
@@ -299,6 +309,7 @@
     bl_label = "Denoises sampled mocap data "
 
     def execute(self, context):
+        mocap_tools.denoise_median()
         return {"FINISHED"}
 
 
@@ -347,4 +358,4 @@
     bpy.utils.unregister_module(__name__)
 
 if __name__ == "__main__":
-    register()
\ No newline at end of file
+    register()




More information about the Bf-blender-cvs mailing list