-
Couldn't load subscription status.
- Fork 47
Implementing "Post Collect" #356
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
base: master
Are you sure you want to change the base?
Conversation
|
Lovely. This does seem to work for my use case - I'll have to clean up and rewrite the code again but definitely seems to cover the right basics of what I need. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't done a code review - sorry. But functionality wise it seems to hit the mark on what I described. Nevertheless, it feels a bit odd that it would solely be a thing for Pyblish QML and their being no API equivalent to this feature in pyblish-base - so that makes me a bit wary about the implementation details.
Yeah, not sure it's about threading or other historical reason, both So since this feature was about controlling the iteration of plugins and instances, no need to touch If the out come was good, we could implement it back to |
|
So I've found a bug with this implementation.
The Additional Post Collector is NOT visible in the user interface, however it will trigger. You will also see the "Additional" header remain there and flicker dark during processing, you just won't see the Plug-ins whatsoever. This seems to happen whenever the Plugin's order is within 0.05 range of the post collect order. How I set the post_collector_order = str(pyblish.api.CollectorOrder + 0.3)
os.environ["PYBLISH_QML_POST_COLLECT"] = post_collector_orderclass Collector(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder
label = "Collect"
def process(self, context):
new = context.create_instance(subset)
new.data["family"] = "family"
class PostCollector(pyblish.api.InstancePlugin):
order = pyblish.api.CollectorOrder + 0.3
label = "Postcollect"
families = ["*"]
def process(self, instance):
# show signs of life
instance.context.create_instance("invalid")
self.log.info("invalid!")
print("invalid")
raise RuntimeError("invalid!")It will trigger when the PostCollector's order is anywhere between @davidlatwe can you reproduce this behavior? |
|
Actually... it seems slightly different. It will always process the first plug-in that was set to run in the post-collectors, even when it shouldn't run for a current instance due to it being deactivated. So say you'd deactivate nothing then the first one will still process when you deactivate the related instances and it "disappears in the UI". It will still run. |
…ctivated instances - Hacky workaround, see: pyblish/pyblish-qml#356 (comment)
Ok, I think I have fixed the bug ! The problem was at the Please have a test @BigRoy |
This PR should resolves pyblish/pyblish-base#359, an experimental feature called "Post Collect".
The "Post Collect" is a GUI behavior that will make Pyblish-QML stop running collector plugins at a given point, and let user to decide which instance may continue to the rest CVEI and which not.
Usage
Require an extra environment variable
PYBLISH_QML_POST_COLLECTto provide the break point, the value is a string of float. The number shoule be inside the range of Pyblish's Collecting.Here's an example: https://gist.github.com/davidlatwe/9c39e5ef05140d6ba98f0914ed46f5ed
And the working result: