ynput / ayon-substance-painter

SubstancePainter integration for AYON
Apache License 2.0
5 stars 1 forks source link

Replace pyside2 import with qtpy import #12

Closed moonyuet closed 1 month ago

moonyuet commented 1 month ago

Changelog Description

This PR is to resolve the error of installing AYON when substance painter is launched.

[Python] Traceback (most recent call last):
  File "C:\Program Files/Adobe/Adobe Substance 3D Painter/resources/python\startup\painter_plugins_ui.py", line 58, in manage_plugin
    substance_painter_plugins.reload_plugin(module)
  File "C:\Program Files/Adobe/Adobe Substance 3D Painter/resources/python/modules\substance_painter_plugins.py", line 157, in reload_plugin
    start_plugin(module)
  File "C:\Program Files/Adobe/Adobe Substance 3D Painter/resources/python/modules\substance_painter_plugins.py", line 88, in start_plugin
    module.start_plugin()
  File "D:\ayon-addon_template\ayon-substance-painter\client\ayon_substancepainter\deploy\plugins\ayon_plugin.py", line 26, in start_plugin
    install_host(SubstanceHost())
  File "D:\ayon-core\client\ayon_core\pipeline\context_tools.py", line 129, in install_host
    host.install()
  File "D:\ayon-addon_template\ayon-substance-painter\client\ayon_substancepainter\api\pipeline.py", line 74, in install
    self._install_menu()
  File "D:\ayon-addon_template\ayon-substance-painter\client\ayon_substancepainter\api\pipeline.py", line 165, in _install_menu
    from PySide2 import QtWidgets
ModuleNotFoundError: No module named 'PySide2'

Additional info

n/a

Testing notes:

  1. Install and update addon with this branch
  2. Launch Substance
moonyuet commented 1 month ago

Makes sense! I vaguely recall there was a reason I had to use the PySide2 import at the time, but don't remember why.

What Substance Painter version did you test this with? (Did they update PySide versions, or we?) I wonder if this would still work with the older Substance Painter versions?

Other than that, change looks good! I don't have access to Painter myself currently; so can't test.

I was testing with their latest. there is also some bug when collecting the texture set in the latest version of substance. So when I tested with the tx, I was actually testing in one version elder than the latest.

BigRoy commented 1 month ago

I was testing with their latest. there is also some bug when collecting the texture set in the latest version of substance. So when I tested with the tx, I was actually testing in one version elder than the latest.

Can you create an issue for this with the bug/stack trace?