mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
Merge branch 'master' of https://github.com/Colorbleed/colorbleed-config
This commit is contained in:
commit
78cdfbafd2
1 changed files with 13 additions and 1 deletions
|
|
@ -32,7 +32,13 @@ class CollectMayaRenderlayers(pyblish.api.ContextPlugin):
|
|||
context.data["startFrame"] = start_frame
|
||||
context.data["endFrame"] = end_frame
|
||||
|
||||
# Get render layers
|
||||
# Get all valid renderlayers
|
||||
# This is how Maya populates the renderlayer display
|
||||
rlm_attribute = "renderLayerManager.renderLayerId"
|
||||
connected_layers = cmds.listConnections(rlm_attribute) or []
|
||||
valid_layers = set(connected_layers)
|
||||
|
||||
# Get all renderlayers and check their state
|
||||
renderlayers = [i for i in cmds.ls(type="renderLayer") if
|
||||
cmds.getAttr("{}.renderable".format(i)) and not
|
||||
cmds.referenceQuery(i, isNodeReferenced=True)]
|
||||
|
|
@ -51,6 +57,12 @@ class CollectMayaRenderlayers(pyblish.api.ContextPlugin):
|
|||
renderlayers = sorted(renderlayers, key=sort_by_display_order)
|
||||
|
||||
for layer in renderlayers:
|
||||
|
||||
# Check if layer is in valid (linked) layers
|
||||
if layer not in valid_layers:
|
||||
self.log.warning("%s is invalid, skipping" % layer)
|
||||
continue
|
||||
|
||||
if layer.endswith("defaultRenderLayer"):
|
||||
layername = "masterLayer"
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue