This code does create an 'Enabled' curve and adds a key, but it does not add the correct amount (I want '1' -Enabled), and the key is strange because it isn't showing up as red, or actually keyframed, but the key is showing in the timeline. The "keyy.SetValue(crv,1)" line doesn't seem to be working.
Since this is R12 I don't have the following classes to use: FindCTrack, FillKey, or SetGeData among others. Anyone have an idea?
Note: This is a similar post to one that I posted a few weeks ago with some great feedback, but I still haven't gotten it to work yet.
import c4d, math
from c4d import gui
#Welcome to the world of Python
myDoc = c4d.documents.GetActiveDocument()
Selected = doc.GetActiveObjects(0)
fps = myDoc.GetFps()
for ListOb in Selected:
visE = c4d.CTrack(ListOb, c4d.DescID(c4d.ID_BASEOBJECT_GENERATOR_FLAG))
#ListOb[c4d.ID_BASEOBJECT_GENERATOR_FLAG] = 1
t = doc.GetTime().Get()
crv = visE.GetCurve()
keyy = crv.AddKey(c4d.BaseTime(t))['key']
gui.MessageDialog('You must select an Object first!')