Skip to content

Commit

Permalink
Straggler formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Five-Damned-Dollarz committed Mar 14, 2021
1 parent 9318a53 commit 363d774
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 363d774

Please sign in to comment.