Maya 2023 keeps crashing when running Qt UI

65 views
Skip to first unread message

Yoga Yasahardja

unread,
Aug 22, 2024, 8:42:56 PMAug 22
to Python Programming for Autodesk Maya
I'm not sure what's the problem here. I keep getting crash when running this script. 

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'inbetweener.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_Inbetweener(object):
    def setupUi(self, Inbetweener):
        Inbetweener.setObjectName("Inbetweener")
        Inbetweener.resize(290, 76)
        Inbetweener.setAutoFillBackground(False)
        self.centralwidget = QtWidgets.QWidget(Inbetweener)
        self.centralwidget.setEnabled(True)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
        self.centralwidget.setSizePolicy(sizePolicy)
        self.centralwidget.setMinimumSize(QtCore.QSize(290, 55))
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 31, 41))
        self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
        self.hlayout1 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
        self.hlayout1.setContentsMargins(0, 0, 0, 0)
        self.hlayout1.setObjectName("hlayout1")
        self.button1 = QtWidgets.QPushButton(self.horizontalLayoutWidget)
        self.button1.setText("")
        self.button1.setObjectName("button1")
        self.hlayout1.addWidget(self.button1)
        self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(50, 20, 71, 16))
        self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
        self.hlayout2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
        self.hlayout2.setContentsMargins(0, 0, 0, 0)
        self.hlayout2.setObjectName("hlayout2")
        self.button3 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button3.sizePolicy().hasHeightForWidth())
        self.button3.setSizePolicy(sizePolicy)
        self.button3.setText("")
        self.button3.setObjectName("button3")
        self.hlayout2.addWidget(self.button3)
        self.button2 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        self.button2.setEnabled(True)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button2.sizePolicy().hasHeightForWidth())
        self.button2.setSizePolicy(sizePolicy)
        self.button2.setText("")
        self.button2.setObjectName("button2")
        self.hlayout2.addWidget(self.button2)
        self.button5 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button5.sizePolicy().hasHeightForWidth())
        self.button5.setSizePolicy(sizePolicy)
        self.button5.setText("")
        self.button5.setObjectName("button5")
        self.hlayout2.addWidget(self.button5)
        self.button4 = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button4.sizePolicy().hasHeightForWidth())
        self.button4.setSizePolicy(sizePolicy)
        self.button4.setText("")
        self.button4.setObjectName("button4")
        self.hlayout2.addWidget(self.button4)
        self.horizontalLayoutWidget_3 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(170, 20, 71, 16))
        self.horizontalLayoutWidget_3.setObjectName("horizontalLayoutWidget_3")
        self.hlayout4 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_3)
        self.hlayout4.setContentsMargins(0, 0, 0, 0)
        self.hlayout4.setObjectName("hlayout4")
        self.button9 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button9.sizePolicy().hasHeightForWidth())
        self.button9.setSizePolicy(sizePolicy)
        self.button9.setText("")
        self.button9.setObjectName("button9")
        self.hlayout4.addWidget(self.button9)
        self.button10 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button10.sizePolicy().hasHeightForWidth())
        self.button10.setSizePolicy(sizePolicy)
        self.button10.setText("")
        self.button10.setObjectName("button10")
        self.hlayout4.addWidget(self.button10)
        self.button8 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button8.sizePolicy().hasHeightForWidth())
        self.button8.setSizePolicy(sizePolicy)
        self.button8.setText("")
        self.button8.setObjectName("button8")
        self.hlayout4.addWidget(self.button8)
        self.button7 = QtWidgets.QPushButton(self.horizontalLayoutWidget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.button7.sizePolicy().hasHeightForWidth())
        self.button7.setSizePolicy(sizePolicy)
        self.button7.setText("")
        self.button7.setObjectName("button7")
        self.hlayout4.addWidget(self.button7)
        self.horizontalLayoutWidget_4 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_4.setGeometry(QtCore.QRect(130, 10, 31, 41))
        self.horizontalLayoutWidget_4.setObjectName("horizontalLayoutWidget_4")
        self.hlayout3 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_4)
        self.hlayout3.setContentsMargins(0, 0, 0, 0)
        self.hlayout3.setObjectName("hlayout3")
        self.button6 = QtWidgets.QPushButton(self.horizontalLayoutWidget_4)
        self.button6.setText("")
        self.button6.setObjectName("button6")
        self.hlayout3.addWidget(self.button6)
        self.horizontalLayoutWidget_5 = QtWidgets.QWidget(self.centralwidget)
        self.horizontalLayoutWidget_5.setGeometry(QtCore.QRect(250, 10, 31, 41))
        self.horizontalLayoutWidget_5.setObjectName("horizontalLayoutWidget_5")
        self.hlayout5 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_5)
        self.hlayout5.setContentsMargins(0, 0, 0, 0)
        self.hlayout5.setObjectName("hlayout5")
        self.button11 = QtWidgets.QPushButton(self.horizontalLayoutWidget_5)
        self.button11.setText("")
        self.button11.setObjectName("button11")
        self.hlayout5.addWidget(self.button11)
        Inbetweener.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(Inbetweener)
        self.statusbar.setObjectName("statusbar")
        Inbetweener.setStatusBar(self.statusbar)

        self.retranslateUi(Inbetweener)
        QtCore.QMetaObject.connectSlotsByName(Inbetweener)

    def retranslateUi(self, Inbetweener):
        _translate = QtCore.QCoreApplication.translate
        Inbetweener.setWindowTitle(_translate("Inbetweener", "Inbetweener"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Inbetweener = QtWidgets.QMainWindow()
    ui = Ui_Inbetweener()
    ui.setupUi(Inbetweener)
    Inbetweener.show()
    sys.exit(app.exec_())



//=====================================================
Maya Crash Report
//=====================================================

Exception code: C0000005: ACCESS_VIOLATION - illegal read at address 0x00000008
Fault address:  D2EF8BB9 in C:\Program Files\Autodesk\Maya2023\bin\shiboken2.cp39-win_amd64.dll
0001:00037BB9 Logical offset (see .map file for location)

Call stack:
Module:  C:\Program Files\Autodesk\Maya2023\bin\shiboken2.cp39-win_amd64.dll (-exported-)
Location: shiboken2.cp39-win_amd64.dllShiboken::PyName::result + 145FC bytes
Decl: struct _object * __ptr64 __cdecl Shiboken::PyName::result(void)
Module:  C:\Program Files\Autodesk\Maya2023\bin\python39.dll (-exported-)
Location: python39.dllPyType_GenericNew + 5F5 bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\python39.dll (-exported-)
Location: python39.dll_PyEval_EvalFrameDefault + 3FE3 bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\python39.dll (-exported-)
Location: python39.dllPyObject_GC_Del + C53 bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\python39.dll (-exported-)
Location: python39.dll_PyEval_EvalCodeWithName + A9 bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\python39.dll (-exported-)
Location: python39.dllPyEval_EvalCodeEx + 9B bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\python39.dll (-exported-)
Location: python39.dllPyEval_EvalCode + 2D bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\CommandEngine.dll (-exported-)
Location: CommandEngine.dllTpythonInterpreter::executeCommand + 2F0 bytes
Decl: public: virtual bool __cdecl TpythonInterpreter::executeCommand(class Tstring const & __ptr64,bool,bool,class TinterpreterResult * __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllQmayaCommandScrollFieldExecuter::doCommandCompletion + 30B bytes
Decl: private: bool __cdecl QmayaCommandScrollFieldExecuter::doCommandCompletion(class QKeyEvent * __ptr64,bool) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllTidleAction::preDoIdleAction + F bytes
Decl: private: void __cdecl TidleAction::preDoIdleAction(class Tevent const & __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllTidleAction::destroyAfterRunning + 23 bytes
Decl: public: bool __cdecl TidleAction::destroyAfterRunning(void)const __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllTidleLicenseAction::~TidleLicenseAction + 175 bytes
Decl: public: virtual __cdecl TidleLicenseAction::~TidleLicenseAction(void) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllTeventHandler::doIdles + 2F2 bytes
Decl: public: static bool __cdecl TeventHandler::doIdles(void)
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllTeventHandler::suspendIdleEvents + 150 bytes
Decl: public: static void __cdecl TeventHandler::suspendIdleEvents(void)
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQObject::event + 8D bytes
Decl: public: virtual bool __cdecl QObject::event(class QEvent * __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Widgets.dll (-exported-)
Location: Qt5Widgets.dllQApplicationPrivate::notify_helper + 110 bytes
Decl: public: bool __cdecl QApplicationPrivate::notify_helper(class QObject * __ptr64,class QEvent * __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Widgets.dll (-exported-)
Location: Qt5Widgets.dllQApplication::notify + 18B3 bytes
Decl: public: virtual bool __cdecl QApplication::notify(class QObject * __ptr64,class QEvent * __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllQmayaApplication::currentSystemMouseButtons + 671 bytes
Decl: public: static class QFlags<enum Qt::MouseButton> __cdecl QmayaApplication::currentSystemMouseButtons(void)
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQCoreApplication::notifyInternal2 + BA bytes
Decl: private: static bool __cdecl QCoreApplication::notifyInternal2(class QObject * __ptr64,class QEvent * __ptr64)
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQEventDispatcherWin32::event + D0 bytes
Decl: public: virtual bool __cdecl QEventDispatcherWin32::event(class QEvent * __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Widgets.dll (-exported-)
Location: Qt5Widgets.dllQApplicationPrivate::notify_helper + 110 bytes
Decl: public: bool __cdecl QApplicationPrivate::notify_helper(class QObject * __ptr64,class QEvent * __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Widgets.dll (-exported-)
Location: Qt5Widgets.dllQApplication::notify + 18B3 bytes
Decl: public: virtual bool __cdecl QApplication::notify(class QObject * __ptr64,class QEvent * __ptr64) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllQmayaApplication::currentSystemMouseButtons + 671 bytes
Decl: public: static class QFlags<enum Qt::MouseButton> __cdecl QmayaApplication::currentSystemMouseButtons(void)
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQCoreApplication::notifyInternal2 + BA bytes
Decl: private: static bool __cdecl QCoreApplication::notifyInternal2(class QObject * __ptr64,class QEvent * __ptr64)
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQCoreApplicationPrivate::sendPostedEvents + 215 bytes
Decl: public: static void __cdecl QCoreApplicationPrivate::sendPostedEvents(class QObject * __ptr64,int,class QThreadData * __ptr64)
Module:  C:\Program Files\Autodesk\Maya2023\plugins\platforms\qwindows.dll (-exported-)
Location: qwindows.dllqt_plugin_query_metadata + 1FBF bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQEventDispatcherWin32::processEvents + 6A bytes
Decl: public: virtual bool __cdecl QEventDispatcherWin32::processEvents(class QFlags<enum QEventLoop::ProcessEventsFlag>) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\plugins\platforms\qwindows.dll (-exported-)
Location: qwindows.dllqt_plugin_query_metadata + 1F99 bytes
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQEventLoop::exec + 1BC bytes
Decl: public: int __cdecl QEventLoop::exec(class QFlags<enum QEventLoop::ProcessEventsFlag>) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\Qt5Core.dll (-exported-)
Location: Qt5Core.dllQCoreApplication::exec + 154 bytes
Decl: public: static int __cdecl QCoreApplication::exec(void)
Module:  C:\Program Files\Autodesk\Maya2023\bin\ExtensionLayer.dll (-exported-)
Location: ExtensionLayer.dllTapplication::start + E5 bytes
Decl: public: void __cdecl Tapplication::start(void) __ptr64
Module:  C:\Program Files\Autodesk\Maya2023\bin\maya.exe (-exported-)
Location: maya.exeTiteratorWrapperFwd<TscenePartitions::ConstIteratorDescriptor,TiteratorWrapper<TscenePartitions::ConstIteratorDescriptor> >::operator++ + 1490 bytes
Decl: public: class TiteratorWrapper<struct TscenePartitions::ConstIteratorDescriptor> & __ptr64 __cdecl TiteratorWrapperFwd<struct TscenePartitions::ConstIteratorDescriptor,class TiteratorWrapper<struct TscenePartitions::ConstIteratorDescriptor> >::operator++
Module:  C:\Program Files\Autodesk\Maya2023\bin\maya.exe (-exported-)
Location: maya.exeTiteratorWrapperFwd<TscenePartitions::ConstIteratorDescriptor,TiteratorWrapper<TscenePartitions::ConstIteratorDescriptor> >::operator++ + 17E47 bytes
Decl: public: class TiteratorWrapper<struct TscenePartitions::ConstIteratorDescriptor> & __ptr64 __cdecl TiteratorWrapperFwd<struct TscenePartitions::ConstIteratorDescriptor,class TiteratorWrapper<struct TscenePartitions::ConstIteratorDescriptor> >::operator++
Module:  C:\Program Files\Autodesk\Maya2023\bin\maya.exe (-exported-)
Location: maya.exeTiteratorWrapperFwd<TscenePartitions::ConstIteratorDescriptor,TiteratorWrapper<TscenePartitions::ConstIteratorDescriptor> >::operator++ + 16F7A bytes
Decl: public: class TiteratorWrapper<struct TscenePartitions::ConstIteratorDescriptor> & __ptr64 __cdecl TiteratorWrapperFwd<struct TscenePartitions::ConstIteratorDescriptor,class TiteratorWrapper<struct TscenePartitions::ConstIteratorDescriptor> >::operator++
Module:  C:\Windows\System32\KERNEL32.DLL (-exported-)
Location: KERNEL32.DLLBaseThreadInitThunk + 14 bytes
Module:  C:\Windows\SYSTEM32\ntdll.dll (-exported-)
Location: ntdll.dllRtlUserThreadStart + 21 bytes
End of stack

//crash log file name = C:\Users\YOHANE~1\AppData\Local\Temp\MayaCrashLog240823.0936.log
//version     = 23.0.0.1294
//cut            =  02/16/2022, 202202161415
//current scene = unDisclosed
//command history (most recent last):
//====================================================
//last tool: renderWindowSelectContextItem
//====================================================
//panel with focus: scriptEditorPanel1
//visible panels:
// modelPanel4 outlinerPanel1 scriptEditorPanel1
//====================================================
//Memory usage:
// 22364.199 Mb Free Memory
// 25161.016 Mb Free Swap
// 1365.500 Mb Current

//====================================================
//Python stack:
  File: "<maya console>", line 4, in <module>()

//====================================================

Yoga Yasahardja

unread,
Aug 22, 2024, 8:44:28 PMAug 22
to Python Programming for Autodesk Maya
Hello guys, thank you in advance. 

Yoga Yasahardja

unread,
Aug 22, 2024, 8:47:58 PMAug 22
to Python Programming for Autodesk Maya
I already try it using python 3.12 and 3.9. Import from PySide2, PyQt5, from Qt, all same result. 

Justin Israel

unread,
Aug 22, 2024, 9:53:21 PMAug 22
to python_in...@googlegroups.com
You can't really pick and choose your version of python or PySide vs PyQt. If you are going to run it within Maya, you need to use the version of python and the type of Qt binding that it provides. When you see "shiboken" in the stacktrace, that is telling you that you need to be using PySide2. I see you are also using some generated UI code that came from PyQt5, so that needs to be generated from the pyside UI generation.

On Fri, Aug 23, 2024 at 12:48 PM Yoga Yasahardja <yogayas...@gmail.com> wrote:
I already try it using python 3.12 and 3.9. Import from PySide2, PyQt5, from Qt, all same result. 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/10dcd2e8-c601-439f-b154-faa10b753bfcn%40googlegroups.com.

Yoga Yasahardja

unread,
Aug 22, 2024, 10:13:45 PMAug 22
to Python Programming for Autodesk Maya
additionally I can't even run this (screenshot attached). 
Screenshot 2024-08-23 111223.png

Yoga Yasahardja

unread,
Aug 22, 2024, 10:16:22 PMAug 22
to Python Programming for Autodesk Maya
Hi, Justin, Thank you for your reply! 

I checked that my maya 2023 used PySide2, I already try installing python 3.9 and used PySide2 but it didn't work either. 
Sorry as I'm new to Qt environment, not sure if I understand your reply well. 

Also, 
is there any suggestion what should I use to generate PySide UI generation you mentioned?

Thank you.  

Justin Israel

unread,
Aug 22, 2024, 10:25:26 PMAug 22
to python_in...@googlegroups.com
Ok a few things from your last couple replies. You should not need to install Python or PySide2, as they are already bundled within Maya. You only need to install things if your goal is to run a standalone application that wants to load and use maya.standalone.

The code snippet you are running from within the Maya Script Editor should not be trying to create and start a new QApplication. One is already running for you as the Maya app itself. You only need to create and show the widgets.

Yoga Yasahardja

unread,
Aug 22, 2024, 10:49:20 PMAug 22
to Python Programming for Autodesk Maya
I see. I think that's the reason it keeps crashing (?) 
It worked fine when I ran this:
from Qt import QtWidgets

w = QtWidgets.QWidget()
w.show()

Actually I just need this UI file run in maya. Is there anyway to call attached files in maya? (I've converted this ui file to python using pyuic5). 
I think I need to show the QWidget instead of QApplications(?) by changing the last part of this script? 

Thank you! 

inbetweener.py

Yoga Yasahardja

unread,
Aug 22, 2024, 11:03:20 PMAug 22
to Python Programming for Autodesk Maya
oh it worked fine with this 
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'inbetweener.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from Qt import QtCore, QtGui, QtWidgets
    Inbetweener = QtWidgets.QMainWindow()
    ui = Ui_Inbetweener()
    ui.setupUi(Inbetweener)
    Inbetweener.show()


I just have to delete the : 
app = QtWidgets.QApplication(sys.argv)

and
sys.exit(app.exec_())



Thank you Justin!! 

Justin Israel

unread,
Aug 23, 2024, 12:12:34 AMAug 23
to python_in...@googlegroups.com
Glad you got it working!

You would either need to switch to using the proper pyside uic tool to generate your file externally, or use the UILoader class to dynamically read your ui file into a python class, in code:
https://doc.qt.io/qtforpython-5/tutorials/basictutorial/uifiles.html




Reply all
Reply to author
Forward
0 new messages