Skip to content

Commit f420d8d

Browse files
committed
Fixed a bug where weights were messed up during import turning rotor blades into noodles.
1 parent 38f4d18 commit f420d8d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

ArmaToolbox/MDLImporter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,11 @@ def loadLOD(context, filePtr, objectName, materialData, layerFlag, lodnr):
376376
for i in range(0, numFaces):
377377
b = readByte(filePtr)
378378
w = decodeWeight(b)
379-
if w>0:
380-
pPoly = obj.data.polygons[i]
381-
for n in range(0,len(pPoly.vertices)):
382-
idx = pPoly.vertices[n]
383-
vgrp.add([idx], w, 'REPLACE')
379+
#if w>0:
380+
# pPoly = obj.data.polygons[i]
381+
# for n in range(0,len(pPoly.vertices)):
382+
# idx = pPoly.vertices[n]
383+
# vgrp.add([idx], w, 'REPLACE')
384384
#filePtr.seek(numFaces, 1)
385385

386386
# Done with the taggs, only the resolution is left to read

ArmaToolbox/MDLexporter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ def writeNamedSelection(filePtr, obj, mesh, idx):
166166
weight = 0
167167
for grpF in grps:
168168
weight += grpF.weight
169-
writeByte(filePtr, convertWeight(weight / len(grps)))
169+
if (weight > 0):
170+
writeByte(filePtr, convertWeight(1))
171+
else:
172+
writeByte(filePtr, 0)
170173
else:
171174
writeByte(filePtr, 0)
172175

0 commit comments

Comments
 (0)