Getting values from channels on Anim Layers using OpenMaya

First, and foremost, give us a script that reproduces the error without any setup on our part. We should be able to copy/paste the script into the editor, run it, and see the error starting from either a file you provide, or an empty scene.

Then make sure to include your whole script. You’re missing all the imports.

And debug your script first.
In line 51, MTime doesn’t take a string as an input.
Then curves variable is a list of lists. I’m guessing at line 47 you meant to use curves.extend(node_curves)? If not, your list comprehension starting at line 53 is wrong.

Or even better, don’t include that extra stuff in your script, it just gets in the way of your question. In your file setup function, you could create exactly 1 object with animation on a layer (meaning no for loop at line 9) with animation only on the X rotation (no for loop on line 15). Then everything after line 43 can just go away.

Now, my actual guess at what is wrong:
At line 24 you get the input connections to the node, however when there are animation layers, those input connections aren’t animation curve nodes, those are AnimLayer nodes.

2 Likes