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-16 23:12:36 +0400
committerBenjy Cook <benjycook@hotmail.com>2011-08-16 23:12:36 +0400
commit0b7911cf0a133b60921dea07567da2d1baf2c523 (patch)
treef9aad2695cb3916cb7ad795e17956365cb67a0d1 /release/scripts
parentd79967e164c1a093df955787329da490f4878c01 (diff)
Small change that improves usability to advanced retargeting
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/modules/retarget.py43
1 files changed, 15 insertions, 28 deletions
diff --git a/release/scripts/modules/retarget.py b/release/scripts/modules/retarget.py
index 2c4dcbe6bda..662dfc218ab 100644
--- a/release/scripts/modules/retarget.py
+++ b/release/scripts/modules/retarget.py
@@ -483,41 +483,28 @@ def preAdvancedRetargeting(performer_obj, enduser_obj):
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):