Skip to content

Commit

Permalink
Fixed import of root bone keyframes in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycrow101 committed Feb 29, 2024
1 parent 3c4bb9e commit 5bc6c19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion io_scene_rw_anm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
bl_info = {
"name": "RenderWare Animation",
"author": "Psycrow",
"version": (0, 1, 4),
"version": (0, 2, 0),
"blender": (2, 81, 0),
"location": "File > Import-Export",
"description": "Import / Export RenderWare Animation (.anm)",
Expand Down
4 changes: 2 additions & 2 deletions io_scene_rw_anm/anm.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def read(cls, fd):
prev_frame_off = read_uint32(fd)

if prev_frame_off & 0x3F000000:
bone_id += 1
bone_id = bone_id + 1 if time == 0.0 else 0
else:
prev_kf_id = frame_offs.index(prev_frame_off)
bone_id = keyframes[prev_kf_id].bone_id
Expand Down Expand Up @@ -130,7 +130,7 @@ def write(self, fd):
write_float32(fd, (kf.rot[1], kf.rot[2], kf.rot[3], kf.rot[0]))
write_float32(fd, kf.pos)

if kf.time == 0.0:
if kf.bone_id not in prev_frame_offs:
write_uint32(fd, ANM_ACTION_PARENT_NONE_OFFSET)
else:
write_uint32(fd, prev_frame_offs[kf.bone_id])
Expand Down

0 comments on commit 5bc6c19

Please sign in to comment.