mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #3427 from pypeclub/bugfix/nuke_slate_is_integrated
Nuke: Slate frame is integrated
This commit is contained in:
commit
5738bdd14f
2 changed files with 44 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import nuke
|
|||
import copy
|
||||
|
||||
import pyblish.api
|
||||
import six
|
||||
|
||||
import openpype
|
||||
from openpype.hosts.nuke.api import (
|
||||
|
|
@ -12,7 +13,6 @@ from openpype.hosts.nuke.api import (
|
|||
get_view_process_node
|
||||
)
|
||||
|
||||
|
||||
class ExtractSlateFrame(openpype.api.Extractor):
|
||||
"""Extracts movie and thumbnail with baked in luts
|
||||
|
||||
|
|
@ -236,6 +236,48 @@ class ExtractSlateFrame(openpype.api.Extractor):
|
|||
int(slate_first_frame)
|
||||
)
|
||||
|
||||
# Add file to representation files
|
||||
# - get write node
|
||||
write_node = instance.data["writeNode"]
|
||||
# - evaluate filepaths for first frame and slate frame
|
||||
first_filename = os.path.basename(
|
||||
write_node["file"].evaluate(first_frame))
|
||||
slate_filename = os.path.basename(
|
||||
write_node["file"].evaluate(slate_first_frame))
|
||||
|
||||
# Find matching representation based on first filename
|
||||
matching_repre = None
|
||||
is_sequence = None
|
||||
for repre in instance.data["representations"]:
|
||||
files = repre["files"]
|
||||
if (
|
||||
not isinstance(files, six.string_types)
|
||||
and first_filename in files
|
||||
):
|
||||
matching_repre = repre
|
||||
is_sequence = True
|
||||
break
|
||||
|
||||
elif files == first_filename:
|
||||
matching_repre = repre
|
||||
is_sequence = False
|
||||
break
|
||||
|
||||
if not matching_repre:
|
||||
self.log.info((
|
||||
"Matching reresentaion was not found."
|
||||
" Representation files were not filled with slate."
|
||||
))
|
||||
return
|
||||
|
||||
# Add frame to matching representation files
|
||||
if not is_sequence:
|
||||
matching_repre["files"] = [first_filename, slate_filename]
|
||||
elif slate_filename not in matching_repre["files"]:
|
||||
matching_repre["files"].insert(0, slate_filename)
|
||||
|
||||
self.log.warning("Added slate frame to representation files")
|
||||
|
||||
def add_comment_slate_node(self, instance, node):
|
||||
|
||||
comment = instance.context.data.get("comment")
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
if node is None:
|
||||
return
|
||||
|
||||
instance.data["writeNode"] = node
|
||||
self.log.debug("checking instance: {}".format(instance))
|
||||
|
||||
# Determine defined file type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue