Hello Nuke Python enthusiasts. I am trying to make a python list of
every keyframe for any given selected node (based on the first
animation curve the python code finds). The code below works for every
kind of keyframe except the Bezier node's "shape" knob and the
RotoPaint node's "key" knob. I guess it's because those knobs don't
have "animations()" in the simple numeric sense? So is there any way
to get a list of Bezier or Roto keyframes (without having to resort to
looping through each frame)?



#this code works on a transform node's translate knob keyframes but
not on a Bezier's shape knob keyframes :(
theSelectedNode = nuke.selectedNode()
theListOfFrames = []
for aKnob in theSelectedNode.knobs():
   if theSelectedNode[aKnob].isAnimated():
           anAnimationCurve = theSelectedNode[aKnob].animations()[0]
for i in range(len(anAnimationCurve.keys())):
    theListOfFrames.append(anAnimationCurve.keys()[i].x)

Pete
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to