Hi all. I need to get trajectory of camera that is displayed in the Graph 
Editor.  The trajectory is created using "curve" and "attack to motion path".  
I found this script but it only works for animations and shows dependence on 
the frame but not on time. For camera is unfortunately not working.  
Ultimately I need to speed cameras, tell me how can this best be done?

/*************CODE************************/
import maya.cmds as cmds

def getAnimationData():
    objs = cmds.ls(selection=True)
    obj = objs[0]
    print obj

    animAttributes = cmds.listAnimatable(obj);

    for attribute in animAttributes:

        numKeyframes = cmds.keyframe(attribute, query=True, 
        keyframeCount=True)

        if (numKeyframes > 0):
            print("---------------------------")
            print("Found ", numKeyframes, " keyframes on ", 
            attribute)

            times = cmds.keyframe(attribute, query=True, 
            index=(0,numKeyframes), timeChange=True)
            values = cmds.keyframe(attribute, query=True, 
            index=(0,numKeyframes), valueChange=True)

            print('frame#, time, value')
            for i in range(0, numKeyframes):
                print(i, times[i], values[i])

            print("---------------------------")

getAnimationData()

-- 
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/1007b86f-f633-4204-89b0-eb9fff26ccc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to