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)