To be able to inject the instance argument to Actions and get the relevant instances.
Currently you have to repeat a lot of code to get the relevant instances. Example to get the failed instances:
class Texture(pyblish.api.Action): label = "Print Failed Instance" on = "failed" def process(self, context): # get all failed instances failed = list() for result in context.data["results"]: if result["error"] is not None: if result["instance"] not in failed: failed.append(result["instance"]) for instance in failed: # context seem to return None if not instance: continue # filter to family specific instance if instance.data['family'] != 'texture': continue self.log.info(instance)
You already specify what statuses of instances the action should operate on, from the
on property ei.
You also know the families of instances, which is coming from the plugin executing the action.
With the status and family of the instance, we should be able to find the correct instances to operate on, Unless I’m missing something?