Message 1 of 24
MAXScript Qt UI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In the end, using Qt from MAXScript was more straightforward than I thought, kudos to @denisT.MaxDoctor for setting me on the right track with the QtUiLoader. Here's an edited sample from the max python sample scripts:
(
local QFile = (python.import "PySide2.QtCore").QFile
local QUiLoader = (python.import "PySide2.QtUiTools").QUiLoader
local GetQMaxMainWindow = (python.import "qtmax").GetQMaxMainWindow
local ui_file = QFile "QtTest.ui"
ui_file.open QFile.ReadOnly
local ui = (QUiLoader()).load ui_file (GetQMaxMainWindow())
ui_file.close()
fn hello = messageBox "Hello world!"
ui.pushButton.clicked.connect hello
ui.toolButton.clicked.connect getSaveFileName
ui.show()
)
Put it in the same folder as the .ui file from the attached zip and run the ms file. The two buttons are connected to maxscript functions, I guess you get the idea. Have fun 🙂