-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Issue
When writing two Creator plug-ins that are targeted to the same resulting family there is unexpected behavior when using it with the Creator tool.
Both entries will individually show in the Creator, however whenever you trigger either of them both will be created. This is because the API triggers all Plugins based solely on the family
matching, and it doesn't trigger a specific plugin
I recall the API was designed like this for a reason but can't remember why. Now, with the Creator tool built as it is the the resulting behavior is super confusing. Is there anyone relying on this behavior of it to trigger multiple Creator plugins for a specific family?
class CreateA(api.Creator):
label = "A"
family = "foobar"
def process(self):
print("A")
class CreateB(api.Creator):
label = "B"
family = "foobar"
def process(self):
print("B")
Now in the Creator tool create A or B, you will always see both plug-ins are triggered:
A
B
Proposal
I'd propose to have the first argument for api.Create
to be the Creator
plugin to trigger as opposed to the family name.
For backwards compatibility I'd then make it so whenever it does not get an instance of Creator
but a string that it will keep the old behavior. This way any custom code built against the API will remain to work as is.
Then we'll just update the Creator tool to not trigger by family name but explicitly pass it the Plugin.
OR if the behavior is intended and we want to stick to it for specific reasons then likely we'd want to make the Creator UI less ambiguous that these double entries in the list are doing the exactly same thing - running both. Not sure what to do in that case, but it should at least be clearer what is going on then.