Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3239 from simonebarbieri/bugfix/ue5-fix_render
Browse files Browse the repository at this point in the history
Unreal: Fixed Render creation in UE5
  • Loading branch information
antirotor authored May 26, 2022
2 parents d0bcfe2 + 1b76f86 commit 02ab153
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions openpype/hosts/unreal/plugins/create/create_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ def process(self):

ar = unreal.AssetRegistryHelpers.get_asset_registry()

# The asset name is the the third element of the path which contains
# the map.
# The index of the split path is 3 because the first element is an
# empty string, as the path begins with "/Content".
a = unreal.EditorUtilityLibrary.get_selected_assets()[0]
asset_name = a.get_path_name().split("/")[3]

# Get the master sequence and the master level.
# There should be only one sequence and one level in the directory.
filter = unreal.ARFilter(
class_names=["LevelSequence"],
package_paths=[f"/Game/OpenPype/{self.data['asset']}"],
package_paths=[f"/Game/OpenPype/{asset_name}"],
recursive_paths=False)
sequences = ar.get_assets(filter)
ms = sequences[0].get_editor_property('object_path')
filter = unreal.ARFilter(
class_names=["World"],
package_paths=[f"/Game/OpenPype/{self.data['asset']}"],
package_paths=[f"/Game/OpenPype/{asset_name}"],
recursive_paths=False)
levels = ar.get_assets(filter)
ml = levels[0].get_editor_property('object_path')
Expand Down

0 comments on commit 02ab153

Please sign in to comment.