Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    finding channel value at certain frame

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 438 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post