Skip to content

Commit

Permalink
Fix import and export of scale keyframes
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeto committed Mar 10, 2024
1 parent 482cb53 commit 3d615a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion g3blend/operators/io_export_xmot.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def save_xmot(context: bpy.types.Context, filepath: str, global_scale: float, gl
frame_type = Xmot.QuaternionKeyFrame
# Scaling
case 'S':
value_map = lambda p, v: _from_blend_vec(p, (rest_matrix @ Matrix.LocRotScale(None, None, v)).to_translation().to_3d())
value_map = lambda p, v: _from_blend_vec(p, (rest_matrix @ Matrix.LocRotScale(None, None, v)).to_scale().to_3d())
frame_type = Xmot.VectorKeyFrame
case _:
continue
Expand Down
2 changes: 1 addition & 1 deletion g3blend/operators/io_import_xmot.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def load_xmot(context: bpy.types.Context, filepath: str, global_scale: float, gl
# Scaling
case 'S':
curve_path = 'scale'
value_extract = lambda v: (pre_matrix @ Matrix.LocRotScale(None, None, _to_blend_vec(v)) @ post_matrix).to_translation().to_3d()
value_extract = lambda v: (pre_matrix @ Matrix.LocRotScale(None, None, _to_blend_vec(v)) @ post_matrix).to_scale().to_3d()
num_channels = 3
case _:
print('Unsupported animation type:', keyframe_chunk.animation_type)
Expand Down

0 comments on commit 3d615a6

Please sign in to comment.