Render Data - EXR compression type [SOLVED]

On 21/05/2017 at 17:03, xxxxxxxx wrote:

Hi all!

I'm writing one script to collect and set the render setting to render some projects with the same render setting and speed up the workflow with this script.

I want to use EXR format to Multi Pass setting but in the python SDK documentation doesn't talk about compression for each format (jpg, or exr for example).

So, how can I get the compression data to set it with the script? I want to set the Lossy 16bit format in blocks of 16 scanlines exr compression.

Here is the format sectionof the script:

import c4d

def Format() :

doc=c4d.documents.GetActiveDocument()
    rDat=doc.GetActiveRenderData()
    MPFormat=c4d.FILTER_EXR #EXR format
    rDat[c4d.RDATA_MULTIPASS_SAVEFORMAT] = MPFormat #Set EXR in Multipass Output Render Settings
    print rDat[c4d.FILTER_EXR] #always print 1 any option compression information
    c4d.EventAdd()
    
Format()

----------------------

Thanks and cheers!!

On 22/05/2017 at 01:12, xxxxxxxx wrote:

Don't know if it's uptodate or not but did you read this thread? Because for me everything is working when I use the script from this thread.
https://plugincafe.maxon.net/topic/8721/11429_setting-the-format-options-of-an-openexr-solved&PID=45254

On 22/05/2017 at 01:54, xxxxxxxx wrote:

Hi cybor09,

as stated out by gr4ph0s, in the thread he mentioned there's a small snippet showing how to define the options for the EXR file format by adding a sub-container. Basically once you have accessed the RDATA_SAVEOPTIONS BaseContainer, just add a subcontainer with the additional options you need to be used.

Best, Riccardo

On 22/05/2017 at 02:16, xxxxxxxx wrote:

I guess it will be really nice to have at least all options exposed.
Since even in the C++ sdk I was not able to find others options

btw: your link point to nothing riccardo 😉

On 22/05/2017 at 05:09, xxxxxxxx wrote:

I agree 100% gr4ph0s, for the time being here you are with a small atlas:

OPENEXR - rdata[c4d.RDATA_SAVEOPTIONS][0] is a BaseContainer containing the OpenEXR options
    None
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  0
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  0

Run length encoding
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  1
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  0

Zip, one scan line at a time
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  2
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  0

Zip, in blocks of 16 scan lines 
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  3
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  0
     
    Piz-based wavelet
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  4
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  0

Lossy 24-bit float, Zip 
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  5
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  0
     
    Lossy 16-bit float, 4-by-4 pixel [B44]
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  6
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  1
     
    Lossy 16-bit float, 4-by-4 pixel (flat fields) [B44A]
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  7
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  1
     
    Lossy 16-bit float, Run length encoding
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  1
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  1
     
    Lossy 16-bit float, Zip, one scan line at a time
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  2
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  1
     
    Lossy 16-bit float, Zip, in blocks of 16 scan lines 
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  3
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  1
     
    Lossy 16-bit float, Piz-based wavelet
    rdata[c4d.RDATA_SAVEOPTIONS][0][0] =  4
    rdata[c4d.RDATA_SAVEOPTIONS][0][1] =  1

PNG
    Not interlaced/interlaced
    rdata[c4d.RDATA_SAVEOPTIONS][PNG_INTERLACED] = 0 (not interlaced)
    rdata[c4d.RDATA_SAVEOPTIONS][PNG_INTERLACED] = 1 (interlaced)
    
JPG
    compression percentage
    rdata[c4d.RDATA_SAVEOPTIONS][JPGSAVER_QUALITY] = percentage value

DPX
    planar
    rdata[c4d.RDATA_SAVEOPTIONS][DPX_PLANAR] = 0 (disabled)
    rdata[c4d.RDATA_SAVEOPTIONS][DPX_PLANAR] = 1 (enabled)

