diff --git a/src/builder.py b/src/builder.py index 28a66b3..198b974 100644 --- a/src/builder.py +++ b/src/builder.py @@ -257,7 +257,7 @@ def from_armature(armature_object): # For now we can just use the first node! for time in keyframe_timings[model.nodes[0].name]['rotation_quaternion']: # Expand our time - scaled_time = time * (1.0/get_framerate()) + scaled_time = time * (1.0 / get_framerate()) subframe_time = time - floor(time) bpy.context.scene.frame_set(time, subframe = subframe_time) @@ -293,7 +293,7 @@ def from_armature(armature_object): # So we'd have to loop through each keyframe timing, but for now this should work! for time in keyframe_timing['rotation_quaternion']: # Expand our time - scaled_time = time * (1.0/get_framerate()) + scaled_time = time * (1.0 / get_framerate()) subframe_time = time - floor(time) bpy.context.scene.frame_set(time, subframe = subframe_time) diff --git a/src/exporter.py b/src/exporter.py index 0e43e45..da94244 100644 --- a/src/exporter.py +++ b/src/exporter.py @@ -59,7 +59,7 @@ def execute(self, context): armature_object = context.scene.objects[self.armature] model = ModelBuilder().from_armature(armature_object) - if self.abc_version==ABCVersion.ABC6.value: + if self.abc_version == ABCVersion.ABC6.value: ABCV6ModelWriter().write(model, self.filepath, self.abc_version) else: ABCModelWriter().write(model, self.filepath, self.abc_version) diff --git a/src/importer.py b/src/importer.py index 74f2bc7..197521b 100644 --- a/src/importer.py +++ b/src/importer.py @@ -391,7 +391,7 @@ def recursively_apply_transform(nodes, node_index, pose_bones, parent_matrix): node = model.nodes[node_index] if node.md_vert_count > 0: - md_vert = node.md_vert_list.index(our_vert_index) + (keyframe_index*node.md_vert_count) + md_vert = node.md_vert_list.index(our_vert_index) + (keyframe_index * node.md_vert_count) vertex_transform = animation.vertex_deformations[node_index][md_vert].location shape_key.data[vert_index].co = node.bind_matrix @ vertex_transform @@ -424,7 +424,7 @@ def recursively_apply_transform(nodes, node_index, pose_bones, parent_matrix): # Set almost sane defaults Context.scene.frame_start = 0 - #Context.scene.frame_end=ceil(max([animation.keyframes[-1].time*get_framerate() for animation in model.animations])) + #Context.scene.frame_end = ceil(max([animation.keyframes[-1].time * get_framerate() for animation in model.animations])) # Set our keyframe time to 0 Context.scene.frame_set(0) # Set this because almost 100% chance you're importing keyframes that aren't aligned to 25fps