code-google-com / pymel

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

Error calling AnimCurveTA addKeys method #287

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Thanks for the great tool first of all!

When calling the "addKeys" method on a AnimCurveTA object I get an error. Here 
is the relevant stack trace:

# Error: 'module' object has no attribute 'apiClassInfo'
# Traceback (most recent call last):
#   File "<maya console>", line 2, in <module>
#   File "C:\Users\Dan\Projects\Dogs\scripts\motion_builder.py", line 85, in 
<module>
#     copy_keys(dance_curves, curr_ani, i)
#   File "C:\Users\Dan\Projects\Dogs\scripts\motion_builder.py", line 76, in 
copy_keys
#     if src_value: dst_curve.addKeys([src_time], [src_value])
#   File "c:\program 
files\autodesk\maya2010\python\lib\site-packages\pymel-1.0.0-py2.6.egg\pymel\cor
e\nodetypes.py", line 3006, in addKeys
#     
_api.apiClassInfo['MFnAnimCurve']['enums']['TangentType']['values'].getIndex('kT
angent'+tangentInType.capitalize()),
# AttributeError: 'module' object has no attribute 'apiClassInfo' # 

I'm using Maya 2010 64 bit on windows 7
I'm using pymel 1.0.3

It appears to be the same error as linked below. But without the initial syntax 
error.

https://groups.google.com/forum/#!msg/python_inside_maya/J5b_dJbtxbc/qJZkfuFSsJI
J

That thread suggested updating to the newest version on Github, but after doing 
that I was getting some other errors and I am unsure how stable it is. Perhaps 
if there was an individual commit which fixed the issue I could make the change 
manually on my side.

Thanks again,

Dan

Original issue reported on code.google.com by theonlyd...@hotmail.com on 16 Oct 2012 at 1:05

GoogleCodeExporter commented 9 years ago
Changing the appropriate line to:

########################

        return self.__apimfn__().addKeys( times, keys,
                                          _factories.apiClassInfo['MFnAnimCurve']['enums']['TangentType']['values'].getIndex('kTangent'+tangentInType.capitalize()),
                                          _factories.apiClassInfo['MFnAnimCurve']['enums']['TangentType']['values'].getIndex('kTangent'+tangentOutType.capitalize()))

########################

(See '_api' -> '_factories')

appeared to fix the issue. This reflects what is in the current github repo.

Original comment by theonlyd...@hotmail.com on 16 Oct 2012 at 3:56

GoogleCodeExporter commented 9 years ago
Yep, that's the appropriate fix for that.  Also - i just pushed a bunch of new 
stuff to github... unfortunately, it's not compatible with 2010 yet.

Original comment by elron...@gmail.com on 17 Oct 2012 at 1:58