|
@@ -827,6 +827,7 @@ def generate_indices_and_weights(meshes, option_skinning):
|
|
weights = []
|
|
weights = []
|
|
|
|
|
|
armature, armature_object = get_armature()
|
|
armature, armature_object = get_armature()
|
|
|
|
+ bone_names = [bone.name for bone in armature_object.pose.bones]
|
|
|
|
|
|
for mesh, object in meshes:
|
|
for mesh, object in meshes:
|
|
|
|
|
|
@@ -854,9 +855,10 @@ def generate_indices_and_weights(meshes, option_skinning):
|
|
|
|
|
|
for group in vertex.groups:
|
|
for group in vertex.groups:
|
|
index = group.group
|
|
index = group.group
|
|
- weight = group.weight
|
|
|
|
|
|
+ if object.vertex_groups[index].name in bone_names:
|
|
|
|
+ weight = group.weight
|
|
|
|
|
|
- bone_array.append( (index, weight) )
|
|
|
|
|
|
+ bone_array.append( (index, weight) )
|
|
|
|
|
|
bone_array.sort(key = operator.itemgetter(1), reverse=True)
|
|
bone_array.sort(key = operator.itemgetter(1), reverse=True)
|
|
|
|
|
|
@@ -879,11 +881,11 @@ def generate_indices_and_weights(meshes, option_skinning):
|
|
break
|
|
break
|
|
|
|
|
|
if found != 1:
|
|
if found != 1:
|
|
- indices.append('0')
|
|
|
|
|
|
+ indices.append('-1')
|
|
weights.append('0')
|
|
weights.append('0')
|
|
|
|
|
|
else:
|
|
else:
|
|
- indices.append('0')
|
|
|
|
|
|
+ indices.append('-1')
|
|
weights.append('0')
|
|
weights.append('0')
|
|
|
|
|
|
|
|
|
|
@@ -2696,4 +2698,4 @@ def save(operator, context, filepath = "",
|
|
option_frame_step,
|
|
option_frame_step,
|
|
option_frame_index_as_time)
|
|
option_frame_index_as_time)
|
|
|
|
|
|
- return {'FINISHED'}
|
|
|
|
|
|
+ return {'FINISHED'}
|