Navigation
API > API/Runtime > API/Runtime/CoreUObject
FSoftObjectPtr is a type of weak pointer to a UObject, that also keeps track of the path to the object on disk. It will change back and forth between being Valid and Pending as the referenced object loads or unloads. It has no impact on if the object is garbage collected or not.
This is useful to specify assets that you may want to asynchronously load on demand.
| Name | FSoftObjectPtr |
| Type | struct |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/SoftObjectPtr.h |
| Include Path | #include "UObject/SoftObjectPtr.h" |
Syntax
struct FSoftObjectPtr : public TPersistentObjectPtr< FSoftObjectPath >
Inheritance Hierarchy
- TPersistentObjectPtr → FSoftObjectPtr
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSoftObjectPtr
(
TObjectPtr< T > Object |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr
(
const UObject* Object |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr
(
FObjectPtr Object |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr
(
const FSoftObjectPath& ObjectPath |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr
(
FSoftObjectPtr&& Other |
UObject/SoftObjectPtr.h | ||
| UObject/SoftObjectPtr.h | |||
FSoftObjectPtr
(
const FSoftObjectPtr& Other |
UObject/SoftObjectPtr.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FSoftObjectPtr() |
UObject/SoftObjectPtr.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Super | TPersistentObjectPtr< FSoftObjectPath > | UObject/SoftObjectPtr.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UObject * Get() |
Overridden to deal with PIE lookups | UObject/SoftObjectPtr.h | |
FString GetAssetName() |
Returns assetname string, leaving off the /package/path. part | UObject/SoftObjectPtr.h | |
FName GetLongPackageFName() |
Returns /package/path name, leaving off the asset name | UObject/SoftObjectPtr.h | |
FString GetLongPackageName() |
Returns /package/path string, leaving off the asset name | UObject/SoftObjectPtr.h | |
UObject * LoadSynchronous() |
Synchronously load (if necessary) and return the asset object represented by this asset ptr | UObject/SoftObjectPtr.h | |
const FSoftObjectPath & ToSoftObjectPath() |
Returns the StringObjectPath that is wrapped by this SoftObjectPtr | UObject/SoftObjectPtr.h | |
FString ToString() |
Returns string representation of reference, in form /package/path.assetname | UObject/SoftObjectPtr.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSoftObjectPtr & operator=
(
const UObject* Ptr |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr & operator=
(
const FSoftObjectPtr& Other |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr & operator=
(
FSoftObjectPtr&& Other |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr & operator=
(
FObjectPtr Ptr |
UObject/SoftObjectPtr.h | ||
FSoftObjectPtr & operator=
(
TObjectPtr< T > Ptr |
UObject/SoftObjectPtr.h |