@@ -429,8 +429,7 @@ Marat Yakupov reported in issue 228 a problem with the mixamo ybot model. The pr
429429
430430``` python
431431 def fix_bones_influences (self , mesh , old_skeleton ):
432- required_bones = []
433- # iterate sections
432+ active_bones = []
434433 for section in range (0 , mesh.skeletal_mesh_sections_num()):
435434 vertices = mesh.skeletal_mesh_get_soft_vertices(0 , section)
436435 ue.log_warning(len (vertices))
@@ -443,8 +442,8 @@ Marat Yakupov reported in issue 228 a problem with the mixamo ybot model. The pr
443442 for index, bone_id in enumerate (bone_ids):
444443 if vertex.influence_weights[index] > 0 :
445444 bone_ids[index] = self .get_updated_bone_index(old_skeleton, mesh.Skeleton, old_bone_map, new_bone_map, bone_id)
446- if new_bone_map[bone_ids[index]] not in required_bones :
447- required_bones .append(new_bone_map[bone_ids[index]])
445+ if new_bone_map[bone_ids[index]] not in active_bones :
446+ active_bones .append(new_bone_map[bone_ids[index]])
448447 vertex.influence_bones = bone_ids
449448 new_vertices.append(vertex)
450449
@@ -454,10 +453,9 @@ Marat Yakupov reported in issue 228 a problem with the mixamo ybot model. The pr
454453 mesh.skeletal_mesh_set_bone_map(new_bone_map, 0 , section)
455454
456455 # specify which bones are active and required (ensure root is added to required bones)
457- mesh.skeletal_mesh_set_active_bone_indices(required_bones)
458- if 0 not in required_bones:
459- required_bones += [0 ]
460- mesh.skeletal_mesh_set_required_bones(required_bones)
456+ mesh.skeletal_mesh_set_active_bone_indices(active_bones)
457+ # mark all the bones as required (eventually you can be more selective)
458+ mesh.skeletal_mesh_set_required_bones(list (range (0 , mesh.Skeleton.skeleton_bones_get_num())))
461459```
462460
463461As you can see we still assume a single LOD (the 0 before the section is always the lod)
0 commit comments