nuke version to instance additional

This commit is contained in:
Jakub Jezek 2021-01-20 14:21:45 +01:00
parent 5eac2364cc
commit b9d80ba01f
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
3 changed files with 11 additions and 7 deletions

View file

@ -29,10 +29,6 @@ class CollectGizmo(pyblish.api.InstancePlugin):
first_frame = int(nuke.root()["first_frame"].getValue())
last_frame = int(nuke.root()["last_frame"].getValue())
# get version
version = pype.get_version_from_path(nuke.root().name())
instance.data['version'] = int(version)
# Add version data to instance
version_data = {
"handles": handle_start,
@ -41,7 +37,6 @@ class CollectGizmo(pyblish.api.InstancePlugin):
"frameStart": first_frame + handle_start,
"frameEnd": last_frame - handle_end,
"colorspace": nuke.root().knob('workingSpaceLUT').value(),
"version": int(version),
"families": [instance.data["family"]] + instance.data["families"],
"subset": instance.data["subset"],
"fps": instance.context.data["fps"]

View file

@ -10,7 +10,7 @@ class CollectNukeReads(pyblish.api.InstancePlugin):
"""Collect all read nodes."""
order = pyblish.api.CollectorOrder + 0.04
label = "Collect Reads"
label = "Collect Source Reads"
hosts = ["nuke", "nukeassist"]
families = ["source"]
@ -109,7 +109,7 @@ class CollectNukeReads(pyblish.api.InstancePlugin):
"handleEnd": handle_end,
"frameStart": first_frame + handle_start,
"frameEnd": last_frame - handle_end,
"colorspace": colorspace,
"colorspace": colorspace,
"families": [instance.data["family"]],
"subset": instance.data["subset"],
"fps": instance.context.data["fps"]

View file

@ -12,6 +12,9 @@ class PreCollectNukeInstances(pyblish.api.ContextPlugin):
label = "Pre-collect Instances"
hosts = ["nuke", "nukeassist"]
# presets
sync_workfile_version = False
def process(self, context):
asset_data = io.find_one({
"type": "asset",
@ -109,6 +112,12 @@ class PreCollectNukeInstances(pyblish.api.ContextPlugin):
resolution_height = format.height()
pixel_aspect = format.pixelAspect()
if not next((f for f in families
if "prerender" in f),
None) and self.sync_workfile_version:
# get version to instance for integration
instance.data['version'] = instance.context.data['version']
instance.data.update({
"subset": subset,
"asset": avalon_knob_data["asset"],