Show Bone 커맨드 사용 시 크래시 이슈

  • 애니메이션 파트 쪽에서 showbone 커맨드 입력 시 크래시가 발생한다는 문의가 들어왔다
  • 확인해보니, 아래 부분에서 index 개수 차이로 발생하는 문제였다
void FSkinnedSceneProxy::DebugDrawSkeleton(int32 ViewIndex, FMeshElementCollector& Collector, const FEngineShowFlags& EngineShowFlags) const
{
  // ...
  FPrimitiveDrawInterface* PDI = Collector.GetPDI(ViewIndex);
	TArray<FTransform>& ComponentSpaceTransforms = *MeshObject->GetComponentSpaceTransforms();

	for (int32 Index = 0; Index < ComponentSpaceTransforms.Num(); ++Index)
	{
		const int32 ParentIndex = SkinnedAsset->GetRefSkeleton().GetParentIndex(Index);
    
    // ...
  }

  // ...
}
  • 위 함수에서 ComponentSpaceTransforms의 개수와 SkinnedAsset->GetRefSkeleton()의 Index 개수가 달라서 발생하는 이슈
    • Reference Bone 구조와 무기 Bone의 구조가 달랐던 듯하다
  • 애니메이터 쪽에 공유하니 무기 쪽 Bone이 다른 이유는 최적화 때문이라는데, 그걸 포기할 수는 없으니 그냥 ShowBone 치트를 사용하지 않겠다고 답변이 왔다…
  • 해결 방법이 있는지는 모르겠다
    • ABP에서 Toggle Pose를 켜면 보이기는 하는데, Preview World에서만 보이고 InGame에서는 DebugDraw가 보이지 않았다