Set Master Pose Component triggers infinite list of warnings

I’m setting up a modular character, using the default ACharacter skeletal mesh as the modular mesh’s “root”, and then attaching head, arms and legs to it.

sHead = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Head"));
sLeftArm = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Left Arm"));
sRightArm = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Right Arm"));
sLeftLeg = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Left Leg"));
sRightLeg = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Right Leg"));
sHead->SetupAttachment(GetMesh());
sLeftArm->SetupAttachment(GetMesh());
sRightArm->SetupAttachment(GetMesh());
sLeftLeg->SetupAttachment(GetMesh());
sRightLeg->SetupAttachment(GetMesh());

After this, I setup the MasterPoseComponent

void AProtagonistCharacter::OnConstruction(const FTransform& Transform)
{
    Super::OnConstruction(Transform);
    GetMesh()->SetMasterPoseComponent(sHead);
    GetMesh()->SetMasterPoseComponent(sLeftArm);
    GetMesh()->SetMasterPoseComponent(sRightArm);
    GetMesh()->SetMasterPoseComponent(sRightLeg);
    GetMesh()->SetMasterPoseComponent(sLeftLeg);
}

This apparently works, but when I start the editor I get this warning on every tick:

LogTick: Warning: While processing prerequisites for SkeletalMeshComponent /Game/Maps/UEDPIE_0_EditorLevel.EditorLevel:PersistentLevel.BP_ProtagonistCharacter_C_0.Left Leg[TickComponent],
could use SkeletalMeshComponent /Game/Maps/UEDPIE_0_EditorLevel.EditorLevel:PersistentLevel.BP_ProtagonistCharacter_C_0.CharacterMesh0[TickComponent] because it would form a cycle.

This warning always points at the LAST skeletal mesh component I set in the OnConstruction method (in this case, sLeftLeg).

I honestly don’t understand this error at all and I have no idea what it actually could cause to my project. Also, it makes the output log unreadable.

I’m also open to alternatives to the MasterPoseComponent. In the Unreal Docs I’ve read that there are 2 other alternatives but I didn’t really understand what they do differently. I need this setup for a dismemberment system (which will also need to override the base locomotion animations when a body part is removed)

1 Like

You have the syntax wrong for SetMasterPoseComponent you swapped what part is connected to what.

you have your main skeletal mesh getMesh()
you need to call SetMasterPoseComponent on other components passing in getMesh() as the main mesh it is to follow (the master post).

In you example you would have

void AProtagonistCharacter::AProtagonistCharacter()
{
sHead = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Head"));
sHead->SetupAttachment(GetMesh());
sHead->SetMasterPoseComponent(GetMesh(), true);

sLeftArm = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Left Arm"));
sLeftArm->SetupAttachment(GetMesh());	
sLeftArm->SetMasterPoseComponent(GetMesh(), true);

sRightArm = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Right Arm"));
sRightArm->SetupAttachment(GetMesh());	
sRightArm->SetMasterPoseComponent(GetMesh(), true);

sLeftLeg = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Left Leg"));
sLeftLeg >SetupAttachment(GetMesh());	
sLeftLeg >SetMasterPoseComponent(GetMesh(), true);

sRightLeg = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Right Leg"));
sRightLeg->SetupAttachment(GetMesh());	
sRightLeg->SetMasterPoseComponent(GetMesh(), true);


}
3 Likes

Sheeesh you saved me here. On top of solving my issue, now the default retargeted Manny Animation Blueprint works too, which makes the whole testing way more pleasant to watch until I start learning a bit more (ok, a lot more) about how rigs and skeletons work. Thanks a lot!

2 Likes