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

add discover_gui (without introducing ui dependencies !) #389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hannesdelbeke
Copy link
Contributor

@hannesdelbeke hannesdelbeke commented Jul 8, 2022

Problem:

Pyblish base let's us register guis with pyblish.api.register_gui , but not show them. 😞

Each dcc implementation of pyblish has a show function, but pyblish base does not.
e.g. in pyblish-maya we can do:

import pyblish_maya
pyblish_maya.show()

but in pyblish-base we can't do:

import pyblish
pyblish.show()

show() launches the registered UI, and on fail falls back to the next registered UI.
However this code is duplicated across each dcc implementation, and not available in pyblish base.
Moving this code to base would make it easier to make dcc implementations, and enable devs to use this functionality for non dcc plugins.

Solution

this PR implements the discover_gui method from pyblish_maya & pyblish_3dsmax in pyblish base, without creating a UI dependency

now we can do this

import pyblish.api
import pyblish.gui
pyblish.api.register_gui('pyblish_lite')
pyblish.gui.show()

Note

  • it might even be worth movign the show function to pyblish so we can do pyblish.show()

Pyblish base already allows us to show both default qml & lite explicitly.

import pyblish_qml
pyblish_qml .show()
import pyblish_lite
pyblish_lite.show()

@hannesdelbeke hannesdelbeke changed the title add discover gui to pyblish base, without any ui dependencies. add discover_gui (without introducing ui dependencies !) Jul 8, 2022
@mottosso
Copy link
Member

I suppose we could do this; I'd say it's a backwards relationship. The GUI depends on base, but base should not depend on any GUI. But, consider we already do this via pyblish_maya.. it's dirt we've already accumulated so may as well continue shovelling it?

The only thing missing here is documentation for it. Can you add this new mechanic to the README of this project? We also need a test; not one that actually launches Pyblish QML or Lite, but something that calls some function such that you can confirm this actually works and tells us when it does not via the test suite.

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 this pull request may close these issues.

2 participants