thanks a lot I'll consider using it I was afraid that user will have to install non-maya packages
but its great that its bundeled with the project itself thanks Justin, Marcus ^ ^ On Wednesday, November 27, 2024 at 1:47:27 PM UTC+2 Marcus Ottosson wrote: > Yep, that's it. It's meant to be bundled with your project, so as to not > have to install anything. > > from .vendor import Qt > > But can also be installed via pip install Qt.py > > import Qt > > And it'll run on Maya 2025 down to 2015 or so. > > On Mon, 25 Nov 2024 at 19:35, Justin Israel <justin...@gmail.com> wrote: > >> Hi, >> >> Marcus wrote the Qt.py helper library just for this purpose. Have a look: >> https://github.com/mottosso/Qt.py >> >> On Tue, Nov 26, 2024, 12:19 AM Anas Elkinawy <anasel...@gmail.com> wrote: >> >>> I am trying to update my scripts that was using PySide2 and make them >>> work in maya 2025 or later >>> >>> So I thought it would be better if I change PySide Version as String >>> then import it >>> But I got the feeling that its not the neatest way !! >>> >>> If you have any Ideas to make this better without the need to install >>> any packages that maya doesn't support >>> >>> Here's My Code >>> # ===================================== >>> import importlib >>> import maya.OpenMayaUI as Omui >>> >>> maya_version = cmds.about(version=True) >>> >>> # >>> ==================================================================================== >>> # DEFINE PYSIDE VERSION >>> qt_widgets = "PySide2.QtWidgets" if int(maya_version) < 2024 else >>> "PySide6.QtWidgets" >>> qt_core = "PySide2.QtCore" if int(maya_version) < 2024 else >>> "PySide6.QtCore" >>> shibokenV = "shiboken2" if int(maya_version) < 2024 else "shiboken6" >>> # >>> ==================================================================================== >>> >>> # ====================================================== >>> # ATTEMPT TO IMPORT >>> a = importlib.import_module(qt_widgets) >>> b = importlib.import_module(qt_core) >>> c = importlib.import_module(shibokenV) >>> # ====================================================== >>> >>> # ====================================================== >>> # Getting Maya Main Window >>> maya_main_window_ptr = Omui.MQtUtil.mainWindow() >>> V = c.wrapInstance(int(maya_main_window_ptr), a.QWidget) >>> # ====================================================== >>> >>> # ============= >>> # TEST >>> x = a.QDialog() >>> x.show() >>> # ============= >>> >>> >>> >>> -- >>> 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 visit >>> https://groups.google.com/d/msgid/python_inside_maya/363c2368-4824-4200-9a54-a5776e06fa29n%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/python_inside_maya/363c2368-4824-4200-9a54-a5776e06fa29n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> 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 visit >> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0N688TYySHqqnMQU1pCBgh8M_zWf2H%3DgRvPXBFHdS8ww%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0N688TYySHqqnMQU1pCBgh8M_zWf2H%3DgRvPXBFHdS8ww%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- 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_maya+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/python_inside_maya/248cfec0-a5cb-411a-9b7b-6d05fd6aa418n%40googlegroups.com.