I need some help with a few basic python topics.
-
How can i test if a level exists?
I tried this:
unreal.EditorAssetLibrary.does_asset_exist(levelName)but i get the message:
“Warning: The AssetData ‘/Game/path/levelName.levelName’ exist but is not accessible because it is of type Map/Level.”
I need to run a function as part of a pipeline automation process…
if thisLevelExists:
unreal.LevelEditorSubsystem.set_current_level_by_name(levelName)
else:
thisLevel = unreal.LevelEditorSubsystem.new_level_from_template(levelName,templatelevel)
-
How do you cast the object name from the path name?
Unreal can’t do things because the functions expect object IDs not stringsthis_thing_asObject = unreal.what do I use here?
I would like to write a python function that would return the object ID for all types of things: levels, assets, etc.
python
Editor Scripting
UnrealEngine 5.0.1