Check if your extension module was built and linked against a different version of Python. In order to use PySide with Python in 3ds Max, you must compile the CPython binaries against Python version 2.7.3. See Building PySide and Python extension libraries for more information.
Update the registry or manually install the module. Often modules support installation via manual steps or a Python module (for example, the Python "easy_install" module (http://pythonhosted.org/distribute/easy_install.html). See also Python extension libraries for more information.
In Python, if you misspell a property when assigning it, a new field is added to the object as a result - for example: MyClass.fOotball = x, or worse yet: MyClass.GetValue = 42. It is legal to add or replace fields on an object at run-time; therefore no error occurs. The safest way to set a property is to use a Set function, for example: render.SetWidth(640).
When you run any Python code that affects the global environment (for example, importing a module), those settings persist during your session of 3ds Max. A common mistake is to rely on a module that was imported by another script, or to call a function that was created by another script.
Use the reload(MyLibraryModule) command to force Python to reload that module.
try: import sys print ‘goodbye world’ sys.exit() # Safe way to leave program at any point and allow objects and resources to be cleaned up. # Prevent 3ds Max from reporting a system exit as an error in the listener. except SystemExit: pass
app = QtGui.QApplication.instance() if not app: app = QtGui.QApplication([])
You can optionally call the following when your UI control loses focus as well:
There are several areas of 3ds Max that calls enableAccelerators. For more information, see the MAXScript Documentation.