From 982ce0bf09293de5ccc0ad2b4816a37872faf380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 2 Jul 2024 16:58:58 +0200 Subject: [PATCH 1/2] :art: add `staticMesh` product type to loader plugin --- client/ayon_unreal/plugins/load/load_layout.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/ayon_unreal/plugins/load/load_layout.py b/client/ayon_unreal/plugins/load/load_layout.py index 25883a1f..4dc90d00 100644 --- a/client/ayon_unreal/plugins/load/load_layout.py +++ b/client/ayon_unreal/plugins/load/load_layout.py @@ -69,12 +69,13 @@ def _get_fbx_loader(loaders, family): name = "" if family == 'rig': name = "SkeletalMeshFBXLoader" - elif family == 'model': + elif family in ['model', 'staticMesh']: name = "StaticMeshFBXLoader" elif family == 'camera': name = "CameraLoader" if name == "": + return None for loader in loaders: @@ -88,7 +89,7 @@ def _get_abc_loader(loaders, family): name = "" if family == 'rig': name = "SkeletalMeshAlembicLoader" - elif family == 'model': + elif family in ['model', 'staticMesh']: name = "StaticMeshAlembicLoader" if name == "": @@ -387,7 +388,9 @@ def _process(self, lib_path, asset_dir, sequence, repr_loaded=None): if not loader: self.log.error( - f"No valid loader found for {repre_id}") + f"No valid loader found for {repre_id} " + f"({repr_format}) " + f"{product_type}") continue options = { @@ -427,7 +430,7 @@ def _process(self, lib_path, asset_dir, sequence, repr_loaded=None): actors = [] - if product_type == 'model': + if product_type in ['model', 'staticMesh']: actors, _ = self._process_family( assets, 'StaticMesh', transform, basis, sequence, inst @@ -489,7 +492,7 @@ def _remove_actors(self, path): asset_container.get_asset(), "family") assets = EditorAssetLibrary.list_assets( str(package_path), recursive=False) - if family == 'model': + if family in ['model', 'staticMesh']: self._remove_family( assets, static_meshes_comp, 'StaticMesh', 'static_mesh') elif family == 'rig': From 78341fffbc71860f8dc6ae7a24b08dc98edf6c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 2 Jul 2024 17:07:22 +0200 Subject: [PATCH 2/2] :art: add skeletal mesh --- client/ayon_unreal/plugins/load/load_layout.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/ayon_unreal/plugins/load/load_layout.py b/client/ayon_unreal/plugins/load/load_layout.py index 4dc90d00..4aba8d32 100644 --- a/client/ayon_unreal/plugins/load/load_layout.py +++ b/client/ayon_unreal/plugins/load/load_layout.py @@ -67,7 +67,7 @@ def _get_asset_containers(self, path): @staticmethod def _get_fbx_loader(loaders, family): name = "" - if family == 'rig': + if family in ['rig', 'skeletalMesh']: name = "SkeletalMeshFBXLoader" elif family in ['model', 'staticMesh']: name = "StaticMeshFBXLoader" @@ -87,7 +87,7 @@ def _get_fbx_loader(loaders, family): @staticmethod def _get_abc_loader(loaders, family): name = "" - if family == 'rig': + if family in ['rig', 'skeletalMesh']: name = "SkeletalMeshAlembicLoader" elif family in ['model', 'staticMesh']: name = "StaticMeshAlembicLoader" @@ -435,7 +435,7 @@ def _process(self, lib_path, asset_dir, sequence, repr_loaded=None): assets, 'StaticMesh', transform, basis, sequence, inst ) - elif product_type == 'rig': + elif product_type in ['rig', 'skeletalMesh']: actors, bindings = self._process_family( assets, 'SkeletalMesh', transform, basis, sequence, inst @@ -495,7 +495,7 @@ def _remove_actors(self, path): if family in ['model', 'staticMesh']: self._remove_family( assets, static_meshes_comp, 'StaticMesh', 'static_mesh') - elif family == 'rig': + elif family in ['rig', 'skeletalMesh']: self._remove_family( assets, skel_meshes_comp, 'SkeletalMesh', 'skeletal_mesh')