Skip to content

Instantly share code, notes, and snippets.

@kohyuk91
Created August 19, 2020 14:50
Show Gist options
  • Save kohyuk91/d4abe6108768785f7ff58c228405c31e to your computer and use it in GitHub Desktop.
Save kohyuk91/d4abe6108768785f7ff58c228405c31e to your computer and use it in GitHub Desktop.
import unreal
asset_tools = unreal.AssetToolsHelpers.get_asset_tools()
soft_references = asset_tools.find_soft_references_to_object(unreal.SoftObjectPath(path_string='/Game/InfinityBladeGrassLands/NewLevelSequence1.NewLevelSequence1'))
# [LevelSequenceActor'"/Game/InfinityBladeGrassLands/Maps/ElvenRuins.ElvenRuins:PersistentLevel.NewLevelSequence1"']
umap = soft_references[0].get_world()
# <Object '/Game/InfinityBladeGrassLands/Maps/ElvenRuins.ElvenRuins' (0x000001BCACF82B00) Class 'World'>
unreal.log(umap.get_path_name())
# /Game/InfinityBladeGrassLands/Maps/ElvenRuins.ElvenRuins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment