feat(nuke): fixing handles for publishing writes

This commit is contained in:
Jakub Jezek 2019-05-15 10:43:12 +02:00
parent 65be5efb5c
commit 346c824f72
3 changed files with 8 additions and 2 deletions

View file

@ -17,6 +17,10 @@ class CollectNukeInstances(pyblish.api.ContextPlugin):
def process(self, context):
asset_data = io.find_one({"type": "asset",
"name": api.Session["AVALON_ASSET"]})
# add handles into context
context.data['handles'] = int(asset_data["data"].get("handles", 0))
self.log.debug("asset_data: {}".format(asset_data["data"]))
instances = []
# creating instances per write node
@ -51,7 +55,6 @@ class CollectNukeInstances(pyblish.api.ContextPlugin):
"family": avalon_knob_data["family"],
"avalonKnob": avalon_knob_data,
"publish": node.knob('publish').value(),
"handles": int(asset_data["data"].get("handles", 0)),
"step": 1,
"fps": int(nuke.root()['fps'].value())

View file

@ -35,10 +35,12 @@ class CollectNukeWrites(pyblish.api.ContextPlugin):
output_type = "mov"
# Get frame range
handles = instance.context.data.get('handles', 0)
first_frame = int(nuke.root()["first_frame"].getValue())
last_frame = int(nuke.root()["last_frame"].getValue())
if node["use_limit"].getValue():
handles = 0
first_frame = int(node["first"].getValue())
last_frame = int(node["last"].getValue())
@ -76,6 +78,7 @@ class CollectNukeWrites(pyblish.api.ContextPlugin):
"outputDir": output_dir,
"ext": ext,
"label": label,
"handles": handles,
"startFrame": first_frame,
"endFrame": last_frame,
"outputType": output_type,

View file

@ -28,7 +28,7 @@ class ValidateScript(pyblish.api.InstancePlugin):
]
# Value of these attributes can be found on parents
hierarchical_attributes = ["fps", "resolution_width", "resolution_height", "pixel_aspect"]
hierarchical_attributes = ["fps", "resolution_width", "resolution_height", "pixel_aspect", "handles"]
missing_attributes = []
asset_attributes = {}