mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
nuke: split write node features
This commit is contained in:
parent
a161a5113f
commit
1ddc9f2fd6
5 changed files with 23 additions and 16 deletions
|
|
@ -256,6 +256,17 @@ class NukeWriteCreator(NukeCreator):
|
||||||
family = "write"
|
family = "write"
|
||||||
icon = "sign-out"
|
icon = "sign-out"
|
||||||
|
|
||||||
|
def get_linked_knobs(self):
|
||||||
|
linked_knobs = []
|
||||||
|
if "channels" in self.instance_attributes:
|
||||||
|
linked_knobs.append("channels")
|
||||||
|
if "ordered" in self.instance_attributes:
|
||||||
|
linked_knobs.append("render_order")
|
||||||
|
if "use_range_limit" in self.instance_attributes:
|
||||||
|
linked_knobs.extend(["___", "first", "last", "use_limit"])
|
||||||
|
|
||||||
|
return linked_knobs
|
||||||
|
|
||||||
def integrate_links(self, node, outputs=True):
|
def integrate_links(self, node, outputs=True):
|
||||||
# skip if no selection
|
# skip if no selection
|
||||||
if not self.selected_node:
|
if not self.selected_node:
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,6 @@ class CreateWriteImage(napi.NukeWriteCreator):
|
||||||
)
|
)
|
||||||
|
|
||||||
def create_instance_node(self, subset_name, instance_data):
|
def create_instance_node(self, subset_name, instance_data):
|
||||||
linked_knobs_ = []
|
|
||||||
if "use_range_limit" in self.instance_attributes:
|
|
||||||
linked_knobs_ = ["channels", "___", "first", "last", "use_limit"]
|
|
||||||
|
|
||||||
# add fpath_template
|
# add fpath_template
|
||||||
write_data = {
|
write_data = {
|
||||||
|
|
@ -81,7 +78,7 @@ class CreateWriteImage(napi.NukeWriteCreator):
|
||||||
write_data,
|
write_data,
|
||||||
input=self.selected_node,
|
input=self.selected_node,
|
||||||
prenodes=self.prenodes,
|
prenodes=self.prenodes,
|
||||||
linked_knobs=linked_knobs_,
|
linked_knobs=self.get_linked_knobs(),
|
||||||
**{
|
**{
|
||||||
"frame": nuke.frame()
|
"frame": nuke.frame()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,6 @@ class CreateWritePrerender(napi.NukeWriteCreator):
|
||||||
return attr_defs
|
return attr_defs
|
||||||
|
|
||||||
def create_instance_node(self, subset_name, instance_data):
|
def create_instance_node(self, subset_name, instance_data):
|
||||||
linked_knobs_ = []
|
|
||||||
if "use_range_limit" in self.instance_attributes:
|
|
||||||
linked_knobs_ = ["channels", "___", "first", "last", "use_limit"]
|
|
||||||
|
|
||||||
linked_knobs_.append("render_order")
|
|
||||||
|
|
||||||
# add fpath_template
|
# add fpath_template
|
||||||
write_data = {
|
write_data = {
|
||||||
"creator": self.__class__.__name__,
|
"creator": self.__class__.__name__,
|
||||||
|
|
@ -73,7 +67,7 @@ class CreateWritePrerender(napi.NukeWriteCreator):
|
||||||
write_data,
|
write_data,
|
||||||
input=self.selected_node,
|
input=self.selected_node,
|
||||||
prenodes=self.prenodes,
|
prenodes=self.prenodes,
|
||||||
linked_knobs=linked_knobs_,
|
linked_knobs=self.get_linked_knobs(),
|
||||||
**{
|
**{
|
||||||
"width": width,
|
"width": width,
|
||||||
"height": height
|
"height": height
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,6 @@ class CreateWriteRender(napi.NukeWriteCreator):
|
||||||
return attr_defs
|
return attr_defs
|
||||||
|
|
||||||
def create_instance_node(self, subset_name, instance_data):
|
def create_instance_node(self, subset_name, instance_data):
|
||||||
linked_knobs_ = [
|
|
||||||
"channels", "___", "first", "last", "use_limit", "render_order"
|
|
||||||
]
|
|
||||||
|
|
||||||
# add fpath_template
|
# add fpath_template
|
||||||
write_data = {
|
write_data = {
|
||||||
"creator": self.__class__.__name__,
|
"creator": self.__class__.__name__,
|
||||||
|
|
@ -60,12 +56,15 @@ class CreateWriteRender(napi.NukeWriteCreator):
|
||||||
actual_format = nuke.root().knob('format').value()
|
actual_format = nuke.root().knob('format').value()
|
||||||
width, height = (actual_format.width(), actual_format.height())
|
width, height = (actual_format.width(), actual_format.height())
|
||||||
|
|
||||||
|
self.log.debug(">>>>>>> : {}".format(self.instance_attributes))
|
||||||
|
self.log.debug(">>>>>>> : {}".format(self.get_linked_knobs()))
|
||||||
|
|
||||||
created_node = napi.create_write_node(
|
created_node = napi.create_write_node(
|
||||||
subset_name,
|
subset_name,
|
||||||
write_data,
|
write_data,
|
||||||
input=self.selected_node,
|
input=self.selected_node,
|
||||||
prenodes=self.prenodes,
|
prenodes=self.prenodes,
|
||||||
linked_knobs=linked_knobs_,
|
linked_knobs=self.get_linked_knobs(),
|
||||||
**{
|
**{
|
||||||
"width": width,
|
"width": width,
|
||||||
"height": height
|
"height": height
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,12 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"use_range_limit": "Use range limit"
|
"use_range_limit": "Use range limit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ordered": "Defined order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"channels": "Channels override"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue