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

InstancePlugin in CollectorOrder range does not process when instance.data["publish"] is False #346

Open
BigRoy opened this issue Jul 19, 2019 · 1 comment

Comments

@BigRoy
Copy link
Member

BigRoy commented Jul 19, 2019

Issue

We have some InstancePlugin collectors that collect additional data for some families, however almost all families originally get collected by a very generic ContextPlugin collector (detecting publishable objectSets in Maya e.g.)

Additionally we allow the artist to define the default state of how an instance will be collected, whether it's instance.data["publish"] is True. So one could set the default to False so after collecting it would be deactivated by default yet the user can tick/enable it to publish it along.

The issue now is, that the extra Collector plug-ins for those instances are not triggered, because obviously it's set to instance.data["publish"] = False .

It makes sense that the inactive (instance.data["publish"] == False) instances would not get processed, since that how it also works for Validation, Extraction, Integration. However, it also makes sense for an artist to define the default state after Collecting e.g. in the scene...

Some example InstancePlugin collectors that collect additional data:

Reference:


Ideas for workarounds for changes

Note that all ideas are presented to start the discussion on how to solve this the best way. Other ideas are more than welcome and it would be best to ensure "backwards compatibility" is maintained as much as possible.

Idea 1
  1. Instead of setting the default .data["publish"] set another default attribute .data["defaultState"] and create a Plug-in that only sets the actual instance.data["publish"] value at the end of collection pyblish.api.CollectorOrder + 0.4999, for example:
class CollectPublishState(pyblish.api.InstancePlugin):
    order = pyblish.api.CollectorOrder + 0.4999

    def process(self, instance):
        state = instance.data.get("defaultState", None)
        if state is not None:
            instance.data["publish"] = state

That way the actual instance can always have its "publish" True during most of collection and only get disabled at the end.

Idea 2
  1. Let Pyblish behave different for Collecting, so that any instance always triggers during collecting even when instance.data["publish"] = False so that Collecting always triggers.
Idea 3
  1. Introduce an extra stage aside of Collectors, Validators, Extractors and Integrators. Potentially an Initializer that only detects the instances and is not meant to collect all scene data right-away. The benefit would be that the User Interface can also be ,much more responsive for refreshes and just show the instances right away. However, it would introduce some new terminology and complexity that could be avoided.

For example, the "CollectDeadlineUser" plug-in that gets the connection with the Deadline server is not important to show the instance itself, whereas the plug-in does take some time to get the response. Basically it only needs to be collected, to allow validating it and use it during extraction. It's not needed for the initial interface state and what the artist would respond too.

@tokejepsen
Copy link
Member

Throwing another idea into the pile:

  • Add a new attribute to the plugins called always_run (or similar). This would disregard the publish data member if false.

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

No branches or pull requests

2 participants