Hi,
I’m trying to load plugins based on if UI is loaded or not
This is an example:
if not pyblish.api.registered_guis():
pyblish.plugin.deregister_plugin(ValidateNegativeVolume)
I put this at the end of my module but for some reason debug info shows this message:
# DEBUG:pyblish.plugin:Ski
# pyblish.plugin : Skipped: “validate_model” (‘ValidateNegativeVolume’) #
Hi @marcus, i expect some plugins to skip validation when gui is not loaded
I register plugins by pyblish.plugin.register_plugin_path(“C:/pyblish_plugins”)
I’m using pyblish_qml gui
Ah, the problem is you’re registering a path, and deregistering a plug-in.
If you want to deregister a path, you should use deregister_plugin_path and if you want to deregister a plug-in, you need to also register a plug-in with register_plugin.
Thanks !
What if i will register plugins by both ways at the same time (e.g. i will add register_plugin at the end of the file ) will deregister_plugin work ? Or it still will load it by path ?
Yes, that should work. Remember the plug-ins are the classes inside the modules.
You could try using this, plugins_from_module() to automate some of it. You can also pass a path to discover() which would return the contained plug-ins from all the files, and then register those.