A ContextPlugin with families specified will run when there’s no instance with that family.
import pyblish.api
class ValidateModelOrRig(pyblish.api.ContextPlugin):
order = pyblish.api.ValidatorOrder
label = "Run only for family of model or rig"
families = ['model', 'rig']
def process(self, context):
self.log.warning("Processing Model or Rig")
The above will show up in the GUI and will actually process even when no instance of model or rig is present, but another is (e.g. foobar). The above will also run when there are no instances at all.
Expected
I’d expect anything with families specified should only run when at least one instance is available with at least one of those families.
As such the above should only run if there are instances present of family rig and/or model. When those are present it should run only once, like any ContextPlugin.
Had another look at this and this actually seems to still be an Issue and working incorrectly.
To reproduce
import pyblish.api
class CollectInstanceTest(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder
def process(self, context):
context.create_instance("testInstance", family="thisFamily")
class ValidateContextTest(pyblish.api.ContextPlugin):
order = pyblish.api.ValidatorOrder
families = ["otherFamily"]
label = "Context Test (otherFamily only!)"
def process(self, context):
self.log.info("This should only run when instance "
"of otherFamily is present")
This Validator will run even though there’s no Instance available of family otherFamily.
I’m pretty sure I’m running 1.3.2 here. pyblish-win\lib\pyblish\VERSION states 1.3.2.
@marcus Shall I open an additional Issue for this?