Refactor knob writing logic in Nuke API lib function.

Simplify knob writing process by refactoring code to use a helper function for setting knobs based on settings.
This commit is contained in:
Jakub Jezek 2024-02-21 14:10:43 +01:00
parent 0e0d2599a0
commit 42e3e9de97
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -2346,25 +2346,8 @@ Reopening Nuke should synchronize these paths and resolve any discrepancies.
if not write_node:
return
try:
# write all knobs to node
for knob in nuke_imageio_writes["knobs"]:
value = knob["value"]
if isinstance(value, six.text_type):
value = str(value)
if str(value).startswith("0x"):
value = int(value, 16)
log.debug("knob: {}| value: {}".format(
knob["name"], value
))
write_node[knob["name"]].setValue(value)
except TypeError:
log.warning(
"Legacy workflow didn't work, switching to current")
set_node_knobs_from_settings(
write_node, nuke_imageio_writes["knobs"])
set_node_knobs_from_settings(
write_node, nuke_imageio_writes["knobs"])
def set_reads_colorspace(self, read_clrs_inputs):
""" Setting colorspace to Read nodes