[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39467] branches/soc-2011-pepper/release/ scripts/modules/retarget.py: Small change that improves usability to advanced retargeting
Benjy Cook
benjycook at hotmail.com
Tue Aug 16 21:12:36 CEST 2011
Revision: 39467
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39467
Author: benjycook
Date: 2011-08-16 19:12:36 +0000 (Tue, 16 Aug 2011)
Log Message:
-----------
Small change that improves usability to advanced retargeting
Modified Paths:
--------------
branches/soc-2011-pepper/release/scripts/modules/retarget.py
Modified: branches/soc-2011-pepper/release/scripts/modules/retarget.py
===================================================================
--- branches/soc-2011-pepper/release/scripts/modules/retarget.py 2011-08-16 19:11:15 UTC (rev 39466)
+++ branches/soc-2011-pepper/release/scripts/modules/retarget.py 2011-08-16 19:12:36 UTC (rev 39467)
@@ -483,43 +483,30 @@
perf_root = performer_obj.pose.bones[0].name
for bone in map_bones:
perf_bone = bone.bone.reverseMap[0].name
- addLocalRot = False;
+
+ cons = bone.constraints.new('COPY_ROTATION')
+ cons.name = "retargetTemp"
+ locks = bone.lock_rotation
+ cons.use_x = not locks[0]
+ cons.use_y = not locks[1]
+ cons.use_z = not locks[2]
+ cons.target = performer_obj
+ cons.subtarget = perf_bone
+ cons.target_space = 'WORLD'
+ cons.owner_space = 'WORLD'
+
if (not bone.bone.use_connect) and (perf_bone!=perf_root):
- locks = bone.lock_location
- #if not (locks[0] or locks[1] or locks[2]):
cons = bone.constraints.new('COPY_LOCATION')
cons.name = "retargetTemp"
- cons.use_x = not locks[0]
- cons.use_y = not locks[1]
- cons.use_z = not locks[2]
cons.target = performer_obj
cons.subtarget = perf_bone
+ cons.use_x = True
+ cons.use_y = True
+ cons.use_z = True
cons.target_space = 'LOCAL'
cons.owner_space = 'LOCAL'
- addLocalRot = True
-
- cons2 = bone.constraints.new('COPY_ROTATION')
- cons2.name = "retargetTemp"
- locks = bone.lock_rotation
- cons2.use_x = not locks[0]
- cons2.use_y = not locks[1]
- cons2.use_z = not locks[2]
- cons2.target = performer_obj
- cons2.subtarget = perf_bone
- cons2.target_space = 'WORLD'
- cons2.owner_space = 'WORLD'
- if perf_bone==perf_root:
- addLocalRot = True
-
- #~ if addLocalRot:
- #~ for constraint in bone.constraints:
- #~ if constraint.type == 'COPY_ROTATION':
- #~ constraint.target_space = 'LOCAL'
- #~ constraint.owner_space = 'LOCAL'
-
-
def prepareForBake(enduser_obj):
bones = enduser_obj.pose.bones
for bone in bones:
More information about the Bf-blender-cvs
mailing list