THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/03/2012 at 10:39, xxxxxxxx wrote:
Hi all,
I'm trying to store all the positions by frame of an object to retry the distance traveled of this element, but I can't calculate the value at time of the position...
For more clarity here's my code:
import c4d
#Welcome to the world of Python
def main() :
fps = doc.GetFps()
frame = doc.GetTime().GetFrame(doc.GetFps())
obj = op.GetObject()
Distance = []
currentTime = doc.GetTime()
for i in range (0, frame) :
doc.SetTime(c4d.BaseTime(i,fps))
print GPos # return always the same vector (obj position in current frame)
Distance.append(GPos)
obj.Message(c4d.MSG_UPDATE)
c4d.EventAdd()
doc.SetTime(c4d.BaseTime(frame,fps)
print Distance #contains always the same vector
I know that I have to update the scene before retry the object position(may be c4d.DrawViews command), but I don't know how.
Please help me
Luther