diff --git a/client/ayon_maya/plugins/create/create_layout.py b/client/ayon_maya/plugins/create/create_layout.py index 956b3fcf..1d9bc2c1 100644 --- a/client/ayon_maya/plugins/create/create_layout.py +++ b/client/ayon_maya/plugins/create/create_layout.py @@ -1,5 +1,5 @@ from ayon_maya.api import plugin -from ayon_core.lib import BoolDef, EnumDef +from ayon_core.lib import BoolDef class CreateLayout(plugin.MayaCreator): @@ -17,9 +17,5 @@ def get_instance_attr_defs(self): label="Group Loaded Assets", tooltip="Enable this when you want to publish group of " "loaded asset", - default=False), - EnumDef("layout_options", - items=["fbx", "abc"], - label="Export Layout Options", - default="fbx") + default=False) ] diff --git a/client/ayon_maya/plugins/publish/collect_layout_options.py b/client/ayon_maya/plugins/publish/collect_layout_options.py deleted file mode 100644 index 6d92d120..00000000 --- a/client/ayon_maya/plugins/publish/collect_layout_options.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -import pyblish.api -from ayon_maya.api import plugin - - -class CollectLayoutOptions(plugin.MayaInstancePlugin): - """Collect Camera for FBX export.""" - - order = pyblish.api.CollectorOrder + 0.2 - label = "Collect Layout Options" - families = ["layout"] - - def process(self, instance): - if instance.data.get("layout_options") == "fbx": - instance.data["families"] += ["layout.fbx"] - elif instance.data.get("layout_options") == "abc": - instance.data["families"] += ["layout.abc"] - else: - self.log.error("No layout options found.") diff --git a/client/ayon_maya/plugins/publish/extract_layout.py b/client/ayon_maya/plugins/publish/extract_layout.py index 33b5348a..d429ec40 100644 --- a/client/ayon_maya/plugins/publish/extract_layout.py +++ b/client/ayon_maya/plugins/publish/extract_layout.py @@ -32,8 +32,8 @@ def convert_matrix_to_4x4_list( class ExtractLayout(plugin.MayaExtractorPlugin): """Extract a layout.""" - label = "Extract Layout(FBX)" - families = ["layout.fbx"] + label = "Extract Layout" + families = ["layout"] project_container = "AVALON_CONTAINERS" def process(self, instance): @@ -82,11 +82,8 @@ def process(self, instance): representation = get_representation_by_id( project_name, representation_id, - fields={"versionId", "context"} + fields={"versionId", "context", "name"} ) - - self.log.debug(representation) - version_id = representation["versionId"] # TODO use product entity to get product type rather than # data in representation 'context' @@ -100,7 +97,8 @@ def process(self, instance): "instance_name": cmds.getAttr( "{}.namespace".format(container)), "representation": str(representation_id), - "version": str(version_id) + "version": str(version_id), + "extension": repre_context["ext"] } local_matrix = cmds.xform(asset, query=True, matrix=True) @@ -158,7 +156,7 @@ def create_transformation_matrix(self, local_matrix, local_rotation): return t_matrix def convert_transformation_matrix(self, transform_mm: om.MMatrix, rotation: list) -> om.MMatrix: - """Convert matrix to list of transformation matrix for Unreal Engine import. + """Convert matrix to list of transformation matrix for Unreal Engine fbx asset import. Args: transform_mm (om.MMatrix): Local Matrix for the asset @@ -180,36 +178,3 @@ def convert_transformation_matrix(self, transform_mm: om.MMatrix, rotation: list convert_transform.setScale([convert_scale[0], convert_scale[2], convert_scale[1]], om.MSpace.kObject) return convert_transform.asMatrix() - - -class ExtractLayoutAbc(ExtractLayout): - """Extract a layout.""" - - label = "Extract Layout(Abc)" - families = ["layout.abc"] - project_container = "AVALON_CONTAINERS" - - def convert_transformation_matrix(self, transform_mm: om.MMatrix, rotation: list) -> om.MMatrix: - """Convert matrix to list of transformation matrix for Unreal Engine import. - - Args: - transform_mm (om.MMatrix): Local Matrix for the asset - rotation (list): Rotations of the asset - - Returns: - List[om.MMatrix]: List of transformation matrix of the asset - """ - # TODO: need to find the correct implementation of layout for alembic - convert_transform = om.MTransformationMatrix(transform_mm) - - convert_translation = convert_transform.translation(om.MSpace.kWorld) - convert_translation = om.MVector(convert_translation.x, convert_translation.z, convert_translation.y) - convert_scale = convert_transform.scale(om.MSpace.kObject) - convert_transform.setTranslation(convert_translation, om.MSpace.kWorld) - converted_rotation = om.MEulerRotation( - math.radians(rotation[0]), math.radians(rotation[2]), math.radians(rotation[1]) - ) - convert_transform.setRotation(converted_rotation) - convert_transform.setScale([convert_scale[0], convert_scale[2], convert_scale[1]], om.MSpace.kObject) - - return convert_transform.asMatrix() \ No newline at end of file