Skip to content

Commit

Permalink
Merge pull request #10 from SWTOR-Slicers/64bit-skeleton-error
Browse files Browse the repository at this point in the history
64bit Skeleton fix
  • Loading branch information
StarLight-Oliver authored Dec 21, 2023
2 parents 5205d30 + e574c57 commit d83f5f9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Binary file modified io_scene_gr2.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion io_scene_gr2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
bl_info = {
"name": "Star Wars: The Old Republic (.gr2)",
"author": "Darth Atroxa, SWTOR Slicers",
"version": (3, 5, 2),
"version": (3, 5, 3),
"blender": (2, 82, 0),
"location": "File > Import-Export",
"description": "Import-Export SWTOR skeleton, or model with bone weights, UV's and materials",
Expand Down
5 changes: 4 additions & 1 deletion io_scene_gr2/ops/import_gr2.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ def read(operator, filepath):
count += 1

# Skeleton Bones
gr2.bone_buffer = {i: Granny2.Bone(dv, offset_bone_struct + (i * 136))

bone_size_of_mem = 144 if gr2.version == 5 else 136

gr2.bone_buffer = {i: Granny2.Bone(dv, offset_bone_struct + (i * bone_size_of_mem), gr2.version)
for i in range(num_bones)}

return gr2
Expand Down
6 changes: 6 additions & 0 deletions io_scene_gr2/types/gr2.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ def __init__(self, *args, **kwargs):
pos += 24
return


self.parent_index = dv.getInt32(pos, 1)
pos += 4

if version == 5:
# something is here? we don't know what it is
pos += 4

# self.bone_to_parent = [dv.getFloat32(pos + (i * 4), 1) for i in range(16)]
pos += 64
self.root_to_bone = [dv.getFloat32(pos + (i * 4), 1) for i in range(16)]
Expand Down

0 comments on commit d83f5f9

Please sign in to comment.