looks like your Long is meant to be long Take a look at the Qt example here, it is quiet helpful.
http://help.autodesk.com/view/MAYAUL/2017/ENU/?guid=__files_GUID_66ADA1FF_3E0F_469C_84C7_74CEB36D42EC_htm On Saturday, 14 October 2017 16:40:11 UTC+11, jettam wrote: > > > I am using maya2017. I am trying to get a blank GUI up, but I get this > error. help on this would be much appreciated. > > > # Error: global name 'Long' is not defined > # 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.py", line 12, in > getMayaWindow > # return wrapInstance(Long(ptr), QtGui.QMainWindow) > # NameError: global name 'Long' is not defined # > > > > from PySide2 import QtWidgets, QtCore, QtUiTools, QtGui > from shiboken2 import wrapInstance > 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), QtGui.QMainWindow) > > def run(): > ''' builds our UI ''' > global win > win = GeometryGenerator(parent=getMayaWindow()) > win.show() > > class GeometryGenerator(QtWidgets.QDialog): > > def __init__(self,parent=None): > super(GeometryGenerator,self).__init__(parent) > > -- 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/d8c05670-523f-4e39-ac4b-653a4f42b463%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
