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 năm trước cách đây
mục cha
commit
54cb0374d6

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

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