From 239995f715ea3df72af6cc9416152d8b043a3938 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Sat, 7 Jan 2023 09:34:20 +0000 Subject: [PATCH] Account for references and children of patches --- openpype/hosts/maya/plugins/publish/extract_xgen.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_xgen.py b/openpype/hosts/maya/plugins/publish/extract_xgen.py index 5b4c6b29f2..99efcb34ce 100644 --- a/openpype/hosts/maya/plugins/publish/extract_xgen.py +++ b/openpype/hosts/maya/plugins/publish/extract_xgen.py @@ -61,6 +61,12 @@ class ExtractXgenCache(publish.Extractor): fullPath=True )[0] + # Discard the children. + shapes = cmds.listRelatives(duplicate_transform, shapes=True) + children = cmds.listRelatives(duplicate_transform, children=True) + cmds.delete(set(children) - set(shapes)) + + # Connect attributes. cmds.connectAttr( "{}.matrix".format(duplicate_transform), "{}.transform".format(node), @@ -97,7 +103,7 @@ class ExtractXgenCache(publish.Extractor): force=True, type=type, exportSelected=True, - preserveReferences=True, + preserveReferences=False, constructionHistory=True, shader=True, constraints=True,