mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
nuke: settings and mixin for some validators
This commit is contained in:
parent
89b87af509
commit
b2a011d517
5 changed files with 34 additions and 9 deletions
|
|
@ -9,9 +9,9 @@ import openpype.hosts.nuke.api.lib as nlib
|
|||
from openpype.pipeline.publish import (
|
||||
ValidateContentsOrder,
|
||||
PublishXmlValidationError,
|
||||
OptionalPyblishPluginMixin
|
||||
)
|
||||
|
||||
|
||||
class SelectInvalidInstances(pyblish.api.Action):
|
||||
"""Select invalid instances in Outliner."""
|
||||
|
||||
|
|
@ -92,7 +92,10 @@ class RepairSelectInvalidInstances(pyblish.api.Action):
|
|||
nlib.set_node_data(node, nlib.INSTANCE_DATA_KNOB, node_data)
|
||||
|
||||
|
||||
class ValidateCorrectAssetName(pyblish.api.InstancePlugin):
|
||||
class ValidateCorrectAssetName(
|
||||
pyblish.api.InstancePlugin,
|
||||
OptionalPyblishPluginMixin
|
||||
):
|
||||
"""Validator to check if instance asset match context asset.
|
||||
|
||||
When working in per-shot style you always publish data in context of
|
||||
|
|
@ -111,6 +114,9 @@ class ValidateCorrectAssetName(pyblish.api.InstancePlugin):
|
|||
optional = True
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
||||
asset = instance.data.get("asset")
|
||||
context_asset = instance.context.data["assetEntity"]["name"]
|
||||
node = instance.data["transientData"]["node"]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
import nuke
|
||||
import pyblish
|
||||
from openpype.hosts.nuke import api as napi
|
||||
from openpype.pipeline import PublishXmlValidationError
|
||||
|
||||
from openpype.pipeline.publish import (
|
||||
ValidateContentsOrder,
|
||||
PublishXmlValidationError,
|
||||
OptionalPyblishPluginMixin
|
||||
)
|
||||
|
||||
class SelectCenterInNodeGraph(pyblish.api.Action):
|
||||
"""
|
||||
|
|
@ -46,12 +50,15 @@ class SelectCenterInNodeGraph(pyblish.api.Action):
|
|||
nuke.zoom(2, [min(all_xC), min(all_yC)])
|
||||
|
||||
|
||||
class ValidateBackdrop(pyblish.api.InstancePlugin):
|
||||
class ValidateBackdrop(
|
||||
pyblish.api.InstancePlugin,
|
||||
OptionalPyblishPluginMixin
|
||||
):
|
||||
""" Validate amount of nodes on backdrop node in case user
|
||||
forgotten to add nodes above the publishing backdrop node.
|
||||
"""
|
||||
|
||||
order = pyblish.api.ValidatorOrder
|
||||
order = ValidateContentsOrder
|
||||
optional = True
|
||||
families = ["nukenodes"]
|
||||
label = "Validate Backdrop"
|
||||
|
|
@ -59,6 +66,9 @@ class ValidateBackdrop(pyblish.api.InstancePlugin):
|
|||
actions = [SelectCenterInNodeGraph]
|
||||
|
||||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
|
||||
child_nodes = instance.data["transientData"]["childNodes"]
|
||||
connections_out = instance.data["transientData"]["nodeConnectionsOut"]
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class ValidateScriptAttributes(
|
|||
|
||||
order = pyblish.api.ValidatorOrder + 0.1
|
||||
families = ["workfile"]
|
||||
label = "Validatte script attributes"
|
||||
label = "Validate script attributes"
|
||||
hosts = ["nuke"]
|
||||
optional = True
|
||||
actions = [RepairAction]
|
||||
|
|
|
|||
|
|
@ -363,6 +363,11 @@
|
|||
"optional": true,
|
||||
"active": true
|
||||
},
|
||||
"ValidateBackdrop": {
|
||||
"enabled": true,
|
||||
"optional": true,
|
||||
"active": true
|
||||
},
|
||||
"ValidateScript": {
|
||||
"enabled": true,
|
||||
"optional": true,
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
"template_data": [
|
||||
{
|
||||
"key": "ValidateCorrectAssetName",
|
||||
"label": "Validate Correct Asset name"
|
||||
"label": "Validate Correct Asset Name"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
"template_data": [
|
||||
{
|
||||
"key": "ValidateContainers",
|
||||
"label": "ValidateContainers"
|
||||
"label": "Validate Containers"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
"collapsible": true,
|
||||
"checkbox_key": "enabled",
|
||||
"key": "ValidateKnobs",
|
||||
"label": "ValidateKnobs",
|
||||
"label": "Validate Knobs",
|
||||
"is_group": true,
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -104,6 +104,10 @@
|
|||
"key": "ValidateOutputResolution",
|
||||
"label": "Validate Output Resolution"
|
||||
},
|
||||
{
|
||||
"key": "ValidateBackdrop",
|
||||
"label": "Validate Backdrop"
|
||||
},
|
||||
{
|
||||
"key": "ValidateGizmo",
|
||||
"label": "Validate Gizmo (Group)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue