How can I exclude objects from build?

Is there currently any way to flag an object to be excluded during the in editor level build process? I’ve been sorting through the engine code for awhile trying to find one and haven’t come up with anything.

Even just a way to check whether the engine is currently in the build phase so I can manually exclude my objects would be great. All I’ve found for that is “IsInRenderingThread()” and “IsInGameThread()” and they don’t help here.

I see this in source code

#if WITH_EDITOR

 Put code that ill be included in editor build

#endif

So if you want something to be excluded you negate the flag

#if !WITH_EDITOR  

Thats build time, the runtime solution is… it should return true if you currently running in editor… i think

GEngine->IsEditor();

While useful that doesn’t solve my problem as GEngine->IsEditor() returns true also for the in editor gameplay and previews making testing useless. I have another lead I’ll check out though, thanks.