fix for baking actions for objects with no animation data.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 16 Jun 2011 07:48:22 +0000 (07:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 16 Jun 2011 07:48:22 +0000 (07:48 +0000)
release/scripts/startup/bl_operators/nla.py

index 6b32411190364b08d28f857a819836a09899bc20..7cbdaa3ddbfe95207c197b3b05f2d58765beb65b 100644 (file)
@@ -118,8 +118,10 @@ def bake(frame_start,
     # -------------------------------------------------------------------------
     # Create action
 
+    # incase animation data hassnt been created
+    atd = obj.animation_data_create()
     action = bpy.data.actions.new("Action")
-    obj.animation_data.action = action
+    atd.action = action
 
     if do_pose:
         pose_items = pose.bones.items()