Download

SetMasterPoseComponent() spamming LogTick-Warning if masterpose component is a child of the target

Hi!

I have this issue after moving to 4.20.2:


LogTick: Warning: While processing prerequisites for SkeletalMeshComponent /Game/Maps/UEDPIE_1_MAP-Scope.MAP-Scope:PersistentLevel.Weap_M9_C_0.WeaponMesh1P[TickComponent], could use SkeletalMeshComponent /Game/Maps/UEDPIE_1_MAP-Scope.MAP-Scope:PersistentLevel.P_Spec_Male_Light_C_0.CharacterMesh1P[TickComponent] because it would form a cycle.
LogTick: Warning: While processing prerequisites for SkeletalMeshComponent /Game/Maps/UEDPIE_2_MAP-Scope.MAP-Scope:PersistentLevel.P_Spec_Male_Light_C_0.CharacterMesh1P[TickComponent], could use SkeletalMeshComponent /Game/Maps/UEDPIE_2_MAP-Scope.MAP-Scope:PersistentLevel.Weap_M9_C_0.WeaponMesh1P[TickComponent] because it would form a cycle.

It happens after this code gets executed when a weapon gets equipped:



Mesh1P->SetAnimationMode(EAnimationMode::AnimationBlueprint);
Mesh1P->SetAnimInstanceClass(AnimInstanceFP);

if (Mesh1P->GetAnimInstance())
{
       UTOWeaponAnimInstance* ai = Cast<UTOWeaponAnimInstance>(Mesh1P->GetAnimInstance());
       if (ai)
       {
             ai->Weapon = this;
       }
}

Pawn->GetMesh1P()->SetMasterPoseComponent(Mesh1P);
Pawn->GetMesh1P()->bUseBoundsFromMasterPoseComponent = false;
Mesh1P->AttachToComponent(Pawn->GetMesh1P(), FAttachmentTransformRules::SnapToTargetIncludingScale);


I had this issue once in the past after moving to 4.18 or 4.19 I think, but setting bUseBoundsFromMasterPoseComponent to false on the Pawn’s arm mesh fixed this issue.
Sadly it came back after going to 4.20.

The weapon animations work like in 4.19 tho; without any flaw, but the log gets spammed with this warning.

I guess the problem is that the masterpose component of the arm mesh is its child.

Any suggestions? Is this a bug? :rolleyes:

Edit: Appearently adding


Pawn->GetMesh1P()->PrimaryComponentTick.RemovePrerequisite(GetMesh1P(), GetMesh1P()->PrimaryComponentTick);

works around the problem; not sure if this is actually a clean solution…

Cheers,
Th