nuke: validator exception legacy

This commit is contained in:
Jakub Jezek 2022-12-29 15:05:34 +01:00
parent b4d29d0160
commit e1f040c9ea
No known key found for this signature in database
GPG key ID: 730D7C02726179A7
2 changed files with 39 additions and 8 deletions

View file

@ -3,16 +3,30 @@
<error id="main">
<title>Knobs values</title>
<description>
## Invalid node's knobs values
## Invalid node's knobs values
Following write node knobs needs to be repaired:
Following write node knobs needs to be repaired:
{xml_msg}
{xml_msg}
### How to repair?
### How to repair?
1. Use Repair button.
2. Hit Reload button on the publisher.
1. Use Repair button.
2. Hit Reload button on the publisher.
</description>
</error>
<error id="legacy">
<title>Legacy knob types</title>
<description>
## Knobs are in obsolete configuration
Settings needs to be fixed.
### How to repair?
Contact your supervisor or fix it in project settings at
'project_settings/nuke/imageio/nodes/requiredNodes' at knobs.
Each '__legacy__' type has to be defined accordingly to its type.
</description>
</error>
</root>

View file

@ -77,14 +77,31 @@ class ValidateNukeWriteNode(
if write_node is None:
return
correct_data = get_write_node_template_attr(write_group_node)
check_knobs = get_write_node_template_attr(write_group_node)
check = []
self.log.debug("__ write_node: {}".format(
write_node
))
self.log.debug("__ check_knobs: {}".format(
check_knobs
))
for key, value in correct_data.items():
for knob_data in check_knobs:
if (
"type" not in knob_data
or knob_data["type"] == "__legacy__"
):
PublishXmlValidationError(
self, (
"Please update data in settings 'project_settings"
"/nuke/imageio/nodes/requiredNodes'"
),
key="legacy"
)
key = knob_data["name"]
value = knob_data["value"]
node_value = write_node[key].value()
# fix type differences