mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Expose write node frame range and limit checkbox.
- also some code cosmetics.
This commit is contained in:
parent
34c69cd9cd
commit
0d30a3bc8e
1 changed files with 21 additions and 19 deletions
|
|
@ -313,7 +313,7 @@ def create_write_node(name, data, input=None, prenodes=None, review=True):
|
|||
if input:
|
||||
# if connected input node was defined
|
||||
connections.append({
|
||||
"node": input,
|
||||
"node": input,
|
||||
"inputName": input.name()})
|
||||
prev_node = nuke.createNode(
|
||||
"Input", "name {}".format(input.name()))
|
||||
|
|
@ -369,7 +369,7 @@ def create_write_node(name, data, input=None, prenodes=None, review=True):
|
|||
write_node = now_node = avalon.nuke.lib.add_write_node(
|
||||
"inside_{}".format(name),
|
||||
**_data
|
||||
)
|
||||
)
|
||||
|
||||
# connect to previous node
|
||||
now_node.setInput(0, prev_node)
|
||||
|
|
@ -393,11 +393,13 @@ def create_write_node(name, data, input=None, prenodes=None, review=True):
|
|||
if review:
|
||||
add_review_knob(GN)
|
||||
|
||||
# add render button
|
||||
lnk = nuke.Link_Knob("Render")
|
||||
lnk.makeLink(write_node.name(), "Render")
|
||||
lnk.setName("Render")
|
||||
GN.addKnob(lnk)
|
||||
# Add linked knobs.
|
||||
linked_knob_names = ["Render", "use_limit", "first", "last"]
|
||||
for name in linked_knob_names:
|
||||
link = nuke.Link_Knob(name)
|
||||
link.makeLink(write_node.name(), name)
|
||||
link.setName(name)
|
||||
GN.addKnob(link)
|
||||
|
||||
divider = nuke.Text_Knob('')
|
||||
GN.addKnob(divider)
|
||||
|
|
@ -408,7 +410,6 @@ def create_write_node(name, data, input=None, prenodes=None, review=True):
|
|||
# Deadline tab.
|
||||
add_deadline_tab(GN)
|
||||
|
||||
|
||||
# set tile color
|
||||
tile_color = _data.get("tile_color", "0xff0000ff")
|
||||
GN["tile_color"].setValue(tile_color)
|
||||
|
|
@ -436,6 +437,7 @@ def add_rendering_knobs(node):
|
|||
node.addKnob(knob)
|
||||
return node
|
||||
|
||||
|
||||
def add_review_knob(node):
|
||||
''' Adds additional review knob to given node
|
||||
|
||||
|
|
@ -645,8 +647,9 @@ class WorkfileSettings(object):
|
|||
if root_dict.get("customOCIOConfigPath"):
|
||||
self._root_node["customOCIOConfigPath"].setValue(
|
||||
str(root_dict["customOCIOConfigPath"]).format(
|
||||
**os.environ).replace("\\", "/")
|
||||
)
|
||||
**os.environ
|
||||
).replace("\\", "/")
|
||||
)
|
||||
log.debug("nuke.root()['{}'] changed to: {}".format(
|
||||
"customOCIOConfigPath", root_dict["customOCIOConfigPath"]))
|
||||
root_dict.pop("customOCIOConfigPath")
|
||||
|
|
@ -750,10 +753,9 @@ class WorkfileSettings(object):
|
|||
if changes:
|
||||
msg = "Read nodes are not set to correct colospace:\n\n"
|
||||
for nname, knobs in changes.items():
|
||||
msg += str(" - node: '{0}' is now '{1}' "
|
||||
"but should be '{2}'\n").format(
|
||||
nname, knobs["from"], knobs["to"]
|
||||
)
|
||||
msg += str(
|
||||
" - node: '{0}' is now '{1}' but should be '{2}'\n"
|
||||
).format(nname, knobs["from"], knobs["to"])
|
||||
|
||||
msg += "\nWould you like to change it?"
|
||||
|
||||
|
|
@ -1420,7 +1422,7 @@ class ExporterReview:
|
|||
repre.update({
|
||||
"frameStart": self.first_frame,
|
||||
"frameEnd": self.last_frame,
|
||||
})
|
||||
})
|
||||
|
||||
self.data["representations"].append(repre)
|
||||
|
||||
|
|
@ -1655,7 +1657,7 @@ class ExporterReviewMov(ExporterReview):
|
|||
if not self.viewer_lut_raw:
|
||||
colorspaces = [
|
||||
self.bake_colorspace_main, self.bake_colorspace_fallback
|
||||
]
|
||||
]
|
||||
|
||||
if any(colorspaces):
|
||||
# OCIOColorSpace with controled output
|
||||
|
|
@ -1709,7 +1711,7 @@ class ExporterReviewMov(ExporterReview):
|
|||
self.get_representation_data(
|
||||
tags=["review", "delete"],
|
||||
range=True
|
||||
)
|
||||
)
|
||||
|
||||
self.log.debug("Representation... `{}`".format(self.data))
|
||||
|
||||
|
|
@ -1744,14 +1746,14 @@ def get_dependent_nodes(nodes):
|
|||
if test_in:
|
||||
connections_in.update({
|
||||
node: test_in
|
||||
})
|
||||
})
|
||||
# collect all outputs outside
|
||||
test_out = [i for i in outputs if i.name() not in node_names]
|
||||
if test_out:
|
||||
# only one dependent node is allowed
|
||||
connections_out.update({
|
||||
node: test_out[-1]
|
||||
})
|
||||
})
|
||||
|
||||
return connections_in, connections_out
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue