Mutually exclusive plugins

Hi,

is there a possibility to have mutually exclusive plugins? I know dependencies between plugins isn’t the best thing, but I want the artist to have the option to chose between “Extract alembic” and Extract alembic on Deadline".
One would export it locally, the other just submits a task to the renderfarm.
How would you go about this?

Hi @asztalosdani, do you mean visually, such that when you toggle Extract Alembic then Extract Alembic on Deadline would de-toggle?

That is a good idea, but there isn’t anything like that at the moment. Would be interested in seeing a PR for it, if you are able!

Perhaps something along the lines of:

class ExtractAlembic(...):
   exclusive_groups = ["renderfarm"]

class ExtractAlembicLocal(...):
   exclusive_groups = ["renderfarm"]

Where there can only ever be 1 active plug-in in an “exclusive group”.

Hi @marcus, yes, that’s what I’d like to see.

A slightly related question:
Can I (a specific plugin) get the currently active plugins? pyblish.api.discover() seems to return all of the plugins, but it does not reflect the check state in the gui.

There might be; the toggle in Lite and QML should affect the instance.data["optional"] member; an un-checked instance should have False and True for a checked one.

If not, you can listen for the instanceToggled callback, and set the attribute yourself.

from pyblish import api

def on_toggled(instance, old, new):
  print("%s was toggled" % instance)

api.register_callback("instanceToggled", on_toggled)

I think you meant pluginToggled, but I get the idea. :wink:
Thanks!

1 Like