FSoftObjectPath
#include "UObject/SoftObjectPath.h" Description
A string-based reference to a UObject asset stored as a top-level asset path plus an optional sub-object path. Used as the underlying storage for TSoftObjectPtr and TSoftClassPtr.
Caveats & Gotchas
- • The path format is `/PackageName/AssetName.AssetName` for top-level assets. Sub-objects use `/Package/Asset.Asset:SubObject`.
- • Validity of the path (IsValid()) only means the string is non-empty — it does not check if the asset exists on disk.
- • Use the Asset Registry to verify an asset exists before attempting a load.
Signature
struct FSoftObjectPath Example
Construct and use an FSoftObjectPath C++
FSoftObjectPath Path(TEXT("/Game/Meshes/SM_Rock.SM_Rock"));
if (Path.IsValid())
{
UObject* Asset = Path.TryLoad(); // blocking load
UStaticMesh* Mesh = Cast<UStaticMesh>(Asset);
} Functions (20)
Utility 11 ▼
| Access | Type | Name |
|---|---|---|
| public | function | FSoftObjectPath::Reset |
| public | function | FSoftObjectPath::SetPath |
| public | function | FSoftObjectPath::ToString |
| public | function | FSoftObjectPath::AppendString |
| public | function | FSoftObjectPath::FixupCoreRedirects |
| public | function | FSoftObjectPath::SetSubPathString |
| public | function | FSoftObjectPath::AddPIEPackageName |
| public | function | FSoftObjectPath::ClearPIEPackageNames |
| public | function | FSoftObjectPath::FixupForPIE |
| public | function | FSoftObjectPath::RemapPackage |
| public | function | UE_SOFTOBJECTPATH_FSTRING_DEPRECATED |
Asset Loading 2 ▼
| Access | Type | Name |
|---|---|---|
| public | function | FSoftObjectPath::TryLoad |
| public | function | FSoftObjectPath::LoadAsync |
Serialization 7 ▼
| Access | Type | Name |
|---|---|---|
| public | function | FSoftObjectPath::SerializePath |
| public | function | FSoftObjectPath::ExportTextItem |
| public | function | FSoftObjectPath::ImportTextItem |
| public | function | FSoftObjectPath::PostLoadPath |
| public | function | FSoftObjectPath::PreSavePath |
| public | function | FSoftObjectPath::SerializeFromMismatchedTag |
| public | function | FSoftObjectPath::SerializePathWithoutFixup |
See Also
Tags
Version History
Introduced in: 4.18
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?