In Python 2.6 and higher, the reserved word 'as' has been added to the Python language.This now conflicts with the method 'as' in the class MTime, for a workaround use the method asUnits instead.
You will need to make changes in these scripted devkit samples that we ship with the install.
C:\Program Files\Autodesk\Maya2010\devkit\plug-ins\scripted\animCubeNode.py(62):
frame = int(tempTime.as(OpenMaya.MTime.kFilm))
becomes
frame = int(tempTime.asUnits(OpenMaya.MTime.kFilm))
C:\Program Files\Autodesk\Maya2010\devkit\plug-ins\scripted\simpleEmitter.py(301):
dtRateDbl = dtRate.as( OpenMaya.MTime.kSeconds )
becomes
dtRateDbl = dtRate.asUnits( OpenMaya.MTime.kSeconds )
C:\Program Files\Autodesk\Maya2010\devkit\plug-ins\scripted\simpleEmitter.py(320):
dt = dT.as( OpenMaya.MTime.kSeconds )
becomes
dt = dT.asUnits( OpenMaya.MTime.kSeconds )
The confusing part is when you try to load these devkit examples without making the above changes, they won't load but with no descriptive error, unless you comment everything out below the line in question in that given function, if you do that then when you try to load the plug-in it will tell you there is a syntax error with the 'as' method.
This does not affect the C++ API.
~Kristine
Recent Comments