Hi @bentraje,
The thread about baking curves is still the right way to go if you want to be exact and want to bake other properties than PSR.
However, if you're just interested in baking only your PSR, you can use doc.Record()
, this works on all selected Objects since R19. You can take a look at the following example for baking Cubes with a Vibrate-Tag for example...:
import c4d
#https://developers.maxon.net/docs/py/2023_2/modules/c4d.documents/BaseDocument/index.html?highlight=executepasses#BaseDocument.ExecutePasses
def SetCurrentTime(currentTime, doc):
doc.SetTime(currentTime)
doc.ExecutePasses(None, True, True, False, 0)
def main():
minTime = doc[c4d.DOCUMENT_MINTIME]
maxTime = doc[c4d.DOCUMENT_MAXTIME]
fps = doc.GetFps()
if minTime != maxTime:
currentTime = minTime
while (currentTime <= maxTime):
SetCurrentTime(currentTime, doc)
print "Baking: Frame: %s" %(currentTime.GetFrame(fps))
#New since version R19.
#Records the active objects in the document.
doc.Record()
currentTime += c4d.BaseTime(1, fps)
if __name__=='__main__':
main()
Oh, and accessing the "Bake Objects..." Dialog via Python is not possible!