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:
Diffstat (limited to 'release/scripts/startup/bl_operators/object.py')
-rw-r--r--release/scripts/startup/bl_operators/object.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index 88f863b8e55..6c9f27afaa5 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -686,26 +686,30 @@ class ClearAllRestrictRender(Operator):
obj.hide_render = False
return {'FINISHED'}
-class TransformsToDeltasAnim(bpy.types.Operator):
+
+class TransformsToDeltasAnim(Operator):
'''Convert object animation for normal transforms to delta transforms'''
bl_idname = "object.anim_transforms_to_deltas"
bl_label = "Animated Transforms to Deltas"
bl_options = {'REGISTER', 'UNDO'}
-
+
@classmethod
def poll(cls, context):
obs = context.selected_editable_objects
return (obs is not None)
-
+
def execute(self, context):
for obj in context.selected_editable_objects:
# get animation data
adt = obj.animation_data
if (adt is None) or (adt.action is None):
- self.report({'WARNING'}, "No animation data to convert on object: " + obj.name)
+ self.report({'WARNING'},
+ "No animation data to convert on object: %r" %
+ obj.name)
continue
-
- # if F-Curve uses standard transform path, just append "delta_" to this path
+
+ # if F-Curve uses standard transform path
+ # just append "delta_" to this path
for fcu in adt.action.fcurves:
if fcu.data_path == "location":
fcu.data_path = "delta_location"
@@ -716,13 +720,14 @@ class TransformsToDeltasAnim(bpy.types.Operator):
elif fcu.data_path == "rotation_quaternion":
fcu.data_path = "delta_rotation_quaternion"
obj.rotation_quaternion.identity()
- #elif fcu.data_path == "rotation_axis_angle": # XXX: currently not implemented
- # fcu.data_path = "delta_rotation_axis_angle"
+ # XXX: currently not implemented
+ # elif fcu.data_path == "rotation_axis_angle":
+ # fcu.data_path = "delta_rotation_axis_angle"
elif fcu.data_path == "scale":
fcu.data_path = "delta_scale"
- obj.scale = (1, 1, 1)
-
+ obj.scale = 1.0, 1.0, 1.0
+
# hack: force animsys flush by changing frame, so that deltas get run
context.scene.frame_set(context.scene.frame_current)
-
+
return {'FINISHED'}