mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
nuke: implementation of https://github.com/pypeclub/OpenPype/pull/1494
This commit is contained in:
parent
de310de3cf
commit
842ea719f1
1 changed files with 3 additions and 14 deletions
|
|
@ -373,21 +373,16 @@ def create_write_node(name, data, input=None, prenodes=None, review=True):
|
||||||
|
|
||||||
prev_node = None
|
prev_node = None
|
||||||
with GN:
|
with GN:
|
||||||
connections = list()
|
|
||||||
if input:
|
if input:
|
||||||
|
input_name = str(input.name()).replace(" ", "")
|
||||||
# if connected input node was defined
|
# if connected input node was defined
|
||||||
connections.append({
|
|
||||||
"node": input,
|
|
||||||
"inputName": input.name()})
|
|
||||||
prev_node = nuke.createNode(
|
prev_node = nuke.createNode(
|
||||||
"Input", "name {}".format(input.name()))
|
"Input", "name {}".format(input_name))
|
||||||
prev_node.hideControlPanel()
|
|
||||||
else:
|
else:
|
||||||
# generic input node connected to nothing
|
# generic input node connected to nothing
|
||||||
prev_node = nuke.createNode(
|
prev_node = nuke.createNode(
|
||||||
"Input", "name {}".format("rgba"))
|
"Input", "name {}".format("rgba"))
|
||||||
prev_node.hideControlPanel()
|
prev_node.hideControlPanel()
|
||||||
|
|
||||||
# creating pre-write nodes `prenodes`
|
# creating pre-write nodes `prenodes`
|
||||||
if prenodes:
|
if prenodes:
|
||||||
for name, klass, properties, set_output_to in prenodes:
|
for name, klass, properties, set_output_to in prenodes:
|
||||||
|
|
@ -416,18 +411,12 @@ def create_write_node(name, data, input=None, prenodes=None, review=True):
|
||||||
input_node = nuke.createNode(
|
input_node = nuke.createNode(
|
||||||
"Input", "name {}".format(node_name))
|
"Input", "name {}".format(node_name))
|
||||||
input_node.hideControlPanel()
|
input_node.hideControlPanel()
|
||||||
connections.append({
|
|
||||||
"node": nuke.toNode(node_name),
|
|
||||||
"inputName": node_name})
|
|
||||||
now_node.setInput(1, input_node)
|
now_node.setInput(1, input_node)
|
||||||
|
|
||||||
elif isinstance(set_output_to, str):
|
elif isinstance(set_output_to, str):
|
||||||
input_node = nuke.createNode(
|
input_node = nuke.createNode(
|
||||||
"Input", "name {}".format(node_name))
|
"Input", "name {}".format(node_name))
|
||||||
input_node.hideControlPanel()
|
input_node.hideControlPanel()
|
||||||
connections.append({
|
|
||||||
"node": nuke.toNode(set_output_to),
|
|
||||||
"inputName": set_output_to})
|
|
||||||
now_node.setInput(0, input_node)
|
now_node.setInput(0, input_node)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue