TSoftClassPtr

[TSoftClassPtr](API\Runtime\CoreUObject\UObject\TSoftClassPtr) is a templatized wrapper around [FSoftObjectPtr](API\Runtime\CoreUObject\UObject\FSoftObjectPtr) that works like a [TSubclassOf](API\Runtime\CoreUObject\Templates\TSubclassOf), it can be used in UProperties for blueprint subclasses

Windows
MacOS
Linux

References

Module

CoreUObject

Header

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

Include

#include "UObject/SoftObjectPtr.h"

Syntax

template<class TClass>
class TSoftClassPtr

Remarks

TSoftClassPtr is a templatized wrapper around FSoftObjectPtr that works like a TSubclassOf, it can be used in UProperties for blueprint subclasses

Constructors

Name Description

Public function

TSoftClassPtr()

Default constructor, will be null

Public function

TSoftClassPtr

(
    const TSoftClassPtr< TClassA >& Ot...
)

Construct from another soft pointer

Public function

TSoftClassPtr

(
    const UClass* From
)

Construct from a class already in memory

Public function

TSoftClassPtr

(
    const FSoftObjectPath& ObjectPath
)

Construct from a soft object path

Functions

Name Description

Public function Const

UClass *

 

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

UClass *

 

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

UClass &

 

operator*()

Dereference the soft pointer

Public function

TSoftClassPt...

 

operator=

(
    const TSoftObjectPtr< TClassA >& O...
)

Copy from another soft pointer

Public function

TSoftClassPt...

 

operator=

(
    const TWeakObjectPtr< TClassA >& O...
)

Copy from a weak pointer already in memory

Public function

void

 

operator=

(
    const FSoftObjectPath& ObjectPath
)

Copy from a soft object path

Public function

void

 

operator=

(
    const UClass* From
)

Copy from a class already in memory

Public function Const

UClass *

 

operator->()

Dereference the soft pointer

Deprecated Functions

Name Description

Public function Const

const FSoftO...

 

ToStringReference()

ToStringReference was renamed to ToSoftObjectPath

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss