How to get TRUE bone index by vertex in 5.1.1

Hello guys! I have tried to get all bones’ name influncing a vertex in this way:

		TArray<int32> InfluencingBonesIndices;
		for (int32 InfluenceIndex = 0; InfluenceIndex < MAX_TOTAL_INFLUENCES; InfluenceIndex++)
		{
			if (SkinWeight.InfluenceWeights[InfluenceIndex] > 0)
			{
				int32 CurrentBoneIndex = SkinWeightBuffer->GetBoneIndex(VertexIndex, SkinWeight.InfluenceBones[InfluenceIndex]);
				InfluencingBonesIndices.Add(CurrentBoneIndex);
			UE_LOG(LogTemp, Warning, TEXT("Bone Index: %d, Bone Name: %s, Weight: %d"), CurrentBoneIndex, *SkeletalMeshComponent->GetBoneName(CurrentBoneIndex).ToString(), SkinWeight.InfluenceWeights[InfluenceIndex]);
			}
		}

However, the CurrentBoneIndex is always zero(indicating root bone). I checked the value in InflunenceBones, they are not zero, however also did not corresponding to true bone name.

I’m confusing with influnceIndex and boneIndex, really hope someone can help me with this question!

1 Like

Solved. Need to map the influnce index to mesh index by skelMeshSection.BoneMap().

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.