Jump to content


Regular Member
  • Content Count

  • Joined

  • Last visited

Everything posted by basvanbergen

  1. Wow! Thanks a lot Graphos! In this thread they refer to: https://github.com/PluginCafe/cinema4d_py_sdk/blob/master/scripts/release20/imagesettingsdictionary.py This is exactly the part I was looking for, this literally does what needs to be done. They even refer in this treat to a post I made a year ago, where it turns out it can't be done in R19 like I said. https://plugincafe.MAXON.net/topic/10528/13980_render-settings-file-format-options-r19 Now with R20 it seems they fixed the problem using GetImageSettingsDictionary() / SetImageSettingsDictionary(). Thanks again for the link to the topic! Just for reference, I'll post the code that fixes my problem: """ Image Settings Dictionary Example: c4d.bitmaps.SetImageSettingsDictionary() c4d.bitmaps.GetImageSettingsDictionary() Configures OpenEXR output render format with SetImageSettingsDictionary() then reads these with GetImageSettingsDictionary(). """ import c4d from c4d import bitmaps import MAXON def main(): # Retrieves render data and its container renderData = doc.GetActiveRenderData() bc = renderData.GetDataInstance() # Gets image filters options saveOptions = bc.GetContainerInstance(c4d.RDATA_SAVEOPTIONS) # Sets OpenEXR output format bc[c4d.RDATA_FORMAT] = c4d.FILTER_EXR # Defines OpenEXR settings compressionmethodID = MAXON.InternedId('net.MAXON.mediasession.openexr.export.compressionmethod') halffloatID = MAXON.InternedId('net.MAXON.mediasession.openexr.export.halffloat') layernumberingID = MAXON.InternedId('net.MAXON.mediasession.openexr.export.layernumbering') # Configures OpenEXR format options with a MAXON.DataDictionary exportSettings = MAXON.DataDictionary() exportSettings.Set(compressionmethodID, MAXON.Id("zip")) exportSettings.Set(halffloatID, True) exportSettings.Set(layernumberingID, False) # Stores settings in render data container bitmaps.SetImageSettingsDictionary(exportSettings, saveOptions, c4d.FILTER_EXR) # Updates Cinema 4D c4d.EventAdd() # Retrieves OpenEXR images settings settings = bitmaps.GetImageSettingsDictionary(saveOptions, c4d.FILTER_EXR) # Reads and prints OpenEXR format options print("openexr.export.compressionmethod: " + str(settings.Get(compressionmethodID))) print("openexr.export.halffloat: " + str(settings.Get(halffloatID))) print("openexr.export.layernumbering: " + str(settings.Get(layernumberingID))) if __name__=='__main__': main()
  2. 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
  3. Sorry for the late reply again. You guys are absolutely right! Didn't know about these keyframe selections, which are actualy quite handy. Thanks for looking into this, and I've informed MAXON. Thanks again!
  4. Hi Everfresh, thanks for the reply... I contacted MAXON, it turns out to be a bug. Here is their reply: the development confirmed the behaviour as a bug. Now the developer has to find a fix for the issue, so it will work correctly in one of the coming versions. Unfortunately at time, you will have to animate these parameters manually. Tomorrow I’ll try your workaround and see if that works... In the meantime I circumvented the issue by creating my own controllercurvers... Thanks for lookin into this though.. All the best! Bas
  5. Hi! I've got a controller (curve object) taken from the standard C4D character rig. But I seem unable to keyframe the translation. I've singled out the curve and removed all tags and layers to no avail The weird thing is, I can animate the position in the Attributes->Coord. It's just that the 'record active objects' and the 'Auto Keying' buttons have no effect. I think there might be some unseeable python code still stuck on the object or something lake that. Ive Attached the file if someone is curious (try to set a position keyframe with the keyframe button) I hope someone knows a solution weird_non_keyable_translation.c4d
  • Create New...