diff --git a/openpype/hosts/maya/plugins/create/create_mayascene.py b/openpype/hosts/maya/plugins/create/create_mayascene.py index b61c97aebf..c6bf1662a1 100644 --- a/openpype/hosts/maya/plugins/create/create_mayascene.py +++ b/openpype/hosts/maya/plugins/create/create_mayascene.py @@ -1,4 +1,5 @@ from openpype.hosts.maya.api import plugin +from openpype.lib import BoolDef class CreateMayaScene(plugin.MayaCreator): @@ -9,3 +10,12 @@ class CreateMayaScene(plugin.MayaCreator): label = "Maya Scene" family = "mayaScene" icon = "file-archive-o" + + def get_instance_attr_defs(self): + return [ + BoolDef( + "preserve_references", + label="Preserve References", + default=True + ) + ] diff --git a/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py b/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py index ab170fe48c..bfce0607e1 100644 --- a/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py +++ b/openpype/hosts/maya/plugins/publish/extract_maya_scene_raw.py @@ -70,7 +70,9 @@ class ExtractMayaSceneRaw(publish.Extractor): force=True, typ="mayaAscii" if self.scene_type == "ma" else "mayaBinary", # noqa: E501 exportSelected=True, - preserveReferences=True, + preserveReferences=instance.data.get( + "creator_attributes", {} + ).get("preserve_references", True), constructionHistory=True, shader=True, constraints=True,