I'm very new to C4D python and am having trouble doing the simplest thing. Eventually I want to create a script that controls quite a few things related to Takes. However, my first baby step is simply to create a new Take and add it to the list.
My first attempt seems to work but when I right-click my new take I cannot delete it and certain behaviours crash C4D! Can someone tell me what I am doing wrong, as I've copied most of this script from a Cineversity script that seems to behave just fine.
def main(): td = doc.GetTakeData() pt = td.GetMainTake() ct = td.SetCurrentTake(pt) nt = td.AddTake("",pt,pt) td.InsertTake(nt,pt,2) td.SetCurrentTake(nt) nt.SetName("My Take") c4d.EventAdd()
Any help is much appreciated.