You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the "publish" value on an instance doesn't behave correctly, with families
If you set the 'publish' key on an instance's data to False, it will show up in the context list as toggled off, which is expected. However if you manually enable it, then try to Validate, validation doesn't process on the newly-enabled instance.
But if you enable the "publish" key to True from the beginning, the Validate process will act on the instance.
import pyblish.api
class TestPlugin(pyblish.api.ContextPlugin):
label = "Add Test Instance"
order = pyblish.api.CollectorOrder
def process(self, context):
inst = context.create_instance(name="Test Instance", family='test', families=['test'])
# if this is set to True, the families criteria in the instance plugin seems to be respected.
# If this is set to False, followed by the user manually enabling the instance in the UI, the families
# parameter on the instance plugin somehow isn't being evaluated correctly, and the instance plugin will
# not run. If you change the families parameter to ['*'] in the instance plugin, the instance behaves
# as if 'publish' was enabled to begin with after a manual toggle.
inst.data['publish'] = False
self.log.info('Test instance added.')
class TestValidationPlugin(pyblish.api.InstancePlugin):
label = 'Validate Test Instance'
order = pyblish.api.ValidatorOrder
families = ['test']
def process(self, instance):
self.log.info("Instance has been processed")
If you toggle the instance to be enabled and click validate, nothing happens.
However, if you change families = ['*'] in the instance plugin, then the validation plugin will run when you enable the instance manually. Somehow when the 'publish' value on an instance starts as False, the families parameter isn't matching anymore or something.
The text was updated successfully, but these errors were encountered:
That does sound like a bug, thanks for the elaborate reproducible. Would you be able to see if you can spot a fix for this? A pull request would be most welcome.
It seems like the "publish" value on an instance doesn't behave correctly, with families
If you set the 'publish' key on an instance's data to False, it will show up in the context list as toggled off, which is expected. However if you manually enable it, then try to Validate, validation doesn't process on the newly-enabled instance.
But if you enable the "publish" key to True from the beginning, the Validate process will act on the instance.
If you toggle the instance to be enabled and click validate, nothing happens.
However, if you change
families = ['*']
in the instance plugin, then the validation plugin will run when you enable the instance manually. Somehow when the 'publish' value on an instance starts as False, the families parameter isn't matching anymore or something.The text was updated successfully, but these errors were encountered: