Location of Object on path Constraint?

How would i get the location of an object on a path or, even better, how far it has travelled on the path?

thanks

ob.matrixWorld.translationPart()
or
ob.getLocation(‘worldspace’)

I just asked this same question, in a little different way yesterday.

http://blenderartists.org/forum/showthread.php?t=109841

I am more intested in getting how far along a curve an object has traveled and if the object has reached the end of an open curve.

The getLocation will give me the XYZ of an object constrained to a curve, but does not tell me if the object is before or after the endpoints of the curve.

Atom if you don’t need to know how long the curve is and can work on percentages then you could use the curves speed ipo the know how far the object is along the path.

Ideasman42 those won’t be work for what i want to do, i really need the distance travelled. Thanks anyway.

Also while i’m here could someone tell me how to rotate an object around its local z axis through python?

Thanks.

hunter551,

How can I use the speed curve to get the percentage I have traveled along a path?

Do you have an example?


ob.setEuler(x,y,z)

Here is how you can rotate an object using python code:
http://www.blender.org/documentation/242PythonDoc/Object.Object-class.html#setEuler

How do i rotate in its localspace?

Maybe this helps:
http://www.opendimension.org/blender_en/rolling_along_path.php