Is this an appropriate way to copy anim BP in c++

I know typically directly accessing members is supposed to be frowned on, in place of getters and setters… but for the life of me I couldn’t manage to get it to work without directly setting them:

Headslot->AnimClass = GetAttachmentRootActor()->FindComponentByClass<USkeletalMeshComponent>()->AnimClass;

While trying to use the various getters and setters involving anim blueprints, none would like up. Either crashes during runtime or funky “uaniminstance undefined” type errors.

Is there a more orthodox manner?

Are you trying to play the same animation on another skeletal mesh component?

If so then:

Headslot->SetMasterPoseComponent(NewMasterBoneComponent);

Wait… I don’t have to give it the same anim blueprint class AND set master component???

No, once you set a master component the master drives the slave skeleton using the master’s animbp class.