Merge pull request #555 from ynput/enhancement/AY-5543_nuke-deep-exr-loading

Nuke: Support options for reading deep exr in load clips
This commit is contained in:
Jakub Ježek 2024-05-27 22:41:28 +02:00 committed by GitHub
commit 646787afc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 26 deletions

View file

@ -63,7 +63,8 @@ class LoadClip(plugin.NukeLoader):
# option gui
options_defaults = {
"start_at_workfile": True,
"add_retime": True
"add_retime": True,
"deep_exr": False
}
node_name_template = "{class_name}_{ext}"
@ -80,6 +81,11 @@ class LoadClip(plugin.NukeLoader):
"add_retime",
help="Load with retime",
default=cls.options_defaults["add_retime"]
),
qargparse.Boolean(
"deep_exr",
help="Read with deep exr",
default=cls.options_defaults["deep_exr"]
)
]
@ -115,6 +121,9 @@ class LoadClip(plugin.NukeLoader):
add_retime = options.get(
"add_retime", self.options_defaults["add_retime"])
deep_exr = options.get(
"deep_exr", self.options_defaults["deep_exr"])
repre_id = repre_entity["id"]
self.log.debug(
@ -155,13 +164,21 @@ class LoadClip(plugin.NukeLoader):
return
read_name = self._get_node_name(context)
# Create the Loader with the filename path set
read_node = nuke.createNode(
"Read",
"name {}".format(read_name),
inpanel=False
)
read_node = None
if deep_exr:
# Create the Loader with the filename path set
read_node = nuke.createNode(
"DeepRead",
"name {}".format(read_name),
inpanel=False
)
else:
# Create the Loader with the filename path set
read_node = nuke.createNode(
"Read",
"name {}".format(read_name),
inpanel=False
)
# get colorspace
colorspace = (
@ -173,14 +190,14 @@ class LoadClip(plugin.NukeLoader):
# we will switch off undo-ing
with viewer_update_and_undo_stop():
read_node["file"].setValue(filepath)
self.set_colorspace_to_node(
read_node,
filepath,
project_name,
version_entity,
repre_entity
)
if read_node.Class() == "Read":
self.set_colorspace_to_node(
read_node,
filepath,
project_name,
version_entity,
repre_entity
)
self._set_range_to_node(
read_node, first, last, start_at_workfile, slate_frames
@ -330,13 +347,14 @@ class LoadClip(plugin.NukeLoader):
# to avoid multiple undo steps for rest of process
# we will switch off undo-ing
with viewer_update_and_undo_stop():
self.set_colorspace_to_node(
read_node,
filepath,
project_name,
version_entity,
repre_entity
)
if read_node.Class() == "Read":
self.set_colorspace_to_node(
read_node,
filepath,
project_name,
version_entity,
repre_entity
)
self._set_range_to_node(read_node, first, last, start_at_workfile)

View file

@ -1,6 +1,6 @@
name = "nuke"
title = "Nuke"
version = "0.2.0"
version = "0.2.1"
client_dir = "ayon_nuke"

View file

@ -22,7 +22,9 @@ class LoadClipOptionsModel(BaseSettingsModel):
add_retime: bool = SettingsField(
title="Add retime"
)
deep_exr: bool = SettingsField(
title="Deep Exr Read Node"
)
class LoadClipModel(BaseSettingsModel):
enabled: bool = SettingsField(
@ -65,7 +67,8 @@ DEFAULT_LOADER_PLUGINS_SETTINGS = {
"node_name_template": "{class_name}_{ext}",
"options_defaults": {
"start_at_workfile": True,
"add_retime": True
"add_retime": True,
"deep_exr": False
}
}
}