bugfix: Wasn't exporting weight bones correctly.

master
TigerKat 5 years ago
parent 8d3a030b8b
commit f1f5148584

@ -2,7 +2,7 @@
bl_info = {
"name": "City of Heroes (.geo)",
"author": "TigerKat",
"version": (0, 1),
"version": (0, 1, 1),
"blender": (2, 79, 0),
"location": "File > Import/Export,",
"description": "City of Heroes (.geo)",

@ -70,7 +70,7 @@ def save(operator, context, filepath = "", global_matrix = None, use_mesh_modifi
geo = Geo()
geo.getTextureIndex("white.tga")
geo.getTextureIndex("white")
#geo.getTextureIndex("white")
body_name = bpy.path.display_name_from_filepath(filepath)
geo.setName(body_name)

@ -956,6 +956,8 @@ class Model:
weight_remap = []
for i in range(len(geomesh.weights)):
weight_remap.append(BONES_LOOKUP.get(geomesh.weights[i], 0))
if len(weight_remap) <= 0:
weight_remap.append(0)
#Convert vetices to: positions, normals, uvs, weights
for i, v in enumerate(geomesh.geovertex):
self.verts.append(v.coord)
@ -965,13 +967,13 @@ class Model:
weights = v.selectWeights(2)
if len(weights) == 0:
self.weights.append([1, 0])
self.weight_bones.append([0, 0])
self.weight_bones.append([weight_remap[0], weight_remap[0]])
elif len(weights) == 1:
self.weights.append([weights[0][1], 0])
self.weight_bones.append([weights[0][0], 0])
self.weight_bones.append([weight_remap[weights[0][0]], weight_remap[weights[0][0]]])
else:
self.weights.append([weights[0][1], weights[1][1]])
self.weight_bones.append([weights[0][0], weights[1][0]])
self.weight_bones.append([weight_remap[weights[0][0]], weight_remap[weights[1][0]]])
#Convert faces
texture_index = None
texture_count = 0

Loading…
Cancel
Save