def process(self, context, plugin): import clique import nuke # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: collection = clique.assemble([nuke.filename(instance[0])], minimum_items=1, patterns=[clique.PATTERNS['frames'] ])[0][0] instance[0]["file"].setValue( collection.format("{head}{padding}{tail}")) instance[0]["first"].setValue(list(collection.indexes)[0]) instance[0]["last"].setValue(list(collection.indexes)[0]) instance[0]["origfirst"].setValue(list(collection.indexes)[0]) instance[0]["origlast"].setValue(list(collection.indexes)[0])
def process(self, context, plugin): import clique import nuke # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: collection = clique.assemble( [nuke.filename(instance[0])], minimum_items=1, patterns=[clique.PATTERNS['frames']] )[0][0] instance[0]["file"].setValue( collection.format("{head}{padding}{tail}") ) instance[0]["first"].setValue(list(collection.indexes)[0]) instance[0]["last"].setValue(list(collection.indexes)[0]) instance[0]["origfirst"].setValue(list(collection.indexes)[0]) instance[0]["origlast"].setValue(list(collection.indexes)[0])
def process(self, context, plugin): import pyblish_aftereffects # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: cmd = "app.project.renderQueue.item({0}).outputModule(1)" cmd += ".setSettings({1})" data = '{{"Output File Info":{{"Full Flat Path":"{0}"}}}}' class_object = ValidateOutputPath() path = class_object.get_expected_path(instance) pyblish_aftereffects.send( cmd.format(instance.data["index"], data.format(path)))
def process(self, context): instances = api.instances_by_plugin(context, ValidateAEUniqueCompRenders) names = [] for instance in instances: names.append(instance.data["name"]) msg = "More than one item in the render queue," msg += " are from the same composition" assert len(names) == len(set(names)), msg
def process(self, context): instances = api.instances_by_plugin( context, ValidateAEUniqueCompRenders ) names = [] for instance in instances: names.append(instance.data["name"]) msg = "More than one item in the render queue," msg += " are from the same composition" assert len(names) == len(set(names)), msg
def process(self, context, plugin): import pymel.core # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in. instances = api.instances_by_plugin(failed, plugin) plugin = plugin() for instance in instances: node = instance[0] if not hasattr(node, "deadlineChunkSize"): pymel.core.addAttr(node, longName="deadlineChunkSize", defaultValue=1, attributeType="long") attr = pymel.core.Attribute(node.name() + ".deadlineChunkSize") pymel.core.setAttr(attr, channelBox=True) if not hasattr(node, "deadlinePriority"): pymel.core.addAttr(node, longName="deadlinePriority", defaultValue=50, attributeType="long") attr = pymel.core.Attribute(node.name() + ".deadlinePriority") pymel.core.setAttr(attr, channelBox=True) if not hasattr(node, "deadlinePool"): pymel.core.addAttr(node, longName="deadlinePool", dataType="string") attr = pymel.core.Attribute(node.name() + ".deadlinePool") pymel.core.setAttr(attr, channelBox=True) if not hasattr(node, "deadlineConcurrentTasks"): pymel.core.addAttr(node, longName="deadlineConcurrentTasks", defaultValue=1, attributeType="long") attr = pymel.core.Attribute( node.name() + ".deadlineConcurrentTasks" ) pymel.core.setAttr(attr, channelBox=True)
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: for node in instance[0].members(): node.displaySmoothMesh.set(False)
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: for node in instance[0].members(): node.displaySmoothMesh.set(False)
def process(self, context, plugin): import pymel.core as pm # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: for node in instance[0].members(): pm.delete(pm.cluster(node))
def process(self, context, plugin): import pymel.core as pm # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: for node in instance[0].members(): pm.delete(pm.cluster(node))
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: # Setting parameters. instance[0].setParms({"partition_mode": 4, "collapse": 1})
def process(self, context, plugin): import hou # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in. instances = api.instances_by_plugin(failed, plugin) plugin = plugin() for instance in instances: node = instance[0] templates = [] templates.append(hou.IntParmTemplate( "deadlineChunkSize", "Chunk Size", 1, default_value=(1,) )) templates.append(hou.IntParmTemplate( "deadlinePriority", "Priority", 1, default_value=(50,) )) templates.append(hou.StringParmTemplate( "deadlinePool", "Pool", 1, default_value=("",) )) templates.append(hou.IntParmTemplate( "deadlineConcurrentTasks", "Concurrent Tasks", 1, default_value=(1,) )) parm_group = node.parmTemplateGroup() parm_folder = hou.FolderParmTemplate("folder", "Deadline") for template in templates: try: parm_folder.addParmTemplate(template) except: self.log.debug("Could not add \"{0}\"".format(template)) parm_group.append(parm_folder) node.setParmTemplateGroup(parm_group)
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: # Setting parameters. instance[0].setParms({"partition_mode": 4, "collapse": 1})
def process(self, context, plugin): import os import webbrowser # Get the errored instances all_instances = [] for result in context.data["results"]: all_instances.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(context, plugin) for instance in instances: if not os.path.exists(instance.data["output_path"]): continue webbrowser.open(instance.data["output_path"])
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in. instances = api.instances_by_plugin(failed, plugin) plugin = plugin() for instance in instances: node = instance[0] for parm in node.parms(): if parm.name() in plugin.get_supported_parameters(): expected = plugin.get_expected_path(instance, parm.name()) parm.set(expected)
def process(self, context, plugin): import os # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: cls_instance = ValidateWriteGeoNode() value = cls_instance.get_expected_value(instance) instance[0]["file"].setValue(value) ext = os.path.splitext(value)[1] instance[0]["file_type"].setValue(ext[1:])
def process(self, context, plugin): import os # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: cls_instance = ValidateWriteGeoNode() value = cls_instance.get_expected_value(instance) instance[0]["file"].setValue(value) ext = os.path.splitext(value)[1] instance[0]["file_type"].setValue(ext[1:])
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: # background vs. foreground rendering soho_foreground = 1 if "remote" in instance.data["families"]: soho_foreground = 0 # setting parms instance[0].setParms({"soho_foreground": soho_foreground})
def process(self, context, plugin): import nuke # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in. instances = api.instances_by_plugin(failed, plugin) plugin = plugin() for instance in instances: node = instance[0] node.addKnob(nuke.Tab_Knob("Deadline")) knob = nuke.Int_Knob("deadlineChunkSize", "Chunk Size") knob.setValue(1) node.addKnob(knob) knob = nuke.Int_Knob("deadlinePriority", "Priority") knob.setValue(50) node.addKnob(knob) knob = nuke.String_Knob("deadlinePool", "Pool") node.addKnob(knob) knob = nuke.String_Knob("deadlineLimits", "Limits") node.addKnob(knob) knob = nuke.Int_Knob( "deadlineConcurrentTasks", "Concurrent Tasks" ) knob.setValue(1) node.addKnob(knob)
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in instances = api.instances_by_plugin(failed, plugin) for instance in instances: # background vs. foreground rendering soho_foreground = 1 if "remote" in instance.data["families"]: soho_foreground = 0 # setting parms instance[0].setParms({"soho_foreground": soho_foreground})
def process(self, context, plugin): # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in. instances = api.instances_by_plugin(failed, plugin) plugin = plugin() for instance in instances: node = instance[0] for parm in node.parms(): if parm.name() in plugin.get_supported_parameters(): expected = plugin.get_expected_path(instance, parm.name()) parm.set(expected)
def process(self, context, plugin): import nuke # Get the errored instances failed = [] for result in context.data["results"]: if (result["error"] is not None and result["instance"] is not None and result["instance"] not in failed): failed.append(result["instance"]) # Apply pyblish.logic to get the instances for the plug-in. instances = api.instances_by_plugin(failed, plugin) plugin = plugin() for instance in instances: node = instance[0] node.addKnob(nuke.Tab_Knob("Deadline")) knob = nuke.Int_Knob("deadlineChunkSize", "Chunk Size") knob.setValue(1) node.addKnob(knob) knob = nuke.Int_Knob("deadlinePriority", "Priority") knob.setValue(50) node.addKnob(knob) knob = nuke.String_Knob("deadlinePool", "Pool") node.addKnob(knob) knob = nuke.String_Knob("deadlineLimits", "Limits") node.addKnob(knob) knob = nuke.Int_Knob("deadlineConcurrentTasks", "Concurrent Tasks") knob.setValue(1) node.addKnob(knob)