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

Nuke Extracts Thumbnail from frame out of shot range #963

Closed
jrsndl opened this issue Feb 2, 2021 · 0 comments
Closed

Nuke Extracts Thumbnail from frame out of shot range #963

jrsndl opened this issue Feb 2, 2021 · 0 comments
Labels
type: bug Something isn't working

Comments

@jrsndl
Copy link
Collaborator

jrsndl commented Feb 2, 2021

Describe the bug
Nuke extracts thumbnail from middle frame. Currently it is calculated as last_frame / 2. This works nicely if shot range starts from 1. However, vfx often starts from 1001, and Nuke is extracted from frame 500. Depending on Nuke script, this might be OK (can still hold first frame) or produce pure garbage.

To Reproduce

  1. Set shot range 1001-1010
  2. Set plate read node before and after knobs to black (default is hold)
  3. Locally render and publish version
  4. The thumbnail is black (frame 500)

Expected behavior
Extract Thumbnail should make thumbnail in shot range, from middle frame.

Desktop (please complete the following information):

  • OS: Windows 10
  • Host: Nuke 10.3

Possible Fix
Calculating first_frame and last_frame with start frame offset:
https://github.com/pypeclub/pype/blob/5f48a59ce209d3c7629ecbb4c39860d2df3ff565/pype/plugins/nuke/publish/extract_thumbnail.py#L121

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",
    "outputName": "thumb",
    'files': file,
    "stagingDir": staging_dir,
    "frameStart": first_frame,
    "frameEnd": last_frame,
    "tags": tags
}
instance.data["representations"].append(repre)

# Render frames
nuke.execute(write_node.name(), int(mid_frame), int(mid_frame))
@jrsndl jrsndl added the type: bug Something isn't working label Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants