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

QML window within Maya opening but without GUI #378

Open
Illogicstudios opened this issue Jul 10, 2023 · 4 comments
Open

QML window within Maya opening but without GUI #378

Illogicstudios opened this issue Jul 10, 2023 · 4 comments

Comments

@Illogicstudios
Copy link

I have a code to launch a qml window with my plugins stored in a folder "plugins". The problem is that the gui that supposed to be in the qml qindow isn't showing. The plugins seems to work how they supposed to be. Here's the code :

import os
import sys
import importlib
import pyblish.api
import pyblish_maya
import pyblish_qml
from pyblish_qml import api as qml_api

import pyblish_test

# Dependencies
qml_api.register_python_executable(r"C:\Program Files\Autodesk\Maya2022\bin\mayapy.exe")
qml_api.register_pyqt5(r"R:\pipeline\networkInstall\python_lib\PyQt5")

# Plugins
pyblish.api.deregister_all_paths()
pyblish.api.register_target("test_target")
pyblish.api.register_plugin_path(os.path.join(os.path.dirname(pyblish_test.__file__), "plugins"))

# GUI
pyblish.api.register_gui("pyblish_qml")
pyblish_qml.settings.WindowTitle="Pyblish Test"
pyblish_qml.settings.HiddenSections = []
pyblish_maya.show()

Here's the logs :

2023-07-10.11-48-59.mov

I'm on Maya 2022 with Python 3.7.7. Here's my packages :
image

@mottosso
Copy link
Member

Try removing this line.

qml_api.register_pyqt5(r"R:\pipeline\networkInstall\python_lib\PyQt5")

mayapy already has PySide2 which should be enough.

Then try adding your plug-ins to PYBLISHPLUGINPATH before launching Maya.

set PYBLISHPLUGINPATH=c:\my\plugins

If that works, you can try launching Maya first and adding it both via pyblish.api and PYBLISHPLUGINPATH. Since QML is running in a separate mayapy, it doesn't know about what gets registered inside of the Maya GUI. It only knows what's in the environment, like PYBLISHPLUGINPATH. Both Maya GUI and the external mayapy needs to know the path to your plug-ins.

import os
plugins = os.path.join(os.path.dirname(pyblish_test.__file__), "plugins")
os.environ["PYBLISHPLUGINPATH"] = plugins
pyblish.api.register_plugin_path(plugins)

@Illogicstudios
Copy link
Author

Setting the env var for Maya GUI and for mayapy doesn't seem to change something. The plugins are found and the collector is executed (some logs are here).

Here's my adapted code :

  • Maya launcher :
set PYBLISHPLUGINPATH=C:\Users\m.jenin\Documents\marius\pyblish_test\plugins
  • pyblish qml main:
import os
import sys
import importlib
import pyblish.api
import pyblish_maya
import pyblish_qml

from common import utils
import pyblish_test

from pyblish_qml import api as qml_api

# Dependencies
qml_api.register_python_executable(r"C:\Program Files\Autodesk\Maya2022\bin\mayapy.exe")
# qml_api.register_pyqt5(r"R:\pipeline\networkInstall\python_lib\PyQt5")

# Plugins
pyblish.api.deregister_all_paths()
pyblish.api.register_target("test_target")
plugins = os.path.join(os.path.dirname(pyblish_test.__file__), "plugins")
os.environ["PYBLISHPLUGINPATH"] = plugins
pyblish.api.register_plugin_path(plugins)

# GUI
pyblish.api.register_gui("pyblish_qml")
pyblish_qml.settings.WindowTitle="Pyblish Test"
pyblish_qml.settings.HiddenSections = []
pyblish_maya.show()

@Illogicstudios
Copy link
Author

Also pyblish_lite works well. It seems to be an UI problem

@wandth
Copy link

wandth commented Jan 27, 2025

Also pyblish_lite works well. It seems to be an UI problem

You must compile pyqt5 yourself, because maya2020 's pyside2 does not include qml, and 2022+ only includes or uses others compiled it

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

3 participants