Ah the fun of animLayers!!!!

Take a look in the Red9 API, I did a load of wrapping to get round this
issue in the Red9_CoreUtils.FilterNode class. Basically the easiest way to
get the data back is not going through the animLayers commands as they're
basically all Gash, instead go through the history..

<goog_1186596312>
https://github.com/markj3d/Red9_StudioPack/blob/master/core/Red9_CoreUtils.py
around line 900

*animCurves = [curve for curve in cmds.listHistory(nodes, pdo=True,
lf=False, lv=treeDepth) if cmds.nodeType(curve, i=True)[0] == 'animCurve']*

In the main filter code I change the treeDepth depending on if animLayers
are present or not, I also do some post processing on the return to
determine if the connected curve is ''safe'' to edit, ie not part of
setDriven network or clip inputs etc

hope that helps

Mark

On 24 March 2016 at 05:42, damon shelton <[email protected]> wrote:

> I would suggest looking into using the listHistory command to get back the
> history nodes of type anim curve
>
>
> On Wednesday, March 23, 2016, Lidia Martinez <[email protected]>
> wrote:
>
>> Hi all!,
>>
>> animLayers python command is pretty bad in general. Docs are wrong, for
>> most of the params. I sent suggestions to Autodesk. They normally fix it...
>> but it's annoying.
>>
>>
>> I want to find the animation curves for an node. If it happens to be
>> inside an anim layer... the party starts:
>>
>>
>>
>> The problem is I only have these options:
>>
>> A) mc.animLayer( layer, animCurves=True, q=1)
>> B) mc.animLayer( [object], affectedLayers=True, q=1)
>> C) mc.animLayer( layer, blendNodes=True, q=1)
>>
>> A)  Returns ALL THE ANIM CURVES for ALL CHANNELS for ALL OBJECTS in the
>> scene.  (????  insane).  They can be thousands of strings.
>>
>> B)  It returns which layers the object is in.
>> NOTE: the docs don't tell you about that list... weird.
>>
>> C)  Gets the blending nodes FOR ALL CHANNELS for ALL OBJECTS in that
>> layer. These ones connect the animations and the original node. They can be
>> hundreds.
>>
>> So that's all I have...
>>
>> Crazy stuff. I get a list of 5000 strings. And we all know how fast
>> strings are. And considering how python manages memory in terms of growing
>> lists and then deleting the contents...
>>
>> And I have to do that... for every object I have.
>>
>>
>>
>>
>> I'll end up using my stupid algorithm that travels through the blend
>> nodes to find the animations... which is obviously buggy, too, and has
>> special cases everywhere.
>>
>>
>>
>>
>> Any ideas?
>>
>> --
>> Lidia
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8yTd7L-fxAUmMoOGUcYBzVBpTZxo%2B1FX0LeLM%3DXtte_7g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8yTd7L-fxAUmMoOGUcYBzVBpTZxo%2B1FX0LeLM%3DXtte_7g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAM9RXoLjRDcvObEXVqLiOYOCPmmid9o6W1AWsv%3DpQeyAJCyV0w%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAM9RXoLjRDcvObEXVqLiOYOCPmmid9o6W1AWsv%3DpQeyAJCyV0w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-------------------------------------
Mark Jackson
CEO / Technical Director
red9consultancy.com

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAGQH2FGXR6eV%2B4J8g144JDywu1GqVkhr_1y1Pd6CNEhzwysY7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to