mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Validate exposed knobs.
This commit is contained in:
parent
f5406cedac
commit
9e44545c25
1 changed files with 37 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
from collections import defaultdict
|
||||
|
||||
import nuke
|
||||
|
||||
import pyblish.api
|
||||
from openpype.pipeline.publish import get_errored_instances_from_context
|
||||
from openpype.hosts.nuke.api.lib import (
|
||||
|
|
@ -11,6 +13,7 @@ from openpype.hosts.nuke.api.lib import (
|
|||
from openpype.pipeline.publish import (
|
||||
PublishXmlValidationError,
|
||||
OptionalPyblishPluginMixin,
|
||||
PublishValidationError
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -39,6 +42,19 @@ class RepairNukeWriteNodeAction(pyblish.api.Action):
|
|||
|
||||
set_node_knobs_from_settings(write_node, correct_data["knobs"])
|
||||
|
||||
nuke_settings = instance.context.data["project_settings"]["nuke"]
|
||||
create_settings = nuke_settings["create"]["CreateWriteRender"]
|
||||
exposed_knobs = create_settings["exposed_knobs"]
|
||||
for knob in exposed_knobs:
|
||||
if knob in write_group_node.knobs():
|
||||
continue
|
||||
|
||||
link = nuke.Link_Knob("")
|
||||
link.makeLink(write_node.name(), knob)
|
||||
link.setName(knob)
|
||||
link.setFlag(0x1000)
|
||||
write_group_node.addKnob(link)
|
||||
|
||||
self.log.debug("Node attributes were fixed")
|
||||
|
||||
|
||||
|
|
@ -134,6 +150,27 @@ class ValidateNukeWriteNode(
|
|||
if check:
|
||||
self._make_error(check)
|
||||
|
||||
nuke_settings = instance.context.data["project_settings"]["nuke"]
|
||||
create_settings = nuke_settings["create"]["CreateWriteRender"]
|
||||
exposed_knobs = create_settings["exposed_knobs"]
|
||||
unexposed_knobs = []
|
||||
for knob in exposed_knobs:
|
||||
if knob not in write_group_node.knobs():
|
||||
unexposed_knobs.append(knob)
|
||||
|
||||
"""
|
||||
link = nuke.Link_Knob("")
|
||||
link.makeLink(write_node.name(), knob)
|
||||
link.setName(knob)
|
||||
link.setFlag(0x1000)
|
||||
write_group_node.addKnob(link)
|
||||
"""
|
||||
|
||||
if unexposed_knobs:
|
||||
raise PublishValidationError(
|
||||
"Missing exposed knobs: {}".format(unexposed_knobs)
|
||||
)
|
||||
|
||||
def _make_error(self, check):
|
||||
# sourcery skip: merge-assign-and-aug-assign, move-assign-in-block
|
||||
dbg_msg = "Write node's knobs values are not correct!\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue