Hey, i had this script in the digital tutors python for maya dvd:
CODE
import maya.standalone
maya.standalone.initialize()
import maya.cmds as mc
import os
import Tkinter as tk
app = tk.Tk() # macht Fenster
def makeCube():
print "PolyCube was added."
mc.polyCube()
def saveFile():
mc.file(rename="D:/Programme/Maya Dateien/Projekte/Tutorials/scenes/cubetemp.ma")
mc.file(save=1)
print "File is saved."
print "hi"
btnCube = tk.Button(app, text="Make a Cube!", command=makeCube)
btnCube.pack() # macht Button sichtbar
btnSave= tk.Button(app, text="Save File!", command=saveFile)
btnSave.pack()
app.protocol("WM_DELETE_WINDOW", app.quit) # schliesst Fenster
app.mainloop() # loopt Fenster, sodass jede Aenderung angezeigt wird
app.destroy()
#os._exit(0) # killt das Programm, aus dem gestartet wird
but i get following error, as i press the Make Cube button.
CODE
Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:\Programme\Python 2.5.1\PyScripter\PyScripter.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
I tried to run the script in pythons IDLE, PyPE and PyScripter.
I tried to debug it and it says:
CODE
Traceback (most recent call last):
File "C:\Programme\Python 2.5.1\lib\lib-tk\Tkinter.py", line 1403, in __call__
return self.func(*args)
File "D:\Programme\Maya Dateien\Python Scripts\guitest.py", line 12, in makeCube
mc.polyCube()
AttributeError: 'module' object has no attribute 'polyCube'