dreamworksanimation / usdmanager

USD Manager
http://www.usdmanager.org
Apache License 2.0
321 stars 60 forks source link

python3 error #31

Closed rodstar97 closed 11 months ago

rodstar97 commented 11 months ago

Open app after install the python3 branch

home/rf/.local/bin/usdmanager:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('usdmanager==0.15.0', 'usdmanager')
WARNING:usdmanager.utils:Unable to create AssetResolver - Asset links may not work correctly
Traceback (most recent call last):
  File "/home/rf/.local/bin/usdmanager", line 4, in <module>
    __import__('pkg_resources').run_script('usdmanager==0.15.0', 'usdmanager')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 722, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1561, in run_script
    exec(code, namespace, namespace)
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/EGG-INFO/scripts/usdmanager", line 20, in <module>
    run()
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 5028, in run
    app.run()
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 4891, in run
    window = self.newWindow()
             ^^^^^^^^^^^^^^^^
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 4944, in newWindow
    window = self.createWindowFrame()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 4934, in createWindowFrame
    return widgetClass()
           ^^^^^^^^^^^^^
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 256, in __init__
    self.setupUi()
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 538, in setupUi
    self.currTab = self.newTab()
                   ^^^^^^^^^^^^^
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 1021, in newTab
    newTab = BrowserTab(self.tabWidget)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 4373, in __init__
    self.setIndentSettings(prefs['useSpaces'], prefs['tabSpaces'], prefs['autoIndent'])
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/__init__.py", line 4675, in setIndentSettings
    self.textBrowser.setTabStopWidth(width)
TypeError: setTabStopWidth(self, width: int): argument 1 has unexpected type 'float'

By changing the line 4675 to self.textBrowser.setTabStopWidth(int(width)) the gui opens but still get some errors

Traceback (most recent call last):
  File "/home/rf/.local/lib/python3.11/site-packages/usdmanager-0.15.0-py3.11.egg/usdmanager/linenumbers.py", line 323, in paintEvent
    painter.drawText(0, yPos - vScrollPos, width, height, flags, str(currLine))
TypeError: arguments did not match any overloaded call:
  drawText(self, p: Union[QPointF, QPoint], s: str): argument 1 has unexpected type 'int'
  drawText(self, rectangle: QRectF, flags: int, text: str): argument 1 has unexpected type 'int'
  drawText(self, rectangle: QRect, flags: int, text: str): argument 1 has unexpected type 'int'
  drawText(self, rectangle: QRectF, text: str, option: QTextOption = QTextOption()): argument 1 has unexpected type 'int'
  drawText(self, p: QPoint, s: str): argument 1 has unexpected type 'int'
  drawText(self, x: int, y: int, width: int, height: int, flags: int, text: str): argument 2 has unexpected type 'float'
  drawText(self, x: int, y: int, s: str): argument 2 has unexpected type 'float'
QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?
QPaintDevice: Cannot destroy paint device that is being painted

Ubuntu Release: 23.10 pyQt5 install

rodstar97 commented 11 months ago

Problem is python 3.11 with 3.9 it works perfect

mds-dwa commented 11 months ago

Does wrapping all .width() calls in that file resolve it? What Qt version are you using?

mds-dwa commented 11 months ago

This should be resolved here -- https://github.com/dreamworksanimation/usdmanager/compare/python3...mdsandell:usdmanager:python3 -- but for whatever reason my browser's not letting me finish the pull request. @gj-dwa I think you can put this in both the master and python3 branches if you want to maintain consistency.

gj-dwa commented 11 months ago

Thank you @mds-dwa