[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2267] trunk/py/scripts/addons/mocap: Superficial pep8 edits
Campbell Barton
ideasman42 at gmail.com
Fri Aug 26 07:33:05 CEST 2011
Revision: 2267
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2267
Author: campbellbarton
Date: 2011-08-26 05:33:04 +0000 (Fri, 26 Aug 2011)
Log Message:
-----------
Superficial pep8 edits
Modified Paths:
--------------
trunk/py/scripts/addons/mocap/__init__.py
trunk/py/scripts/addons/mocap/mocap_constraints.py
trunk/py/scripts/addons/mocap/mocap_tools.py
Modified: trunk/py/scripts/addons/mocap/__init__.py
===================================================================
--- trunk/py/scripts/addons/mocap/__init__.py 2011-08-25 18:18:30 UTC (rev 2266)
+++ trunk/py/scripts/addons/mocap/__init__.py 2011-08-26 05:33:04 UTC (rev 2267)
@@ -26,7 +26,7 @@
"location": "Object UI -> Mocap tools",
"description": "Various tools for working with motion capture animation",
"warning": "",
- "wiki_url": ("http://wiki.blender.org/index.php/User:Benjycook/GSOC/Manual"),
+ "wiki_url": "http://wiki.blender.org/index.php/User:Benjycook/GSOC/Manual",
"tracker_url": "",
"support": 'OFFICIAL',
"category": "Animation"}
@@ -121,7 +121,6 @@
real_constraint_bone = bpy.props.StringProperty()
-
# Animation Stitch Settings, used for animation stitching of 2 retargeted animations.
class AnimationStitchSettings(bpy.types.PropertyGroup):
first_action = bpy.props.StringProperty(name="Action 1",
@@ -141,7 +140,6 @@
default="")
-
# MocapNLA Tracks. Stores which tracks/actions are associated with each retargeted animation.
class MocapNLATracks(bpy.types.PropertyGroup):
name = bpy.props.StringProperty()
@@ -151,8 +149,6 @@
stride_action = bpy.props.StringProperty()
-
-
#Update function for Advanced Retarget boolean variable.
def advancedRetargetToggle(self, context):
enduser_obj = context.active_object
@@ -168,7 +164,6 @@
retarget.cleanTempConstraints(enduser_obj)
-
def toggleIKBone(self, context):
#Update function for IK functionality. Is called when IK prop checkboxes are toggled.
if self.IKRetarget:
@@ -220,7 +215,6 @@
name = bpy.props.StringProperty()
-
def updateIKRetarget():
# ensures that Blender constraints and IK properties are in sync
# currently runs when module is loaded, should run when scene is loaded
@@ -237,6 +231,7 @@
updateIKRetarget()
+
def hasIKConstraint(pose_bone):
#utility function / predicate, returns True if given bone has IK constraint
ik = [constraint for constraint in pose_bone.constraints if constraint.type == "IK"]
@@ -245,6 +240,7 @@
else:
return False
+
class MocapPanel(bpy.types.Panel):
# Motion capture retargeting panel
bl_label = "Mocap tools"
@@ -281,7 +277,7 @@
perf_pose_bones = enduser_obj.pose.bones
MappingRow = self.layout.row(align=True)
footCol = MappingRow.column(align=True)
- nameCol =MappingRow.column(align=True)
+ nameCol = MappingRow.column(align=True)
nameCol.scale_x = 2
mapCol = MappingRow.column(align=True)
mapCol.scale_x = 2
@@ -877,8 +873,8 @@
description="Amount of frames to skip - for previewing retargets quickly. 1 is fully sampled",
min=1)
bpy.utils.register_module(__name__)
-
-
+
+
def unregister():
bpy.utils.unregister_module(__name__)
Modified: trunk/py/scripts/addons/mocap/mocap_constraints.py
===================================================================
--- trunk/py/scripts/addons/mocap/mocap_constraints.py 2011-08-25 18:18:30 UTC (rev 2266)
+++ trunk/py/scripts/addons/mocap/mocap_constraints.py 2011-08-26 05:33:04 UTC (rev 2267)
@@ -282,7 +282,7 @@
real_constraint.target = obj
real_constraint.subtarget = getConsObj(bones[m_constraint.constrained_boneB]).name
real_constraint.limit_mode = "LIMITDIST_ONSURFACE"
- if m_constraint.targetDist<0.01:
+ if m_constraint.targetDist < 0.01:
m_constraint.targetDist = 0.01
real_constraint.distance = m_constraint.targetDist
Modified: trunk/py/scripts/addons/mocap/mocap_tools.py
===================================================================
--- trunk/py/scripts/addons/mocap/mocap_tools.py 2011-08-25 18:18:30 UTC (rev 2266)
+++ trunk/py/scripts/addons/mocap/mocap_tools.py 2011-08-26 05:33:04 UTC (rev 2267)
@@ -116,8 +116,8 @@
def crossCorrelationMatch(curvesA, curvesB, margin):
dataA = []
dataB = []
- start = int(max(curvesA[0].range()[0],curvesB[0].range()[0]))
- end = int(min(curvesA[0].range()[1],curvesB[0].range()[1]))
+ start = int(max(curvesA[0].range()[0], curvesB[0].range()[0]))
+ end = int(min(curvesA[0].range()[1], curvesB[0].range()[1]))
#transfer all fcurves data on each frame to a single NdVector.
for i in range(1, end):
@@ -131,6 +131,7 @@
if fcurve.data_path in [otherFcurve.data_path for otherFcurve in curvesA]:
vec.append(fcurve.evaluate(i))
dataB.append(NdVector(vec))
+
#Comparator for Cross Correlation. "Classic" implementation uses dot product, as do we.
def comp(a, b):
return a * b
@@ -877,7 +878,7 @@
scene.frame_set(stitch_settings.blend_frame - 1)
desired_pos = (enduser_obj.matrix_world * selected_bone.matrix.to_translation())
scene.frame_set(stitch_settings.blend_frame)
- actual_pos = (enduser_obj.matrix_world * selected_bone.matrix.to_translation() )
+ actual_pos = (enduser_obj.matrix_world * selected_bone.matrix.to_translation())
print(desired_pos, actual_pos)
offset = Vector(actual_pos) - Vector(desired_pos)
@@ -887,7 +888,7 @@
pt.co.y -= offset[i]
pt.handle_left.y -= offset[i]
pt.handle_right.y -= offset[i]
-
+
#actionBStrip.blend_in = stitch_settings.blend_amount
More information about the Bf-extensions-cvs
mailing list