Skip to content

Commit

Permalink
manis import - add imported actions to NLA tracks of current armature
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Apr 8, 2024
1 parent b4d3cdf commit 73b2cfa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions plugin/import_manis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4e775157f - Mon Apr 8 17:31:15 2024 +0200
b4d3cdf36 - Mon Apr 8 19:33:37 2024 +0200

0 comments on commit 73b2cfa

Please sign in to comment.