help please with this error.

34 views
Skip to first unread message

jettam

unread,
Oct 14, 2017, 1:40:11 AM10/14/17
to Python Programming for Autodesk Maya

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)

Simon Anderson

unread,
Oct 14, 2017, 1:43:34 AM10/14/17
to Python Programming for Autodesk Maya
looks like your Long is meant to be long
Reply all
Reply to author
Forward
0 new messages