TSoftObjectPtr

[TSoftObjectPtr](API\Runtime\CoreUObject\UObject\TSoftObjectPtr) is templatized wrapper of the generic [FSoftObjectPtr](API\Runtime\CoreUObject\UObject\FSoftObjectPtr), it can be used in UProperties

Windows
MacOS
Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/SoftObjectPtr.h

Include

#include "UObject/SoftObjectPtr.h"

Syntax

template<class T>
struct TSoftObjectPtr

Remarks

TSoftObjectPtr is templatized wrapper of the generic FSoftObjectPtr, it can be used in UProperties

Constructors

Name Description

Public function

TSoftObjectPtr()

Default constructor, will be null

Public function

TSoftObjectPtr

(
    const TSoftObjectPtr< U >& Other
)

Construct from another soft pointer

Public function

TSoftObjectPtr

(
    TSoftObjectPtr< U >&& Other
)

Construct from a moveable soft pointer

Public function

TSoftObjectPtr

(
    const U* Object
)

Construct from an object already in memory

Public function

TSoftObjectPtr

(
    TYPE_OF_NULLPTR
)

Construct from a nullptr

Public function

TSoftObjectPtr

(
    FSoftObjectPath ObjectPath
)

Construct from a soft object path

Functions

Name Description

Public function Const

T *

 

Get()

Dereference the soft pointer.

Public function Const

FString

 

GetAssetName()

Returns assetname string, leaving off the /package/path part

Public function Const

FString

 

GetLongPackageName()

Returns /package/path string, leaving off the asset name

Public function Const

const FSoftO...

 

GetUniqueID()

Returns the StringObjectPath that is wrapped by this SoftObjectPtr

Public function Const

bool

 

IsNull()

Test if this can never point to a live UObject

Public function Const

bool

 

IsPending()

Test if this does not point to a live UObject, but may in the future

Public function Const

bool

 

IsValid()

Test if this points to a live UObject

Public function Const

T *

 

LoadSynchronous()

Synchronously load (if necessary) and return the asset object represented by this asset ptr

Public function

void

 

Reset()

Reset the soft pointer back to the null state

Public function

void

 

ResetWeakPtr()

Resets the weak ptr only, call this when ObjectId may change

Public function Const

const FSoftO...

 

ToSoftObjectPath()

Returns the StringObjectPath that is wrapped by this SoftObjectPtr

Public function Const

FString

 

ToString()

Returns string representation of reference, in form /package/path.assetname

Operators

Name Description

Public function Const

 

operator bool()

Dereference soft pointer to see if it points somewhere valid

Public function Const

T &

 

operator*()

Dereference the soft pointer

Public function

TSoftObjectP...

 

operator=

(
    TSoftObjectPtr< U > Other
)

Copy from another soft pointer

Public function

TSoftObjectP...

 

operator=

(
    const TWeakObjectPtr< U >& Other
)

Copy from a weak pointer to an object already in memory

Public function

TSoftObjectP...

 

operator=

(
    FSoftObjectPath ObjectPath
)

Copy from a soft object path

Public function

TSoftObjectP...

 

operator=

(
    const U* Object
)

Copy from an object already in memory

Public function

TSoftObjectP...

 

operator=

(
    TYPE_OF_NULLPTR
)

Assign from a nullptr

Public function Const

T *

 

operator->()

Dereference the soft pointer

Deprecated Functions

Name Description

Public function Const

const FSoftO...

 

ToStringReference()

ToStringReference was renamed to ToSoftObjectPath

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback