After some depth search I found the way to keyframe the stage object, down is the code snippet if somone needs something similar. The samples parameter is simply a list of dict values to reference the camera name and his inpoint:
def setKeysFromCameraSamples(samples):
# DESCRIPTION:
# Set the keyframes from the samples object to the stage object
if samples is None or len(samples) is 0:
return False
stageList = doc.GetActiveObjectsFilter(True, c4d.NOTOK, 5136) # Find selcted stage objects
if len(stageList) is 0: # Check if there are stage objects selected
c4d.gui.MessageDialog('Select a stage object') # If not, return
return False
elif len(stageList) > 1: # Check if there are more than one object selected
c4d.gui.MessageDialog('Select only one stage object') # If there are, return
return False
stage = stageList[0] # Select the first scene object
dCamera = c4d.DescID(c4d.STAGEOBJECT_CLINK) # Reference to a cameraLink property
cameraTrack = stage.FindCTrack(dCamera) # Reference the camera link track
if not cameraTrack: # If there is no camera track, create it
cameraTrack = c4d.CTrack(stage, c4d.STAGEOBJECT_CLINK) # Create a track
stage.InsertTrackSorted(cameraTrack) # Insert the track
fps = doc.GetFps() # Get the document framerate
curve = cameraTrack.GetCurve() # Reference the track curve
for curSample in samples: # Iterate through sample list
frame = curSample['INPOINT'] # Get the inpoint of the sample
cameraName = curSample['CAMERA'] # Get the sample camera
curCamera = doc.SearchObject(cameraName) # Find that camera in the project
frameTime = c4d.BaseTime(frame, fps) # Parse the key frame to c4d time
keyDict = curve.AddKey(frameTime) # Add a new key to the curve
keyDict['key'].SetGeData(curve, camera) # Link the current camera to the key
c4d.eventAdd() # Refresh
Return True