RLA 
    Z
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_Z) == c4d.RLAFLAGS_Z (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_Z) != c4d.RLAFLAGS_Z (disabled)

Object
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_OBJECTBUFFER) == c4d.RLAFLAGS_OBJECTBUFFER (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_OBJECTBUFFER) != c4d.RLAFLAGS_OBJECTBUFFER (disabled)

UV Coordinates
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_UV) == c4d.RLAFLAGS_UV (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_UV) != c4d.RLAFLAGS_UV (disabled)

Normal
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_NORMAL) == c4d.RLAFLAGS_NORMAL (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_NORMAL) != c4d.RLAFLAGS_NORMAL (disabled)

Non-clamped color
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_ORIGCOLOR) == c4d.RLAFLAGS_ORIGCOLOR (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_ORIGCOLOR) != c4d.RLAFLAGS_ORIGCOLOR (disabled)

Coverage    
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_COVERAGE) == c4d.RLAFLAGS_COVERAGE (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_COVERAGE) != c4d.RLAFLAGS_COVERAGE (disabled)

RPF
    Z
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_Z) == c4d.RLAFLAGS_Z (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_Z) != c4d.RLAFLAGS_Z (disabled)

Object
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_OBJECTBUFFER) == c4d.RLAFLAGS_OBJECTBUFFER (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_OBJECTBUFFER) != c4d.RLAFLAGS_OBJECTBUFFER (disabled)

UV Coordinates
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_UV) == c4d.RLAFLAGS_UV (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_UV) != c4d.RLAFLAGS_UV (disabled)

Normal
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_NORMAL) == c4d.RLAFLAGS_NORMAL (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_NORMAL) != c4d.RLAFLAGS_NORMAL (disabled)

Non-clamped color
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_ORIGCOLOR) == c4d.RLAFLAGS_ORIGCOLOR (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_ORIGCOLOR) != c4d.RLAFLAGS_ORIGCOLOR (disabled)

Coverage    
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_COVERAGE) == c4d.RLAFLAGS_COVERAGE (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_COVERAGE) != c4d.RLAFLAGS_COVERAGE (disabled)

ObjectID
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_OBJECTID) == c4d.RLAFLAGS_OBJECTID (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_OBJECTID) != c4d.RLAFLAGS_OBJECTID (disabled)
    
    Color
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_COLOR) == c4d.RLAFLAGS_COLOR (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_COLOR) != c4d.RLAFLAGS_COLOR (disabled)

Subpixel Weight
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_SUBPIXEL_WEIGHT) == c4d.RLAFLAGS_SUBPIXEL_WEIGHT (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_SUBPIXEL_WEIGHT) != c4d.RLAFLAGS_SUBPIXEL_WEIGHT (disabled)

Subpixel Mask           
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_SUBPIXEL_MASK) == c4d.RLAFLAGS_SUBPIXEL_MASK (enabled)
    (rdata[c4d.RDATA_SAVEOPTIONS][RLA_OPTIONS] & c4d.RLAFLAGS_SUBPIXEL_MASK) != c4d.RLAFLAGS_SUBPIXEL_MASK (disabled)
            
PS: Note that the corresponding map is just an atlas and doesn't consider any sort of check about the existence of the objects containing the values as usual happens in snippets

Best, Riccardo

On 22/05/2017 at 08:06, xxxxxxxx wrote:

I love your posts Riccardo.
Every time you reply to a question, you always reply to it with a working code example.

I really love that. Thumbs Up
-ScottA

On 22/05/2017 at 08:12, xxxxxxxx wrote:

Wow that thread must be added to the sdk 😛

I 100% agree with Scotta !

On 23/05/2017 at 10:13, xxxxxxxx wrote:

That's great guys! Thanks a lot!

And sorry, I didn't search correctly with the advanced search options before to create this thread but I'm grateful for the atlas 🙂. This should be added to the SDK 😄

Thanks again, cheers!