From 73b2cfa5aca007ae6d1bfdb0fcb6003146b5fe79 Mon Sep 17 00:00:00 2001 From: HENDRIX-ZT2 <28632661+HENDRIX-ZT2@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:22:21 +0200 Subject: [PATCH] manis import - add imported actions to NLA tracks of current armature --- plugin/import_manis.py | 17 +++++++++++++++++ version.txt | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/plugin/import_manis.py b/plugin/import_manis.py index d5c325a8b..fd7a0fefc 100644 --- a/plugin/import_manis.py +++ b/plugin/import_manis.py @@ -75,6 +75,22 @@ def import_wsm(corrector, b_action, folder, mani_info, bone_name, bones_data): out_keys.append(key) +def stash(b_ob, action, track_name, start_frame): + # Simulate stash : + # * add a track + # * add an action on track + # * lock & mute the track + # * remove active action from object + tracks = b_ob.animation_data.nla_tracks + new_track = tracks.new(prev=None) + new_track.name = track_name + strip = new_track.strips.new(action.name, start_frame, action) + new_track.lock = True + new_track.mute = True + # nah + # b_ob.animation_data.action = None + + def load(reporter, files=(), filepath="", set_fps=False): folder, manis_name = os.path.split(filepath) starttime = time.time() @@ -100,6 +116,7 @@ def load(reporter, files=(), filepath="", set_fps=False): for mi in manis.mani_infos: b_action = anim_sys.create_action(b_armature_ob, mi.name) + stash(b_armature_ob, b_action, mi.name, 0) print(mi) k = mi.keys import_wsm(corrector, b_action, folder, mi, "srb", bones_data) diff --git a/version.txt b/version.txt index dfa75cedd..497f523a2 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4e775157f - Mon Apr 8 17:31:15 2024 +0200 \ No newline at end of file +b4d3cdf36 - Mon Apr 8 19:33:37 2024 +0200 \ No newline at end of file