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

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