SOLVED Limit On the Number Of Takes

Hi.

I am running into an issue when creating a large number of takes where Cinema is crashing on me, and this problem seems unrelated to the actual creation of the takes.

Using my code I try to create a large number of takes, around 1400, with parameters overridden for objects in the scene, at some point during the creation process Cinema will crash. I recreated the case inside of CInema without my code by creating a take with one overridden object and then copy and pasting it, when I get to around 1400 takes in the document Cinema crashes on me.

Is this just a limitation of Cinema when it comes to takes and that it can't handle that many inside of one document? Having multiple documents with a thousand takes in them open at the same time does not cause Cinema to crash.

Any help would be greatly appreciated.

John Terenece

Just to clarify, I know that adding more objects and such to a document in Cinema will make it use up more memory and cause it to lag when it gets bad enough. My issue is that Cinema is running fine with a certain number of takes and then I add one more and it immediately crashes.

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

@m_magalhaes

Thanks for the response.

Might be able to use your idea as potential solution.

John Terenece