Navigation
API > API/Plugins > API/Plugins/MetaHumanCharacterPalette
A 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.
| Name | FEditorOnlyAssetReference |
| Type | struct |
| Header File | /Engine/Plugins/MetaHuman/MetaHumanCharacter/Source/MetaHumanCharacterPalette/Public/EditorOnlyAssetReference.h |
| Include Path | #include "EditorOnlyAssetReference.h" |
Syntax
USTRUCT (BlueprintType )
struct FEditorOnlyAssetReference
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FEditorOnlyAssetReference
(
const UObject* InObject |
EditorOnlyAssetReference.h | ||
FEditorOnlyAssetReference
(
const FSoftObjectPath& InPath |
EditorOnlyAssetReference.h | ||
FEditorOnlyAssetReference
(
const TSoftObjectPtr< UObject >& InAsset |
EditorOnlyAssetReference.h | ||
| EditorOnlyAssetReference.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Asset | TSoftObjectPtr< UObject > | Authoritative editor-only reference | EditorOnlyAssetReference.h |
|
| AssetIdentifier | FSoftObjectPath | Runtime-available identifier. | EditorOnlyAssetReference.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UObject * Get() |
EditorOnlyAssetReference.h | ||
FString GetAssetName() |
EditorOnlyAssetReference.h | ||
bool IsNull() |
These functions operate on the reference as an identifier and can be used in any build | EditorOnlyAssetReference.h | |
bool IsValid() |
EditorOnlyAssetReference.h | ||
UObject * LoadSynchronous() |
These functions involve loading or fetching the referenced object and are therefore editor-only | EditorOnlyAssetReference.h | |
void Reset() |
EditorOnlyAssetReference.h | ||
bool Serialize
(
FArchive& Ar |
EditorOnlyAssetReference.h | ||
bool SerializeFromMismatchedTag
(
const FPropertyTag& Tag, |
EditorOnlyAssetReference.h | ||
FSoftObjectPath ToSoftObjectPath() |
Returns the stored asset path. Available in all builds | EditorOnlyAssetReference.h | |
TSoftObjectPtr< UObject > ToSoftObjectPtr() |
Returns the editor-only TSoftObjectPtr | EditorOnlyAssetReference.h | |
FString ToString() |
EditorOnlyAssetReference.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FEditorOnlyAssetReference & operator=
(
const TSoftObjectPtr< UObject >& InAsset |
EditorOnlyAssetReference.h | ||
FEditorOnlyAssetReference & operator=
(
const UObject* InObject |
EditorOnlyAssetReference.h | ||
FEditorOnlyAssetReference & operator=
(
const FSoftObjectPath& InPath |
EditorOnlyAssetReference.h |