finding channel value at certain frame

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/10/2010 at 16:57, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   12 
Platform:      
Language(s) :       PYTHON  ;

---------
Is it possible to go over a frame range and find a channel's value (e.g. position.X's value) at each frame?

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

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 02/10/2010 at 02:55, xxxxxxxx wrote:

Thanks, Sebantian.
I had missed the code at the bottom.
I had figured out the fps/start/until code, but for the rest I needed help.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 23/10/2010 at 14:35, xxxxxxxx wrote:

Just a quick comment:

for f in xrange(start, until) :

should be

for f in xrange(start, until+1) :

otherwise the last frame will be skipped.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 23/10/2010 at 16:26, xxxxxxxx wrote:

Thx! I fixed this in the code snippet.