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:
authorCampbell Barton <ideasman42@gmail.com>2015-02-16 23:16:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-02-16 23:19:48 +0300
commit652b2b656acd014287ec2e914515192ce9ff06ce (patch)
treebd25edca9745fd3ad9b209eb51ec1e7f512ef399 /release
parent00a3c9afc892e32bbb6a740228e667f624072c20 (diff)
Fix bake action visual-keying option
Disabling did nothing
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_extras/anim_utils.py37
1 files changed, 25 insertions, 12 deletions
diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py
index 8905f327f18..4ee5e685668 100644
--- a/release/scripts/modules/bpy_extras/anim_utils.py
+++ b/release/scripts/modules/bpy_extras/anim_utils.py
@@ -74,7 +74,7 @@ def bake_action(frame_start,
# -------------------------------------------------------------------------
# Helper Functions and vars
- def pose_frame_info(obj, do_visual_keying):
+ def pose_frame_info(obj):
matrix = {}
for name, pbone in obj.pose.bones.items():
if do_visual_keying:
@@ -85,16 +85,29 @@ def bake_action(frame_start,
return matrix
if do_parents_clear:
- def obj_frame_info(obj, do_visual_keying):
- return obj.matrix_world.copy() if do_visual_keying else obj.matrix_world.copy()
+ if do_visual_keying:
+ def obj_frame_info(obj):
+ return obj.matrix_world.copy()
+ else:
+ def obj_frame_info(obj):
+ parent = obj.parent
+ matrix = obj.matrix_basis
+ if parent:
+ return parent.matrix_world * matrix
+ else:
+ return matrix.copy()
else:
- def obj_frame_info(obj, do_visual_keying):
- parent = obj.parent
- matrix = obj.matrix_world if do_visual_keying else obj.matrix_world
- if parent:
- return parent.matrix_world.inverted_safe() * matrix
- else:
- return matrix.copy()
+ if do_visual_keying:
+ def obj_frame_info(obj):
+ parent = obj.parent
+ matrix = obj.matrix_world
+ if parent:
+ return parent.matrix_world.inverted_safe() * matrix
+ else:
+ return matrix.copy()
+ else:
+ def obj_frame_info(obj):
+ return obj.matrix_basis.copy()
# -------------------------------------------------------------------------
# Setup the Context
@@ -124,9 +137,9 @@ def bake_action(frame_start,
scene.frame_set(f)
scene.update()
if do_pose:
- pose_info.append(pose_frame_info(obj, do_visual_keying))
+ pose_info.append(pose_frame_info(obj))
if do_object:
- obj_info.append(obj_frame_info(obj, do_visual_keying))
+ obj_info.append(obj_frame_info(obj))
# -------------------------------------------------------------------------
# Create action