Hi, I am writing some tools for ControlRig and am stuck trying to actually get the UControlRig from the selected actor.
I can get the actor via this snippet, but am unsure how to get the UControlRig asset is was created with.
My current goal is to check if the selected actors are of type UControlRig
if (USelection* SelectedActors = GEditor->GetSelectedActors()) {
for (FSelectionIterator Iter(*SelectedActors); Iter; ++Iter) {
if ( AActor* Actor = Cast<AActor>(*Iter) ) {
// Gets here
if (UControlRig* ControlRig = Cast<UControlRig>( *Actor )) {
// Does not get here
}
}
}
}
I apologize if this has been asked before, I am new to unreal engine.
Sorry I think I phrased it poorly, Once I drag a c++ asset in to the level it becomes an actor, So I want to know how to access the c++ class methods from the actor in the scene.
That makes sense, But it still leaves me with the issue of how would I determine if the selected actors (in this case a SkeletalMeshActor) belongs to a ControlRig
To elaborate, the control rig mannequin inherits UControlRig, when this blueprint is dragged into the editor it creates a SkeletalMeshActor in the world outliner. If the user selects this and runs my tool I need to check if that skeletalmeshactor supports a control rig