Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions UnityPy/helpers/MeshHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def decompress_compressed_mesh(self):
# Skin
if m_CompressedMesh.m_Weights.m_NumItems > 0:
weightsData = unpack_ints(m_CompressedMesh.m_Weights)
weightsData = [weight / 31 for weight in weightsData]
weightsData = [weight for weight in weightsData]
Comment thread
mos9527 marked this conversation as resolved.
Outdated
boneIndicesData = unpack_ints(m_CompressedMesh.m_BoneIndices)

vertexIndex = 0
Expand All @@ -596,14 +596,14 @@ def decompress_compressed_mesh(self):
boneIndicesIterator = iter(boneIndicesData)
for weight, boneIndex in zip(weightsData, boneIndicesIterator):
# read bone index and weight
self.m_BoneWeights[vertexIndex][j] = weight
self.m_BoneWeights[vertexIndex][j] = weight / 31
self.m_BoneIndices[vertexIndex][j] = boneIndex

j += 1
sum += weight

# the weights add up to one, continue with the next vertex.
if sum >= 1.0:
if sum >= 31:
j = 4
# set weights and boneIndices to 0,
# already done on init
Expand Down
Loading