Hi all,
For Cinema R18 I created a script that automates my render settings. Setting the file path to the right location, and the file format to Open EXR 16bit Float.
As of Release R19, setting the EXR to 16bit float using python is not possible anymore, or at least that is what I'm told.
Now with the release of R20 I do really want to start using the new Cinema 4D. So I'm going to try to fix my script once again (instead of sticking to R18)
Here is the code for R18 which works fine:
import c4d
from c4d import gui
#Welcome to the world of Python
def main():
rd = doc.GetActiveRenderData()
container = rd.GetData()
# OpenEXR
container[c4d.RDATA_FORMAT] = c4d.FILTER_EXR
saveOptions = container.GetContainerInstance(c4d.RDATA_SAVEOPTIONS)
# OpenEXR options
bc = c4d.BaseContainer()
bc[0] = 3 # ZIP
bc[1] = True # clamp to half float
# save OpenEXR options
saveOptions.SetContainer(0,bc)
# save render data
rd.SetData(container)
doc.GetActiveRenderData()[c4d.RDATA_FORMATDEPTH] = c4d.RDATA_MULTIPASS_SAVEDEPTH_32
#multipass
doc.GetActiveRenderData()[c4d.RDATA_MULTIPASS_SAVEIMAGE] = True
container[c4d.RDATA_MULTIPASS_SAVEFORMAT] = c4d.FILTER_EXR
saveOptions = container.GetContainerInstance(c4d.RDATA_MULTIPASS_SAVEOPTIONS)
# OpenEXR options
bcMP = c4d.BaseContainer()
bcMP[0] = 3 # ZIP
bcMP[1] = True # clamp to half float
# save OpenEXR options
saveOptions.SetContainer(0,bcMP)
# save render data
rd.SetData(container)
doc.GetActiveRenderData()[c4d.RDATA_MULTIPASS_SAVEDEPTH] = c4d.RDATA_MULTIPASS_SAVEDEPTH_32
doc.GetActiveRenderData()[c4d.RDATA_MULTIPASS_SAVEONEFILE] = c4d.SAVEBIT_MULTILAYER = False
doc.GetActiveRenderData()[c4d.RDATA_TRUECOLORDITHERING] = False
doc.GetActiveRenderData()[c4d.RDATA_INCLUDESOUND] = False
gui.MessageDialog('outputformat set to EXR')
print 'outputformat set to EXR'
if __name__=='__main__':
main()
The main problem in R19 and R20 is not being able to control the checkbox 'Use 16 Bit Floats' (see attached screenshot).
Dragging the checkbox to the script editor gives me the following:
foo[1852142638,1835104367,1848536421,1684627827,1702065001,1869491823,1885695589,2020748901,2020634482,1949198433,1818650220,1868657664,c4d.MEDIASESSION_PROPS_NET_MAXON_MEDIASESSION_OPENEXR_EXPORT_HALFFLOAT]
I have no idea what to do with this. (my guess is that the python hook is not yet created)
Now I'm trying to create a workaround. I thought of loading my render preset from the content browser:
c4d.documents.MergeDocument(doc,'preset://user.lib4d/Render Settings/RenderSettings',1)
Alas, merging documents does not merge the render settings.
So in short my question: is it in anyway possible to set the output format to 'openEXR - 16bit Float' using python. Even if this requires an extensive workaround?
Hope someone can help me, so I can start using C4D R20.
All the best,
Bas van Bergen