Here are the scripts (original and modified), as well as the c4d file if that is helpful
https://www.dropbox.com/sh/vwnkj9x08b9dg0k/AACWhSoQV4rYo3ECMkNIZ2Kda?dl=0
Here are the scripts (original and modified), as well as the c4d file if that is helpful
https://www.dropbox.com/sh/vwnkj9x08b9dg0k/AACWhSoQV4rYo3ECMkNIZ2Kda?dl=0
Thank you, by adding the "import c4d" at the beginning of the script and "c4d." in front of the lines below, that solved the issues with the
StopAllThreads()
CallCommand(12410) # record
However, now line 16 says:
line 16, in <module>
c4d.SetFrame(user_start_time) # Set the current frame of the time slider
AttributeError: module 'c4d' has no attribute 'SetFrame'
When I try that, I get an error that says "NameError: name 'c4d' is not defined"
Hey all, I found this post from 11+ years ago by a user named
"bandini" that has a bit of code to bake animations. I am trying to update the code so that it works with the current version of C4D. Any help would be appreciated! Thanks!
https://forums.cgsociety.org/t/holy-grail-bake-mograph-objects-to-keyframes/1296975/10
This is what I've converted so far but I am receiving an error on line 11 that says:
in <module>
while current_frame <= user_end_time:
NameError: name 'StopAllThreads' is not defined
Here is the "updated" script that is giving me the error
user_start_time = 0
user_end_time = 90
fps = doc.GetFps()
bake_start_time = doc.GetTime() # needed to initialize a BaseTime object
doc.SetTime(bake_start_time) # set the time slider to the user's start time
current_frame = doc.GetTime().GetFrame(fps)
while current_frame <= user_end_time:
StopAllThreads()
CallCommand(12410) # record
user_start_time += 1
doc.SetFrame(user_start_time) # Set the current frame of the time slider
redraw = DrawViews(DA_STATICBREAK)
EventAdd(EVENT_ANIMATE)
if redraw:
current_frame = doc.GetTime().GetFrame(fps)