mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merged in hotfix/validate_ftrack_attributes (pull request #353)
Hotfix/validate ftrack attributes Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
commit
2cb1c7efe3
7 changed files with 32 additions and 10 deletions
|
|
@ -379,6 +379,10 @@ def add_rendering_knobs(node):
|
|||
knob = nuke.Boolean_Knob("render_farm", "Render on Farm")
|
||||
knob.setValue(False)
|
||||
node.addKnob(knob)
|
||||
if "review" not in node.knobs():
|
||||
knob = nuke.Boolean_Knob("review", "Review")
|
||||
knob.setValue(True)
|
||||
node.addKnob(knob)
|
||||
return node
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ class ValidateFtrackAttributes(pyblish.api.InstancePlugin):
|
|||
"Missing FTrack Task entity in context")
|
||||
|
||||
host = pyblish.api.current_host()
|
||||
to_check = context.data["presets"][host].get("ftrack_attributes")
|
||||
to_check = context.data["presets"].get(
|
||||
host, {}).get("ftrack_attributes")
|
||||
if not to_check:
|
||||
self.log.warning("ftrack_attributes preset not found")
|
||||
return
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ class LoadSequence(api.Loader):
|
|||
last += self.handle_end
|
||||
|
||||
file = self.fname.replace("\\", "/")
|
||||
|
||||
log.info("file: {}\n".format(self.fname))
|
||||
|
||||
repr_cont = context["representation"]["context"]
|
||||
|
|
@ -118,6 +119,11 @@ class LoadSequence(api.Loader):
|
|||
repr_cont["subset"],
|
||||
repr_cont["representation"])
|
||||
|
||||
if "#" not in file:
|
||||
frame = repr_cont.get("frame")
|
||||
padding = len(frame)
|
||||
file = file.replace(frame, "#"*padding)
|
||||
|
||||
# Create the Loader with the filename path set
|
||||
with viewer_update_and_undo_stop():
|
||||
# TODO: it might be universal read to img/geo/camera
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import pyblish.api
|
||||
|
||||
import nuke
|
||||
|
||||
class CollectReview(pyblish.api.InstancePlugin):
|
||||
"""Collect review instance from rendered frames
|
||||
|
|
@ -9,9 +9,20 @@ class CollectReview(pyblish.api.InstancePlugin):
|
|||
family = "review"
|
||||
label = "Collect Review"
|
||||
hosts = ["nuke"]
|
||||
families = ["render", "render.local"]
|
||||
families = ["render", "render.local", "render.farm"]
|
||||
|
||||
def process(self, instance):
|
||||
if instance.data["families"]:
|
||||
instance.data["families"].append("review")
|
||||
self.log.info("Review collected: `{}`".format(instance))
|
||||
|
||||
node = instance[0]
|
||||
|
||||
if "review" not in node.knobs():
|
||||
knob = nuke.Boolean_Knob("review", "Review")
|
||||
knob.setValue(True)
|
||||
node.addKnob(knob)
|
||||
|
||||
if not node["review"].value():
|
||||
return
|
||||
|
||||
instance.data["families"].append("review")
|
||||
instance.data['families'].append('ftrack')
|
||||
self.log.info("Review collected: `{}`".format(instance))
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
)
|
||||
|
||||
if 'render' in instance.data['families']:
|
||||
instance.data['families'].append('ftrack')
|
||||
if "representations" not in instance.data:
|
||||
instance.data["representations"] = list()
|
||||
|
||||
|
|
@ -78,15 +77,15 @@ class CollectNukeWrites(pyblish.api.InstancePlugin):
|
|||
|
||||
try:
|
||||
collected_frames = os.listdir(output_dir)
|
||||
if collected_frames:
|
||||
representation['frameStart'] = "%0{}d".format(
|
||||
len(str(last_frame))) % first_frame
|
||||
representation['files'] = collected_frames
|
||||
instance.data["representations"].append(representation)
|
||||
except Exception:
|
||||
instance.data["representations"].append(representation)
|
||||
self.log.debug("couldn't collect frames: {}".format(label))
|
||||
|
||||
if 'render.local' in instance.data['families']:
|
||||
instance.data['families'].append('ftrack')
|
||||
|
||||
# Add version data to instance
|
||||
version_data = {
|
||||
"handles": handle_start,
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class NukeRenderLocal(pype.api.Extractor):
|
|||
repre = {
|
||||
'name': ext,
|
||||
'ext': ext,
|
||||
'frameStart': "%0{}d".format(len(str(last_frame))) % first_frame,
|
||||
'files': collected_frames,
|
||||
"stagingDir": out_dir,
|
||||
"anatomy_template": "render"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue