SOLVED RDATA_PATH not working with Render Settings

Hello,
I'm trying to set the RDATA_PATH of the active RenderData, but it's not working. It prints the correct path and sets all of the other data, but it doesn't set the File... path in the Render Settings dialog. Am I missing anything? Thank you!

import c4d,os
from c4d import storage

def main(doc):
    activeRenderData = doc.GetActiveRenderData()
    rd = activeRenderData.GetData()
    rd[c4d.RDATA_XRES] = 2048
    rd[c4d.RDATA_YRES] = 1080
    rd[c4d.RDATA_FORMAT] = c4d.FILTER_MOVIE
    rd[c4d.RDATA_LOCKRATIO] = True
    docName = doc.GetDocumentName()
    fileName, ext = os.path.splitext(docName)
    fileName = "%s.mp4"%fileName
    fileName = os.path.join(storage.GeGetC4DPath(c4d.C4D_PATH_DESKTOP),fileName)
    rd[c4d.RDATA_PATH] = fileName
    print(rd[c4d.RDATA_PATH])
    doc.GetActiveRenderData().SetData(rd)
    c4d.EventAdd()

if __name__=='__main__':
    main(doc)

802d4e95-1fdb-410b-bbb6-85dce273c2e8-image.png

I found success using the BaseContainer.SetFilename method instead of using the = assignment operator.

rd.SetFilename(c4d.RDATA_PATH, str(fileName))

Hi @blastframe as demonstrated in tokensystem_render_r17.py you should always operate on the BaseContainer.

Cheers,
Maxime.