unreal.PrimaryAssetId

class unreal.PrimaryAssetId(primary_asset_type: PrimaryAssetType = Ellipsis, primary_asset_name: Name = 'None')

Bases: StructBase

This identifies an object as a “primary” asset that can be searched for by the AssetManager and used in various tools note: The full C++ class is located here: EngineSourceRuntimeCoreUObjectPublicUObjectPrimaryAssetId.h

C++ Source:

  • Module: CoreUObject

  • File: NoExportTypes.h

Editor Properties: (see get_editor_property/set_editor_property)

  • primary_asset_name (Name): [Read-Write] The Name of this object, by default its short name

  • primary_asset_type (PrimaryAssetType): [Read-Write] The Type of this object, by default its base class’s name

__bool__() bool

Returns true if the Primary Asset Id is valid

__eq__(other: object) bool

Overloads:

  • PrimaryAssetId Returns true if the values are equal (A == B)

__ne__(other: object) bool

Overloads:

  • PrimaryAssetId Returns true if the values are not equal (A != B)

get_class()

Returns the Blueprint Class associated with a Primary Asset Id, this will only return a valid object if it is in memory, it will not load it

Return type:

type(Class)

get_current_bundle_state(force_current_state) Array[Name] or None

Returns the list of loaded bundles for a given Primary Asset. This will return false if the asset is not loaded at all. If ForceCurrentState is true it will return the current state even if a load is in process

Parameters:

force_current_state (bool) –

Returns:

out_bundles (Array[Name]):

Return type:

Array[Name] or None

get_object() Object

Returns the Object associated with a Primary Asset Id, this will only return a valid object if it is in memory, it will not load it

Return type:

Object

get_soft_class_reference() Class

Returns the Blueprint Class Id associated with a Primary Asset Id, this works even if the asset is not loaded

Return type:

Class

get_soft_object_reference() Object

Returns the Object Id associated with a Primary Asset Id, this works even if the asset is not loaded

Return type:

Object

is_valid() bool

Returns true if the Primary Asset Id is valid

Return type:

bool

property primary_asset_name: Name

[Read-Write] The Name of this object, by default its short name

Type:

(Name)

property primary_asset_type: PrimaryAssetType

[Read-Write] The Type of this object, by default its base class’s name

Type:

(PrimaryAssetType)

to_string() str

Converts a Primary Asset Id to a string. The other direction is not provided because it cannot be validated

Return type:

str

unload() None

Unloads a primary asset, which allows it to be garbage collected if nothing else is referencing it