How can I tell if an Actor is a Preview Actor?

Hello, I have an editor related question. I have my own asset type in content browser (UObject derived). I drag it from content browser into a viewport, this creates an actor (AActor derived) and corresponding component inside that actor.

The issue is the following: it creates in fact two actors. First actor, is the preview actor and exists (as far as I can tell) between the moments of when I pick the asset in content browser and drop it into the viewport. At that point, this preview actor is destroyed and a new proper actor is created and added into my scene.

My question is, is there a way to tell that an actor is a preview actor? My actors require some heavy loading/cooking done and I would rather not do it if instance is only temporary.

Thank you.

The preview actor will have the RF_Transient object flag. You can check with Actor->HasAnyFlags(RF_Transient). Transient means not saved.

Thank you, that seemed to have worked. Can I ask you, what is the purpose of preview actors?

So you can see the actor as you drag it out of the content browser and around in the level. It gives you an idea where it will be placed. Without an actor this would not render properly.