unreal.EditorOnlyAssetReference¶
- class unreal.EditorOnlyAssetReference¶
Bases:
StructBaseA reference to a UObject asset that can be used as an identifier in cooked builds without causing the referenced asset to be cooked as a dependency.
In editor builds the reference uses a TSoftObjectPtr, so moving or renaming the referenced asset updates this property as it would any other soft pointer.
The API is intentionally very similar to TSoftObjectPtr, so that it can be used as a drop-in replacement for it in many cases.
This struct can even be used to replace an existing TSoftObjectPtr UPROPERTY. Existing saved data that wrote the property as a TSoftObjectPtr migrates automatically on load via SerializeFromMismatchedTag. No core redirect, rename, or deprecation is required, but note that the conversion only works from TSoftObjectPtr to FEditorOnlyAssetReference. Once the FEditorOnlyAssetReference is saved into the object, it can’t be automatically converted back to TSoftObjectPtr if the code change is reverted.
C++ Source:
Plugin: MetaHumanCharacter
Module: MetaHumanCharacterPalette
File: EditorOnlyAssetReference.h
Editor Properties: (see get_editor_property/set_editor_property)
asset(Object): [Read-Write] Authoritative editor-only reference