-
Notifications
You must be signed in to change notification settings - Fork 41
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
'publish' data member on instance doesn't work #59
Comments
There's an update to pyblish-base that addresses this globally, you could start looking towards that. It hasn't been released yet, but it's in the latest commit of the master branch. This issue will then be resolved as a side-effect of this getting into the next release. |
it's is also affecting us. has 1.4.2 changed address this in base? |
This should be fixed in pyblish-base 1.4.2 See here: https://github.com/pyblish/pyblish-base/blob/master/pyblish/logic.py#L304 Lite uses this iterator in control.py. Let me know if this isn't working for you, and I'll take a closer look! |
I'm using pyblish-base 1.4.2 and pyblish-lite 0.4.0 and i'm still having this issue how is the instance |
looks like the validators are skipped before the UI gets a chance to set the https://github.com/pyblish/pyblish-base/blob/master/pyblish/logic.py#L305
|
Can you tell whether this happens exclusively on the first instance in the list? |
Ok, I've located the bug. This should only affect the first instance in the list. It's happening, because of the generator which produces plug-in/instance pairs. In order for Lite to know when to stop, it has to prime the generator for the next pair before making a decision. It does this priming just before passing control to the GUI. So in practice what happens is that the GUI has already determined the fate for the next item in the generator, and won't listen to changes in the GUI before moving on to process it. It's a tricky one! The pair must be fetched before being able to make a decision, but pairs cannot be put back into the generator if it decides not to continue. pyblish-qml doesn't have this bug, because QML does not implement the "continue on pause/validation" that Lite has. Suggestions are welcome. |
And as a temporary workaround, add an additional null-instance first in the list, and |
Reproducible: import pyblish_lite
import pyblish.api
class Collect(pyblish.api.ContextPlugin):
order = pyblish.api.CollectorOrder
def process(self, context):
instance = context.create_instance(name="A")
instance.data["publish"] = False
context.create_instance(name="B")
class Validate(pyblish.api.InstancePlugin):
order = pyblish.api.ValidatorOrder
def process(self, instance):
self.log.info(instance)
pyblish.api.register_plugin(Collect)
pyblish.api.register_plugin(Validate)
pyblish_lite.show() |
Can you confirm that it only affects the first instance in the GUI? The following instances should work fine. |
Yeah, it works if the first instance has |
Is the problem visible on the other instances too? As in, can you set On the first instance, if set to False, no amount of toggling would make it process. |
Yeah, I've tested with the workaround of having a dummy first instance that is publishable. |
It's true, it's been around for a little too long. pyblish-lite is a "community version" of pyblish-qml, which on one hand means this is where you get the most freedom to change things around and implement issues (such as this) that suit you best. On the other it means there is less of a timeline to rely on and anyone to pressure into seeing anything fixed. For pushing to a studio I would strongly suggest you choose pyblish-qml as it is the most mature and production proven. To fix this issue, the problem is almost entirely found in this loop here. What you can do is fetch the next "current_pair" and immediately process it, as opposed to fetching it separately. Fetching it separately is what enables us to "look ahead" at which combination of plug-in/instance is going to be processes and it is because of this "look ahead" that the first instance doesn't respond to the toggle - it has already been "looked ahead" on start-up and is ready to go. Let me know if that makes sense, would be happy to help seeing this fixed. |
Thanks for pointing me to the loop you suspect is the culprit. I'm going to fire up a debugger and see if I can figure out a fix. I also plan on exploring pyblish-qml now that I understand (as per your response in gitter chat) that it can actually work on earlier versions of Maya without Qt5 as the UI runs separately. This wasn't clear to me on first glance, but thanks for clarifying that. |
… states being out of date after initializing the pair_generator the first time.
It seems the problem is that pyblish-lite/pyblish_lite/control.py Line 103 in 286fe9f
is only created once after reset() , but inside the loop of the iterator the data can be out of date with the state of the UI's widgets.
Inside the pyblish-lite/pyblish_lite/control.py Line 218 in 286fe9f
there is some filtering out of deactivated plugins and disabled instances, but diving in with a debugger shows us that the UI can go out of sync with what that loop thinks the .data of instances is (and I suspect a similar issue with optional plugins.) It's almost as if it took a snapshot when generating the iterator, then it's never reading the state "live". The way it is all designed around iterating on a main iterator, I'm not entirely sure what the best approach would be to solve this one. |
Was this issue ever resolved as I am also currently struggeling with this problem? |
Doesn't seem like it, but a PR is welcome. |
…cords Bug fixed
Problem
Setting
instance.data['publish']
toFalse
in the collector makes it be ignored by it's respective validators, even after it's turned back on in the GUI.We noticed this when a lot of our plugins started failing using lite, but worked when using qml. Turns out it's because we use a lot of instances that are toggled off by default which prevents them from being validated properly, leading into many many failed publish attempts.
The text was updated successfully, but these errors were encountered: