I’m trying to write a Python script that uses namedtuple(), this should be available in Maya 2015? PyMel even has it under utils. Yet when I try to import it, my IDE(JetBrains PyCharm) claims it’s never used, with or without the IDE says namedtuple is an unresolved reference. When I run the script within Maya 2015 I get the following error:
Error: NameError: file <maya console> line 149: name ‘namedtuple’ is not defined
The specific line of code is:
Quaternion = namedtuple(‘Quaternion’, ‘w x y z’)
All other imports and code seems to be fine, so I’m a bit confused what’s going on here.
Cheers for that, new to Python, saw those docs and the example code didn’t have an import statement for it, then I came across the PyMel one and confusion ensued
if you are new to python, you should spend some time familiarizing yourself with the various built-in modules that come with python. By default, you import what you need.
[QUOTE=rgkovach123;27050]if you are new to python, you should spend some time familiarizing yourself with the various built-in modules that come with python. By default, you import what you need.[/QUOTE]
Yes I have with json and io.open. Just been quite a bit of info when switching from melscript, pymel, openmaya, api v1 & v2, another possible python option?, pyside/pyqt, 2.x 3.x, etc. Is there a reason Maya has switched to using pyside over pyqt?