mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
nuke: improving get view process node
This commit is contained in:
parent
66cde9f6c7
commit
efcb280b75
1 changed files with 20 additions and 10 deletions
|
|
@ -893,17 +893,27 @@ def get_imageio_input_colorspace(filename):
|
|||
def get_view_process_node():
|
||||
reset_selection()
|
||||
|
||||
ipn_orig = None
|
||||
for v in nuke.allNodes(filter="Viewer"):
|
||||
ipn = v['input_process_node'].getValue()
|
||||
if ipn:
|
||||
if "VIEWER_INPUT" in ipn:
|
||||
return
|
||||
ipn_orig = nuke.toNode(ipn)
|
||||
ipn_orig.setSelected(True)
|
||||
ipn_node = None
|
||||
for v_ in nuke.allNodes(filter="Viewer"):
|
||||
ipn = v_['input_process_node'].getValue()
|
||||
ipn_node = nuke.toNode(ipn)
|
||||
if ipn_node:
|
||||
if ipn == "VIEWER_INPUT":
|
||||
# since it is set by default we can ignore it
|
||||
# nobody usually use this
|
||||
continue
|
||||
else:
|
||||
# in case a Viewer node is transfered from
|
||||
# different workfile with old values
|
||||
raise NameError((
|
||||
"Input process node name '{}' set in "
|
||||
"Viewer '{}' is does't exists in nodes"
|
||||
).format(ipn, v_.name()))
|
||||
|
||||
if ipn_orig:
|
||||
return duplicate_node(ipn_orig)
|
||||
ipn_node.setSelected(True)
|
||||
|
||||
if ipn_node:
|
||||
return duplicate_node(ipn_node)
|
||||
|
||||
|
||||
def on_script_load():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue