Browse Source

Restore current frame after appending animation ranges

Saves and restores current frame after all append_range() operations
have been completed.
Josh Langley 8 years ago
parent
commit
54cb0374d6
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Exporters/Blender/src/babylon-js/f_curve_animatable.py

+ 2 - 0
Exporters/Blender/src/babylon-js/f_curve_animatable.py

@@ -33,6 +33,7 @@ class FCurveAnimatable:
             frameOffset = 0
 
             currentAction = object.animation_data.action
+            currentFrame = bpy.context.scene.frame_current
             for action in bpy.data.actions:
                 # get the range / assigning the action to the object
                 animationRange = AnimationRange.actionPrep(object, action, False, frameOffset)
@@ -54,6 +55,7 @@ class FCurveAnimatable:
                     frameOffset = animationRange.frame_end
 
             object.animation_data.action = currentAction
+            bpy.context.scene.frame_set(currentFrame)
             #Set Animations
             self.animations = []
             if supportsRotation and len(rotAnimation.frames) > 0: