Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use specific Creator Plugin when multiple Creators exist for single family #507

Open
BigRoy opened this issue Jan 9, 2020 · 5 comments · May be fixed by #531
Open

Use specific Creator Plugin when multiple Creators exist for single family #507

BigRoy opened this issue Jan 9, 2020 · 5 comments · May be fixed by #531

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Jan 9, 2020

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.

@tokejepsen
Copy link
Collaborator

Cant see why you'd need to have two plugins triggered. Voting for passing the Creator plugin with backwards compatibility.

@mkolar
Copy link
Member

mkolar commented Jan 21, 2020

I agree with Toke. And just as he, I can't for the life of me think of a situation where you want two creators. Do you have a use case?

@ddesmond
Copy link

Had same behaviour when trying to do Imagesequence in Houdini, since i wanted RenderImageseqnce_MANTRA and RenderImageseqnce_ARNOLD. When created Houdini would spawn me both nodes. Case: Users want to be able to render localy some elements and not depend on deadline/farm.

@davidlatwe
Copy link
Collaborator

Just adding notes.

  • The api.create was originally from #195 #291.
  • Only one last instance is returned from api.create no matter how many plugin been processed.

@BigRoy
Copy link
Collaborator Author

BigRoy commented Mar 9, 2020

The api.create was originally from #291.

Actually the problem was there before too, the code had just moved.

Anyway... I'm still all for getting this corrected in the best way possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants