Skip to content

Commit

Permalink
Merge pull request haekb#29 from Psycrow101/master
Browse files Browse the repository at this point in the history
  • Loading branch information
haekb authored Nov 15, 2021
2 parents 8485a37 + 32db184 commit 11c8a29
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,12 @@ def import_model(model, options):

armature_object.animation_data_create()

for obj in armature_object.children:
obj.shape_key_add(name="neutral_pose", from_mix=False)
# we'll animate using mesh.shape_keys.eval_time
mesh.shape_keys.animation_data_create()
mesh.shape_keys.use_relative = False
if options.should_import_vertex_animations:
for obj in armature_object.children:
obj.shape_key_add(name="neutral_pose", from_mix=False)
# we'll animate using mesh.shape_keys.eval_time
mesh.shape_keys.animation_data_create()
mesh.shape_keys.use_relative = False

actions = []
md_actions = []
Expand Down Expand Up @@ -411,8 +412,9 @@ def recursively_apply_transform(nodes, node_index, pose_bones, parent_matrix):
md_actions.append(md_action)

# Add our actions to animation data
armature_object.animation_data.action = actions[0]
if options.should_import_vertex_animations:
if actions:
armature_object.animation_data.action = actions[0]
if md_actions:
mesh.shape_keys.animation_data.action = md_actions[0]

''' Vertex Animations '''
Expand Down

0 comments on commit 11c8a29

Please sign in to comment.