THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/01/2011 at 05:58, xxxxxxxx wrote:
Cinema 4D Version: 12
Platform: Windows ; Mac OSX ;
Language(s) : PYTHON ;
Is it possible to get the full output file name (including padding and extension) from a scene's render data? Currently I use the following code to get the output file name, but it only gives me the file name's prefix:
scene = documents.GetActiveDocument()
renderData = scene.GetActiveRenderData().GetData()
outputFilename = renderData.GetFilename( 5041 ) # file name ID in render settings
Also, if multi-pass is enabled, is it possible to get the multi-pass output file name as well?
On 11/01/2011 at 22:39, xxxxxxxx wrote:
i don't think it is possible.
you need to concatenate the name yourself from the different parts (path, filename, framenumber, extension)
On 13/01/2011 at 06:12, xxxxxxxx wrote:
I have the path and filename parts. I just can't figure out how to get the padding size (we can swap it out for the frame # ourselves), and the extension.
On 13/01/2011 at 10:54, xxxxxxxx wrote:
Since RenderData is basically a Container where you are able to extrude values by their ID...
You will get the extension by interpreting RDATA_FORMAT (LONG); there are constants like FILTER_TIF, FILTER_TGA, FILTER_BMP, FILTER_JPG for this value that (mostly) make pretty obvious what value will generate which suffix. (Don't know whether the constants exist in Python... this is from C++)
The padding is always 3 or 4 digits, depending on the name format. The ID under which the name format is stored is RDATA_NAMEFORMAT (LONG) with the following constants:
RDATA_NAMEFORMAT_0 -> Name0000.TIF
RDATA_NAMEFORMAT_1 -> Name0000
RDATA_NAMEFORMAT_2 -> Name.0000
RDATA_NAMEFORMAT_3 -> Name000.TIF
RDATA_NAMEFORMAT_4 -> Name000
RDATA_NAMEFORMAT_5 -> Name.000
RDATA_NAMEFORMAT_6 -> Name.0000.TIF
If Python doesn't have these constants, you can still look up the numeric values in the C++ API.