I’ve got following code in my actor
// header
...
#if WITH_EDITOR
UPROPERTY(Transient)
class UProceduralMeshComponent* ProceduralMesh;
#endif
...
// cpp, constructor
...
#if WITH_EDITOR
static ConstructorHelpers::FObjectFinder<UMaterial> GridMaterial(TEXT("Material'/Game/Common/M_PathGrid.M_PathGrid'"));
ProceduralMesh = CreateDefaultSubobject<UProceduralMeshComponent>(TEXT("GeneratedMesh"), true); // Notice true as second parameter
ProceduralMesh->SetMaterial(0, GridMaterial.Object);
ProceduralMesh->SetupAttachment(RootComponent);
#endif
...
The intention is simple: I don’t want this component to be saved or loaded to disk since it contains large mesh and should only be avaialble in editor. It’s used for debugging purposes only.
However it’s still saved when I press save and loaded when I open level after editor restart. Also tried SkipSerialization, didn’t help. And I see this component when I select the actor in the editor.
How can I totally exclude component from being serialized? I will always generate its content on the fly when necessary.