Merge pull request #2052 from pypeclub/feature/PYPE-1837_Request---Proxy-Validator-for-Nuke

Nuke: proxy mode validator
This commit is contained in:
Jakub Ježek 2021-09-21 14:09:05 +02:00 committed by GitHub
commit eb18c1291c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,33 @@
import pyblish
import nuke
class FixProxyMode(pyblish.api.Action):
"""
Togger off proxy switch OFF
"""
label = "Proxy toggle to OFF"
icon = "wrench"
on = "failed"
def process(self, context, plugin):
rootNode = nuke.root()
rootNode["proxy"].setValue(False)
@pyblish.api.log
class ValidateProxyMode(pyblish.api.ContextPlugin):
"""Validate active proxy mode"""
order = pyblish.api.ValidatorOrder
label = "Validate Proxy Mode"
hosts = ["nuke"]
actions = [FixProxyMode]
def process(self, context):
rootNode = nuke.root()
isProxy = rootNode["proxy"].value()
assert not isProxy, "Proxy mode should be toggled OFF"