Managing render settings and getting list of expected output files.
-
Hi everyone,
Consider me a newbie, so these might be stupid beginner questions but I'm hoping all of you can point me into the right direction. My Cinema4D knowledge is rather limited but I'm looking to get more knowledge on how to manage render settings from Cinema4D with Python.
I need to query each file that would be written out if a render completes. E.g. each render pass, render take, camera, etc. that would get written out to a separate file on disk, including knowing their colorspace. In my case, knowing what a render on Deadline would spit out at the end.
I assume that'd essentially be just all 'enabled' takes and the output filenames specified with the tokens. Does Cinema4D provide any good API to get access to this? How renderer-specific are those save filepaths? e.g. does the same logic share between Redshift and other renderers, or would it quickly become e.g. renderer specific?For example I think I can do:
import c4d import redshift doc = c4d.documents.GetActiveDocument() renderdata = doc.GetActiveRenderData() # Get the Redshift videoPost and render settings vprs = redshift.FindAddVideoPost(renderdata, redshift.VPrsrenderer) existing_aovs = redshift.RendererGetAOVs(vpRS)
But I'd essentially be writing logic that seems related to Redshift alone, and I'd need to then write similar code for each renderer down the line. E.g. each redshift AOV can have color processing enabled/disabled on its own in Redshift. So getting the colorspace of the AOV images for example would easily get very specific to Redshift too? Any ideas?
Just to compare, the USD API for example has "Render Products" with "Render Vars" logic that is all shared between each renderer, and thus from the USD data alone I can detect all the output files that would be written. Preferably I can get to similar single API from a C4D scene alone.
What I need:
- I need to know the expected output files that would be rendered from the current scene. What's the best way to get that?
- How do I query the takes that would be rendered?
- Preferably I can also set the render output filepath in a managed way in the pipeline too.
- Get the output colorspace of each image.
Preferably all of this, without actually needing render things - so I can validate certain outputs in advance, etc.
Just adding these links for my own future reference:
-
Hi @BigRoy,
Please check our Support Procedures in regards of the question structure, namely:
Singular Question: The initial posting of a support topic must contain a singular question. Do not ask ten things at once, that makes it extremely hard to answer topics. Break up your questions into multiple topics. Asking follow-up questions is allowed but they must be bound to the initial subject.
Singular Subject: From all this follows that a topic must have a singular and sparse subject tied to a specific problem. 'My Nodes API Questions' is not a valid topic as it splits up into too many subtopics. A valid subject could be 'accessing node attributes' or 'traversing a node graph'. One could for example first ask 'how to get the name attribute of a node?' and then ask a follow up question about 'how to get the icon attribute too?'. This specifically applies to plugins, just because you have two problems with one plugin does not mean that they should be asked in the same topic.
Regarding you question, there's no high level API that allows you to get a list of all files you've mentioned at once. This effectively means that not only do you need to access this yourself, but you also need to do so for the render engines you'd like to support, as these are likely going to differ among them.
Specifically for the Redshift AOVs and output files question, please check related threads:
- get the names of redshift multi passes AOV names from the render settings
- Add Expression Value in Render Settings Save Path
As for the takes, the only application where they make any sense is the Render Queue. If you're not using it, it's only the active take that's being rendered. Of course you can deal with it by using SetCurrentTake function.
I suggest you keeping this thread for the "render output files" part of your initial question and encourage you to make separate postings for your other questions that diverse from this topic here.
Cheers,
Ilia