how to tell if animcurve is a set driven key

1,370 views
Skip to first unread message

leeG

unread,
Mar 22, 2013, 1:35:22 AM3/22/13
to maya...@googlegroups.com
I am trying to write a script to select all animation curves but exclude ones that are set driven keys.
My first guess is that a set driven key has both an input and output to the curve.

Is there another way to tell?


Thanks

Lee

matt estela

unread,
Mar 22, 2013, 3:11:50 AM3/22/13
to maya...@googlegroups.com
A million years ago I wrote a script to lock sdk's so their curves couldn't be nudged in the graph editor. Looking at the code, I used the setDrivenKeyframe command to query for curves. Maybe that's a start. 


--
You received this message because you are subscribed to the Google Groups "maya_he3d" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Roy Nieterau

unread,
Mar 22, 2013, 6:56:20 AM3/22/13
to maya...@googlegroups.com
Hey Lee,

Creating a set driven key results in a curve not driven by time but another unit. You could in theory create a set driven key from the time node to an attribute which should (didn't test this) result in a normal key (animationCurve).

In Maya you can seperate the different versions based on the nodeType.

For example, selecting all animation curves driven by time would be possible with:

import maya.cmds as mc
animCurves
= mc.ls(type=("animCurveTL","animCurveTU","animCurveTA","animCurveTT"))
if animCurves:
    mc
.select(animCurves,r=1)



And selecting all animation curves driven by another unit would be (this would result in selection driven keys):

import maya.cmds as mc
animCurves
= mc.ls(type=("animCurveUL","animCurveUU","animCurveUA","animCurveUT"))
if animCurves:
    mc
.select(animCurves,r=1)


here's some more information:
http://www.vfxoverflow.com/questions/how-can-i-select-all-the-animation-curves-in-a-scene-using-mel

Note: My example code is Python. The linked webpage shows a MEL example.

-Roy

Lee Gramling

unread,
Mar 22, 2013, 9:48:26 AM3/22/13
to maya...@googlegroups.com
Thanks Matt and Roy !

lee
Reply all
Reply to author
Forward
0 new messages