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

Commit

Permalink
Merge pull request #1992 from jrsndl/bugfix/nuke_thumbnail_middle
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolar authored Sep 9, 2021
2 parents 87bfd67 + e3b319f commit 476c211
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit 476c211

Please sign in to comment.