-
Notifications
You must be signed in to change notification settings - Fork 59
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
Explicitly providing targets to util.publish() or pyblish_qml.show() excludes "default" target #345
Comments
With the above being said, I believe there might be a bug where it's not explicit for Pyblish-base looking at the code here since it doesn't exclude the ones that are not explicitly passed along. E.g. import pyblish.api
import pyblish.util
pyblish.api.register_target("local")
pyblish.util.collect(targets=["default", "render"])
# I believe pyblish runs with targets ["default", "render", "test"] However for Pyblish QML the Similarly, it actually removes them from registered targets. import pyblish.api
import pyblish.util
pyblish.api.register_target("render")
pyblish.api.register_target("test")
pyblish.util.collect(targets=["default", "render"])
print pyblish.api.registered_targets()
# ['test']
# Note that "render" is now removed from the registered targets. I believe this is a bug and |
Defo bug. PR is welcomed:-) |
Had a look at this, which also involves pyblish/pyblish-qml#362, #363 and #345. There are two points being made, one of which is a bug the other is misunderstood.
With that in mind, fix the bug but leave the behavior of |
I think the confusion comes from the fact that "default" is sometimes treated as a normal target and sometimes as a special target. It doesn't need to be explicitly registered when adding an extra target: pyblish.api.register_target("render")
pyblish.util.publish() # uses "default" and "render" ...But it must be passed when using explicit targets: pyblish.util.publish(targets=["render"]) # uses "render" only
pyblish.util.publish(targets=["default", "render"]) # uses "default" and "render" Wouldn't it make the logic more consistent if "default" were not a special target and were simply registered by default when pyblish is imported? User could easily deregister it if necessary, or explicitly change the targets within
Hopefully the bug should be fixed by #364, please let me know if it behaves as expected. |
With 1.8.5 released, is this still an issue? |
Issue
In Pyblish whenever one registers a custom target it still includes the
default
target - as if it is always present.This concept propagates correctly to
pyblish_qml.show()
when no targets are provided:However when providing targets explicitly to
pyblish_qml.show()
it will only includedefault
when explicitly provided. This behavior does nicely match what Pyblish currently does when usingpyblish.util.publish()
, like:Note that here "default" is not included in the targets
Discussion
The consusion rises when you query
pyblish.api.registered_targets()
, it never lists "default" even though it is included by default, yet not when you start to explicitly providing targets.Somehow it left me confused for two hours where the behavior started to differ when I triggered QML with a target and it lacked the default plug-ins. I'm wondering whether we should be able to simplify the logic so it's the same in all those cases. Additionally the Documentation led me off the path too as it indicated by default plug-ins would target anything with
*
:However the code indicates the default target is set only to
targets = ["default"]
Reference:
The text was updated successfully, but these errors were encountered: