Changing camera/take/render setting in the render queue
beezle last edited by
I'm trying to write a script for batch rendering. I've seen a few scripts floating around that do this, but these are for adding a separate file for every render.
Our pipeline is a bit different. We have many cameras in a single environment c4d file, each of which we need a single PSD octane render for. I can queue up the renders from the file using AddFile just fine, but they all populate with the same settings, rendering the same camera. I don't know how to access that new item in the queue so I can then change everything with the script that I can do manually through the dropdowns: the Camera most importantly, but also the Take and Render Settings if need be.
Is there any way to do this?
m_adam last edited by
Hi @beezle unfortunately I'm afraid the API doesn't contain methods to update the Camera/Take/Render setting as you could do within the UI.
So the only way is to load the document, edit the doc, save it, and load it.
This was explained in How to adjust output path in Python Batchrender class?
beezle last edited by beezle
@m_adam Thanks. I gave that a shot, but unfortunately, it's still adding multiple copies of the same camera. Am I doing something wrong?
docs = c4d.documents doc = docs.GetActiveDocument() cams = getSelectedCameras(doc.GetActiveObjects(0)) path = doc.GetDocumentPath() cFile = path + '\\' + fName queue = docs.GetBatchRender() queue.Open() base = doc.GetActiveBaseDraw() for cam in cams: docs.LoadDocument(cFile, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS) base.SetSceneCamera(cam) docs.SaveDocument(doc, cFile, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT) queue.AddFile(cFile, queue.GetElementCount())