From 25bf588c5c5186d414398c5fcbdbc592df03c2c1 Mon Sep 17 00:00:00 2001 From: Ben Souchet Date: Wed, 11 Sep 2024 12:03:32 +0200 Subject: [PATCH] Maya Collect Look: Add the Arnold Attrs to the get_look_attrs + Fix crash if no source --- .../maya/plugins/publish/collect_look.py | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/collect_look.py b/openpype/hosts/maya/plugins/publish/collect_look.py index 72682f78003..2df64e96aad 100644 --- a/openpype/hosts/maya/plugins/publish/collect_look.py +++ b/openpype/hosts/maya/plugins/publish/collect_look.py @@ -18,6 +18,13 @@ "doubleSided", "opposite"] SHAPE_ATTRS = set(SHAPE_ATTRS) +ARNOLD_SUBDIV_ATTRS = [ + "aiSubdivType", + "aiSubdivIterations", + "aiSubdivSmoothDerivs", + "aiSubdivPixelError", + "aiDispPadding" +] def get_pxr_multitexture_file_attrs(node): @@ -112,6 +119,15 @@ def get_look_attrs(node): if attr in SHAPE_ATTRS or \ attr not in SHAPE_ATTRS and attr.startswith('ai'): result.append(attr) + + # Include Arnold subdivision attributes if present + for attr in ARNOLD_SUBDIV_ATTRS: + if attr in result: + # Already added, skip + continue + if cmds.attributeQuery(attr, node=node, exists=True): + result.append(attr) + return result @@ -535,7 +551,7 @@ def collect_attributes_changed(self, instance): self.log.warning("Attribute '{}' is mixed-type and is " "not supported yet.".format(attribute)) continue - if cmds.getAttr(attribute, type=True) == "message": + if cmds.getAttr(attribute, type=True) in ["message", "TdataCompound"]: continue node_attributes[attr] = cmds.getAttr(attribute, asString=True) # Only include if there are any properties we care about @@ -571,6 +587,9 @@ def collect_resources(self, node): attribute )) + if not source: + continue + self.log.debug(" - file source: {}".format(source)) color_space_attr = "{}.colorSpace".format(node) try: