I am learning how to load a UI with pyside_dynamic. The problem is the 
tutorials where written for earlier version of Maya. (I am using maya2017)

Here is the code I have been instructed to write. The error is this:    "No 
module named PySide.QtCore"  What should I write instead ? 
I read a blog that said "Maya 2017 
<http://www.autodesk.com/products/maya/overview> was released today and 
with it comes a big change; PySide (and PyQt4) no longer works with Maya."

# Error: No module named PySide.QtCore
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File "E:\ProfessionalDevelopment\python\Introduction to Python 
Scripting in Maya\cgcircuitPython\wk6\geomGenerator_pysideDynamic.py", line 
6, in <module>
#     import pyside_dynamic2
#   File "C:/Users/justin/Documents/maya/2017/scripts\pyside_dynamic2.py", 
line 42, in <module>
#     from PySide.QtCore import Slot, QMetaObject
# ImportError: No module named PySide.QtCore # 


import os
from PySide2 import QtWidgets, QtCore, QtUiTools, QtGui
from shiboken2 import wrapInstance

import pyside_dynamic2

import maya.cmds as mc
import maya.OpenMayaUI as omui

def getMayaWindow():
    ''' pointer to the maya main window '''
    ptr = omui.MQtUtil.mainWindow()
    if ptr:
        return wrapInstance(long(ptr), QtWidgets.QMainWindow)

def run():
    ''' builds our UI '''
    global win
    win = GeometryGenerator(parent=getMayaWindow())
    win.show()

uiFilePath = os.path.join( os.path.dirname(__file__) , 
'geomGenerator_v001.ui')
    
class GeometryGenerator(QtWidgets.QDialog):
    
    def __init__(self,parent=None):
        super(GeometryGenerator,self).__init__(parent)
        self.ui = pyside_dynamic2.loadUi(uiFilePath,self)

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/85eaa7d7-23a5-46df-9fd6-c4007e34eeec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to