Jump to content

Sign in to follow this  
Kyle Dorosz

Running through a Frame Range

Recommended Posts

Hello,

 

I am working on a script that will pull information from individual frames in an animation. I am having a problem and narrowed it down to the FOR loop that is used to run through the frames of the animation. Can anyone help to identify why the following code will only set the current frame to the last value in the FOR loop? The goal is to run the script and get the "Frame" and "Value F" to display the same number.

 

import c4d
from c4d import gui


def main():
    fps = doc.GetFps() #get fps number
    bt=doc.GetTime()
    obj = doc.SearchObject("Cube")
    for f in range(0, 96, 24):
        doc.SetTime(c4d.BaseTime(f, fps))
        c4d.EventAdd()
        print "Object =", obj
        print "Frame = ", bt.GetFrame(fps)
        print "Value F = ", f


if __name__=='__main__':
    main()

Any help is greatly appreciated!

 

Thank you,

Kyle

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...