Only query current renderlayer if there is no renderable camera

This commit is contained in:
Roy Nieterau 2024-03-28 14:01:51 +01:00
parent 4a69d68a40
commit 03ee91cf2c

View file

@ -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