Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

[QUAD] Maya Collect Look: Add the Arnold Attrs to the get_look_attrs + Fix crash if no source #6299

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion openpype/hosts/maya/plugins/publish/collect_look.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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"]:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (86 > 79 characters)

continue
node_attributes[attr] = cmds.getAttr(attribute, asString=True)
# Only include if there are any properties we care about
Expand Down Expand Up @@ -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:
Expand Down
Loading