Update 2: The above code is working! Excellent!
Thanks for the reply! I ran into those exact posts looking for the answer as well.
I am still struggling with how to get the proper usage out of FindOrAddOverrideParam with the c4d.DescID argument. I am basically digging for the coordinates of the property (I believe) to the SOLO layer via the take, which is what I want to perform in my script. Anyways, here's some of the code so far, it compiles but I don't think I'm passing my arguments correctly. Will report back.
doc = c4d.documents.GetActiveDocument()
root = doc.GetLayerObjectRoot()
#work with takes
take_data = doc.GetTakeData()
main_take = take_data.GetMainTake()
# Its first child which is the first "actual" take.
base_take = main_take.GetDown()
if base_take is None:
msg = "Please insert at least one base take to clone."
new_take = take_data.AddTake("", None, base_take)
new_take.SetName("Bob is your uncle.")
# lets turn some layers on while looping thru
LayersList = root.GetChildren()
for layer in LayersList:
if layer.GetName() == "Star 5":
newValue = c4d.ID_LAYER_SOLO
descId = c4d.DescID(c4d.DescLevel(c4d.ID_LAYER_SOLO, c4d.DTYPE_LONG, 0))
# this makes no sense in a loop of the layers.
# regardless I want to use this function to
# turn on the layer solo "parameter" so it becomes
# applied to my take
overrideNode = new_take.FindOrAddOverrideParam(take_data, layer, descId, newValue)
I can use the takesystem module to interact with take data and create new takes. My next step is to insert a Layer into the Take Category via code. Does anyone know the calls to add a Category to a Take?
I am interested in generating new takes within an existing project using the python API / SDK. I am at a loss for which library / calls to make to accomplish this. If anyone can point me to an example script that works with the same library that you can use to trigger auto takes, please share. Thank you very much in advance.
Edit: I notice in the script log that "New Take" and "Auto Take" record.
#Welcome to the world of Python
c4d.CallCommand(300000116) # Script Log...
c4d.CallCommand(431000056) # New Take
c4d.CallCommand(431000081) # Auto Take
So conceivably I can use this (not terribly excited about it, again new). But then I would be interested in the Layers within that auto generated Take of which the script log does not record (specifically am interested in toggling the "Solo" button via code in the Layers section within the newly created Take). This does not record so I was hoping there was a call to interact with that section.