From e25024c131fa1cb5907cfb0ab2362b86259a6e22 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 16 Apr 2012 15:42:49 +0900 Subject: [PATCH] Build a single NLA track with strips for all actions. This removes the need for fakeuser :). Anyway, with this, the model's animations can be viewed all in sequence just by hitting alt-a. --- tools/io_mesh_qfmdl/import_mdl.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/io_mesh_qfmdl/import_mdl.py b/tools/io_mesh_qfmdl/import_mdl.py index 0046ec516..257881be3 100644 --- a/tools/io_mesh_qfmdl/import_mdl.py +++ b/tools/io_mesh_qfmdl/import_mdl.py @@ -167,11 +167,12 @@ def set_keys(act, data): def build_actions(mdl): sk = mdl.mesh.shape_keys + ad = sk.animation_data_create() + track = ad.nla_tracks.new (); + track.name = mdl.name + start_frame = 1 for frame in mdl.frames: - sk.animation_data_create() - sk.animation_data.action = bpy.data.actions.new(frame.name) - act=sk.animation_data.action - act.use_fake_user = True + act = bpy.data.actions.new(frame.name) data = [] other_keys = mdl.keys[:] if frame.type: @@ -200,6 +201,8 @@ def build_actions(mdl): for k in other_keys: data.append((k, co)) set_keys (act, data) + track.strips.new (act.name, start_frame, act) + start_frame += act.frame_range[1] def merge_frames(mdl): def get_base(name):