Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Nuke thumbnails generated from middle of the sequence #1992

Merged
merged 11 commits into from
Sep 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions openpype/hosts/nuke/plugins/publish/extract_thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,26 @@ def render_thumbnail(self, instance):

# create write node
write_node = nuke.createNode("Write")
file = fhead + "jpeg"
file = fhead + "jpg"
name = "thumbnail"
path = os.path.join(staging_dir, file).replace("\\", "/")
instance.data["thumbnail"] = path
write_node["file"].setValue(path)
write_node["file_type"].setValue("jpeg")
write_node["file_type"].setValue("jpg")
write_node["raw"].setValue(1)
write_node.setInput(0, previous_node)
temporary_nodes.append(write_node)
tags = ["thumbnail", "publish_on_farm"]

# retime for
mid_frame = int((int(last_frame) - int(first_frame)) / 2) \
+ int(first_frame)
first_frame = int(last_frame) / 2
last_frame = int(last_frame) / 2

repre = {
'name': name,
'ext': "jpeg",
'ext': "jpg",
"outputName": "thumb",
'files': file,
"stagingDir": staging_dir,
Expand All @@ -140,7 +142,7 @@ def render_thumbnail(self, instance):
instance.data["representations"].append(repre)

# Render frames
nuke.execute(write_node.name(), int(first_frame), int(last_frame))
nuke.execute(write_node.name(), int(mid_frame), int(mid_frame))

self.log.debug(
"representations: {}".format(instance.data["representations"]))
Expand Down