Load Gui - Pyside6 ui file

Did anyone managed ever to load a .ui file in flame2025 using pyside6?
I made quite few iteration and these are the 2 most simple.
They both work but Flame become unresponsive.

from PySide6 import QtWidgets
from PySide6.QtUiTools import QUiLoader

import sys, os

if not QtWidgets.QApplication.instance():
app = QtWidgets.QApplication(sys.argv)
app = QtWidgets.QApplication.instance()

loader = QUiLoader()
window = loader.load(“file.ui”, None)


--------Non .ui ------------

from PySide6.QtWidgets import QApplication, QWidget

import sys

if not QApplication.instance():
app = QApplication(sys.argv)
app = QApplication.instance()

window = QWidget()



i was looking for something called uic to convert Qt5 Designer ‘.ui’ files into Qt6/PyQt6/PySide6 compatible files - life is short, couldn’t work it out in an hour, moved on.

I am knee deep in writing/un-writing/writing PySide6 python scripts - it’s a truly meaningless task - like adding a treehouse to a submarine, or polishing a bullet.

I still haven’t worked out how to get the python files to launch from the correct version of flame python when there is no /opt/Autodesk/python/current directory.


I dont know anything about pyside6 UI files but I think you are locking up Flame using that app.exec() stuff. I thiiiink that is trying to start a different thread and locking up the main thread… which is the main Flame app.

Take a look at all of the scripts on the Logik Portal. None of them use app.exec()


As Kieran mentioned…you don’t need app.exec()…the event loop already exists when Flame starts up.

There is a “bug” that affects Flame on Intel Mac. Autodesk for some reason forgot to compile Pyside2 and Pyside6 with the UiTools option, so QUiLoader is missing. This happened around Flame 2023+. This is not the case for Linux or Mac M1/M2. @fredwarren I haven’t filed a bug report for this because Flame on Intel Mac will be end of life soon.

My work around was to pip install Pyside2 manually from within the python folder for the Flame version (i.e. /opt/Autodesk/python/flame2023). But beware this is not something you would normally do.

One unfortunate side effect with this hack is that you can’t use QWebEngineView. WebEngineView is a web browser widget.

So, right now, I’m re-writing the scripts to avoid using .ui. I’m just going to use the command line utility “pyside2-uic” or “pyside6-uic” which compiles the .ui to python code and import from there.

Otherwise using UiLoader and .ui is a great workflow and saves you from writing a ton of ui code. You don’t need to go back to the python to tweak the layout or change icons and colors.

1 Like

that works.