Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Saving EXR?

 Post Reply Post Reply
Author
Message
khor View Drop Down
Member
Member


Joined: 2012 Dec 15
Online Status: Offline
Posts: 28
Post Options Post Options   Quote khor Quote  Post ReplyReply Direct Link To This Post Topic: Saving EXR?
    Posted: 2015 Oct 15 at 6:40am

User Information:

Cinema 4D Version:   17 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s):     C++  ;   

---------

Hi there,

I'm looking for compression options on saving MultipassBitmap as EXR file. As ZIP, PIZ, ZIPS, etc... How can we set it?

Thanks,
A.
Ahmet Oktar
Octane For Cinema 4D Developper / 3d generalist
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1822
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Oct 16 at 3:51am
Hi Ahmet,

The BaseBitmap::Save() function has a data parameter, where you can pass additional configuration options.
For EXR you pass a BaseContainer containing another BaseContainer at ID 0 with the actual settings.

The second BaseContainer then contains the following settings:

ID 0: Int32 value, the compression type (one from the list below)
0 = NO_COMPRESSION
1 = RLE_COMPRESSION
2 = ZIPS_COMPRESSION
3 = ZIP_COMPRESSION
4 = PIZ_COMPRESSION
5 = PXR24_COMPRESSION
6 = B44_COMPRESSION
7 = B44A_COMPRESSION

ID 1: Boolean value, clamp to 16-Bit float

There's also another thread showing about Setting the format options of an OpenEXR in the render settings.
Cheers,
Andreas
SDK Support Engineer
Back to Top
wbeh View Drop Down
Member
Member


Joined: 2009 Sep 12
Location: Germany
Online Status: Offline
Posts: 245
Post Options Post Options   Quote wbeh Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Oct 16 at 6:21am
Originally posted by Andreas Block

Hi Ahmet,
The BaseBitmap::Save() function has a data parameter, where you can pass additional configuration options.
For EXR you pass a BaseContainer containing another BaseContainer<span style="line-height: 16.8px;"> </span><span style="line-height: 16.8px;">at ID 0</span><span style="line-height: 1.4;"> with the actual settings.</span>
The second BaseContainer then contains the following settings:
ID 0: Int32 value, the compression type (one from the list below)
0 = NO_COMPRESSION
1 = RLE_COMPRESSION
2 = ZIPS_COMPRESSION
3 = ZIP_COMPRESSION
4 = PIZ_COMPRESSION
5 = PXR24_COMPRESSION
6 = B44_COMPRESSION
7 = B44A_COMPRESSION
<div style="line-height: 16.8px;">ID 1: Boolean value, clamp to 16-Bit float
There's also another thread showing about Setting the format options of an OpenEXR in the render settings.


Please note that setting these IDs on your own could break at some point in time in case their support in OpenEXR is removed or extended (e.g. the first versions of the EXR lib only had a fraction of these options).

Best regards,

Wilfried
Back to Top
khor View Drop Down
Member
Member


Joined: 2012 Dec 15
Online Status: Offline
Posts: 28
Post Options Post Options   Quote khor Quote  Post ReplyReply Direct Link To This Post Posted: 2015 Oct 16 at 10:37am
Thanks for answers. I'll give a try like that.
Ahmet Oktar
Octane For Cinema 4D Developper / 3d generalist
Back to Top
khor View Drop Down
Member
Member


Joined: 2012 Dec 15
Online Status: Offline
Posts: 28
Post Options Post Options   Quote khor Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Jun 28 at 4:49pm
Could you check this code? I'm not able to see any difference on saved files. Always saving at same compression.

    BaseBitmap *multiBmp = BaseBitmap::Alloc();
    multiBmp->Init(1024,1024, 32);

    BaseContainer dataBc, optBc;

    optBc.SetInt32(0, (Int32)4); // EXR compressions
    optBc.SetBool(1, TRUE);  //  16-bit
    for(Float i=0;i<360.0;i+=0.2)
    {
        Float a = PI*i/180.0;
        multiBmp->SetPen(i,2*i,3*i);
        multiBmp->Line(512,512,512+512*cos(a), 512+512*sin(a));
    }
    dataBc.SetContainer(0, optBc);
    multiBmp->Save("d:/test1.exr", FILTER_EXR, &dataBc, SAVEBIT_MULTILAYER);

    optBc.SetInt32(0, (Int32)6); // EXR compressions
    optBc.SetBool(1, FALSE);  //  16-bit
    dataBc.SetContainer(0, optBc);
    multiBmp->Save("d:/test2.exr", FILTER_EXR, &dataBc, SAVEBIT_MULTILAYER);

Ahmet Oktar
Octane For Cinema 4D Developper / 3d generalist
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1822
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Jun 29 at 8:44am
Hello Ahmet,

I suppose you are working in R19?
Unfortunately due to internal changes such parameters can currently not be changed.
While that's about render settings, it boils down to the same internal issue.
I hope this situation will be fixed with one of the next versions.

Cheers,
Andreas
SDK Support Engineer
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.141 seconds.