diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-04-11 16:36:52 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-04-11 16:36:52 +0300 |
commit | 8dd0687a6796227c3846f94454dcd40358896c92 (patch) | |
tree | a805b559132de9151b290e58f63dea420b684781 /io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py | |
parent | 7a3fdf08f3fe4984bc81219a075a8bd3234c7d72 (diff) |
glTF importer: refactoring animation import
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py')
-rw-r--r-- | io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py index 6c933852..2d0d8568 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py @@ -19,16 +19,16 @@ def simulate_stash(obj, track_name, action, start_frame=None): # * add a track # * add an action on track # * lock & mute the track - # * remove active action from object + if not obj.animation_data: + obj.animation_data_create() tracks = obj.animation_data.nla_tracks new_track = tracks.new(prev=None) new_track.name = track_name if start_frame is None: start_frame = bpy.context.scene.frame_start - strip = new_track.strips.new(action.name, start_frame, action) + _strip = new_track.strips.new(action.name, start_frame, action) new_track.lock = True new_track.mute = True - obj.animation_data.action = None def restore_animation_on_object(obj, anim_name): if not getattr(obj, 'animation_data', None): |