Thanks for your answer. But the idea is to not know it in advance. Imagine that I have hundreds of Blueprints that I haven’t made.
I did this:
inside an editor class:
for (TActorIterator<AActor> It(World, AActor::StaticClass()); It; ++It)
{
if (MyLib::HasConstructorComponents(*It))
//do stuff
.....
}
bool MyLib::HasConstructorComponents(AActor* Actor)
{
for (UActorComponent* Comp : Actor->GetComponents())
{
if (Comp->CreationMethod == EComponentCreationMethod::UserConstructionScript)
{
return true;
}
}
return false;
}