Hi Guys,
I need to be able to stop the timeline running, once a condition has been satisfied, within a python effector. I know that i need to use the following:
c4d.documents.RunAnimation(doc, stop[, forward])
What I don't know, is how to implement this. That being so, I am hoping that someone has used it and can offer some advice.
Thanks in advance, as always, for any help offered.
EM.
*** Update ***
Managed to sort this part out, by simply creating a variable:
stop_animation = c4d.documents.RunAnimation(doc, True)
The thing I now need to do is reset the timeline to zero. I thought this may be achievable using the following:
min_time = doc.GetMinTime().GetFrame(doc.GetFps())
start = doc.SetMinTime(min_time)
Unfortunately, this doesn't work. If anyone has any information, I'd be grateful for it. I'll carry on looking at this and update again, if I manage to find a solution.
*** Update 2 ***
Cracked it!
The following two lines of code did the job:
start = doc.GetMinTime().GetFrame(doc.GetFps()) - same as before, so this was correct.
doc.SetTime(c4d.BaseTime(start)) - key piece of code, executed at the correct time.