Loading Assets

Loading assets from the Content browser

A common operation is to load an asset from the Content Browser. Unreal provides a few different options here:

# Python-only convenience method:
asset_path = "/Game/some/asset/path"
asset = unreal.load_asset(asset_path)
# Function Library method:
asset_path = "/Game/some/asset/path"
asset = unreal.EditorAssetLibrary.load_asset(asset_path)
# Subsystem method:
asset_path = "/Game/some/asset/path"
EditorAssetSubsystem = unreal.get_editor_subsystem(unreal.EditorAssetSubsystem)
asset = EditorAssetSubsystem.load_asset(asset_path)

While it doesn't really matter which option is used, unreal.load_asset() is a rare instance of a Python convenience function provided by Epic

Note: This isn't too uncommon in Unreal's API to see multiple options for the same thing, a general rule of thumb to be aware of is:

  • If it's available from a Subsystem class, those are usually the newer / forward-facing implementations

  • If it's available from a Library class, those are usually from UE4 implementations and it's usually recommended to see if the same function is available from a Subsystem.

  • If it's available as unreal.* , those are usually conveniences that Epic provided intentionally to the Python API

Last updated