THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/10/2010 at 02:01, xxxxxxxx wrote:
Hi whalerider,
at the bottom of the BaseDocument page in the Python (C4DSDK) documentation there is a piece of code which does what you need. The code contains some comments so I hope this helps.
import c4d
from c4d import documents
def BrowseDoc(doc) :
""" Pass the document you want to run the time through"""
ctime = doc.GetTime() #save current time
fps = doc.GetFps()
#go over frame range in the document
start = doc.GetMinTime().GetFrame(fps) #set min time
until = doc.GetMaxTime().GetFrame(fps) #set max time
for f in xrange(start, until+1) :
c4d.StatusSetBar(100*(f-start)/(until-start))
doc.SetTime(c4d.BaseTime(f, fps))
c4d.DrawViews(c4d.DRAWFLAGS_ONLY_ACTIVE_VIEW|c4d.DRAWFLAGS_NO_THREAD|c4d.DRAWFLAGS_NO_REDUCTION|c4d.DRAWFLAGS_STATICBREAK)
# here you can read out the position
c4d.GeSyncMessage(c4d.EVMSG_TIMECHANGED) #update timeline
doc.SetTime(ctime) #set time back
c4d.EventAdd(c4d.EVENT_ANIMATE)
c4d.StatusClear()
Cheers, Sebastian