mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 13:24:54 +01:00
Only query current renderlayer if there is no renderable camera
This commit is contained in:
parent
4a69d68a40
commit
03ee91cf2c
1 changed files with 2 additions and 1 deletions
|
|
@ -36,10 +36,11 @@ class ValidateCurrentRenderLayerIsRenderable(pyblish.api.ContextPlugin,
|
|||
if not context_plugin_should_run(self, context):
|
||||
return
|
||||
|
||||
layer = cmds.editRenderLayerGlobals(query=True, currentRenderLayer=True)
|
||||
cameras = cmds.ls(type="camera", long=True)
|
||||
renderable = any(c for c in cameras if cmds.getAttr(c + ".renderable"))
|
||||
if not renderable:
|
||||
layer = cmds.editRenderLayerGlobals(query=True,
|
||||
currentRenderLayer=True)
|
||||
raise PublishValidationError(
|
||||
"Current render layer '{}' has no renderable camera".format(
|
||||
layer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue