Jelajahi Sumber

Merge pull request #2430 from flimflamboyant/master

Restore current frame after append_range() operations
David Catuhe 8 tahun lalu
induk
melakukan
e464ca9e07
1 mengubah file dengan 2 tambahan dan 0 penghapusan
  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: