hi,
I could reproduce the issue on R20 for 1380 takes.With the release S26, the number is a bit higher, but it still crashes. I've opened a bug report for that.
One workaround would be to create takes that will act as group, i was able to go over that ceiling. The time get higher and higher for creating those takes. I stopped at 10 groups of 1000 takes.
from typing import Optional
import c4d
def main():
# create a sphere and insert it in the document.
sphere = c4d.BaseObject(c4d.Osphere)
doc.InsertObject(sphere, None, None)
c4d.EventAdd()
if not sphere.CheckType(c4d.Osphere):
raise TypeError("The objects is not a sphere.")
# Stores a copy of this object to use later in the autotake as initial state comparison
undoObject = sphere.GetClone(c4d.COPYFLAGS_0)
# Changes the radius of the sphere in scene
originalSize = 100
sphere[c4d.PRIM_SPHERE_RAD] = originalSize - 1
takeData = doc.GetTakeData()
if takeData is None:
raise RuntimeError("Failed to retrieve the take data.")
# Checks if there is some TakeData and the current mode is set to auto Take
if takeData and takeData.GetTakeMode() == c4d.TAKE_MODE_AUTO:
# Add a new group take
for i in range(0, 4):
# Adds a new Take that will group other takes
groupTake = takeData.AddTake("this is a new take {}".format(i), None, None)
for j in range(0, 1000):
newTake = takeData.AddTake("this is a new take {}".format(j), groupTake, None)
sphere[c4d.PRIM_SPHERE_RAD] = originalSize + j
if newTake is None:
raise RuntimeError("Failed to add a new take.")
newTake.AutoTake(takeData, sphere, undoObject)
sphere[c4d.PRIM_SPHERE_RAD] = originalSize
# Pushes an update event to Cinema 4D
c4d.EventAdd()
if __name__ == '__main__':
main()
cheers,
Manuel