Skip to content

Commit

Permalink
Fix bone display again
Browse files Browse the repository at this point in the history
  • Loading branch information
amorgun committed Jun 30, 2024
1 parent 566f270 commit 93259f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ def CH_DATASKEL(self, reader: ChunkReader, xref: bool): # Chunk Handler - Skele

for bone in created_bones_array:
if len(bone.children) == 1:
bone.length = (bone.children[0].head - bone.head).length
new_length = (bone.children[0].head - bone.head).length
if new_length > 1e-3:
bone.length = new_length
bpy.ops.object.mode_set(mode='EDIT', toggle=True)

def CH_FOLDMSGR(self, reader: ChunkReader): # Chunk Handler - Mesh Data
Expand Down Expand Up @@ -334,7 +336,6 @@ def CH_FOLDANIM(self, reader: ChunkReader): # Chunk Handler - Animations
num_bones = reader.read_one('<l') # -- Read Number Of Bones
for bone_idx in range(num_bones): # -- Read Bones
bone_name = reader.read_str() # -- Read Bone Name
# bone_idx = self.name_2_bone_idx[bone_name]
bone = self.armature_obj.pose.bones[bone_name]
orig_transform = self.bone_orig_transform[bone_name]

Expand Down

0 comments on commit 93259f4

Please sign in to comment.