I'm a little confused by your question. Do you just want to know how fast a
camera is moving? What would be your unit of measurement, units per frame?
If that's the case you can do it in a few lines with MVector. Please
clarify your question and I can try to help.
Kyle
On Friday, April 21, 2017 at 4:47:13 PM UTC-4, Dag XoTtaB wrote:
>
> 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/3c818dc9-9125-4aa8-bdcf-1d92bb0773a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.