How to prevent Level mark dirty from variable changes?


UPROPERTY(Edit_somewhere, NonTransactional, Category="...")

Does not work at all, it saves to history anyway.

I want to prevent changes in level (prevent unnecessary level changes), All my properties are “EditDefaultsOnly”, so there is no reason to save changes to map. There are blueprint values only.
Steps:

  • OpenBlueprint;
  • Change come actor variables(EditDefaultsOnly), that calls “void OnConstruction (const Ftransform&)”, components moving or creating;

Result: Umap marks as dirty (needs save changes)
Expected: Umap keeps clean, blueprint marks dirty.

I tried to fix it this way:


MyActor::OnConstruction( ... ) {
   GetOutermost()->SetDirtyFlag(false);
   ...
}

In this way construction script does not mark level dirty. But blueprint marks dirty, that’s great! There are blueprint changes, not level.

But then, when I move an object inside a level - construction script calls again (but bRunConstructionScriptOnDrag was set to false) and marks dirty to false. If I change an object position - it does not write to undo-redo.

  1. Is there any way to avoid making dirty in level, but mark dirty blueprint editor.
  2. Is it an expected behavior?
  3. Do objects, generated in ConstructionScript save transactions? How to chech or prevent it?
1 Like