ECToo / pymel

Automatically exported from code.google.com/p/pymel
0 stars 0 forks source link

getPlugValue throws an exception on some plugs. #278

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

When trying to get the rotateX value for an object, datatypes.getPlugValue 
throws the error below:

#   File "C:\Program 
Files\Autodesk\Maya2012\Python\lib\site-packages\pymel\core\datatypes.py", line 
2763, in getPlugValue
#     return Angle( getattr(val, AS_UNITS), unit )
#   File "C:\Program 
Files\Autodesk\Maya2012\Python\lib\site-packages\pymel\core\datatypes.py", line 
2507, in __new__
#     newobj = float.__new__(cls, value)
# TypeError: float() argument must be a string or a number # 

It looks like the following line in datatypes.py:
    return Angle( getattr(val, AS_UNITS), unit )

should read:
    return Angle( getattr(val, AS_UNITS)( unit ), unit )

This is occurring in Maya 2011 and 2012, Windows x64. 

Original issue reported on code.google.com by martin.c...@gmail.com on 1 Aug 2012 at 6:12