Hey Guys,
Give the following code, how can I determine which level the loaded sequence asset belongs to ?
# Get the asset data
asset_data = unreal.AssetRegistryHelpers.get_asset_registry().get_asset_by_object_path(assetPath)
if asset_data:
asset = asset_data.get_asset()
# Get the asset class
asset_class = asset_data.get_class()
# Print or return the asset class to determine the type
if asset_class.get_class_path_name().asset_name == "World":
unreal.log(f"Asset Path: {assetPath}, Asset Type: {asset_class.get_class_path_name().asset_name}")
elif asset_class.get_class_path_name().asset_name == "LevelSequence":
unreal.log(f"Asset Path: {assetPath}, Asset Type: {asset_class.get_class_path_name().asset_name}")
# Load the sequence asset
sequence_asset = unreal.EditorAssetLibrary.load_asset(assetPath)
if sequence_asset:
unreal.log("Sequence Asset loaded successfully!")
unreal.log_warning(sequence_asset.get_name())
unreal.log_warning(level_sequence.get_playback_range())