Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Can't add Post Effects to Multi-Pass in render stx

    SDK Help
    0
    5
    430
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 18/08/2016 at 09:12, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      Hi,

      I would like to add Post Effects under Multi-Pass using the code:

       
      					rd->SetParameter(RDATA_MULTIPASS_ENABLE, 1, DESCFLAGS_SET_0); // Enable the multi pass option
        
      					MultipassObject *mpo = NULL;
      					mpo = (MultipassObject* )MultipassObject::Alloc(Zmultipass);
      					if (mpo)
      					{
      						BaseContainer *mdata = mpo->GetDataInstance();
      						mdata->SetInt32(MULTIPASSOBJECT_TYPE, VPBUFFER_POSTEFFECT);
        
      					//	GeData data;
      					//	data.SetInt32(VPBUFFER_POSTEFFECT);
      					//	mpo->SetParameter(DescID(MULTIPASSOBJECT_TYPE), data, DESCFLAGS_SET_0);
        
      						doc->StartUndo();
        
      						rd->InsertMultipass(mpo, NULL);
        
      						doc->AddUndo(UNDOTYPE_NEW, mpo);
      						doc->EndUndo();
        
      						rd->Message(MSG_UPDATE);
      						EventAdd();
      					}
      

      But it adds only an empty line under Multi-Pass. Even using currently commented SetParameter doesn't help.
      How to add it programmably?

      My example is based on https://developers.maxon.net/forum/topic/5716/5761_multipassobject-allocation&KW=MULTIPASSOBJECT_TYPE&PID=24000#24000 which works well for RGBA, but I need Post Effects too! Please, help.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 19/08/2016 at 06:06, xxxxxxxx wrote:

        Hi,

        you are using the wrong MULTIPASSOBJECT_TYPE. Instead of VPBUFFER_POSTEFFECT (which is used with AllocateBuffers()) you need to use VPBUFFER_ALLPOSTEFFECTS. There is no option to add a MultipassObject just for one single specific VideoPost.
        Some more information can be found in the MultipassObject manual.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 19/08/2016 at 06:52, xxxxxxxx wrote:

          Hi Andreas, thanks a lot, will try it just now!

          Btw, I have noticed that when Multi-pass is enabled by user or programmably then C4D applies pow(pix, 1.0f/2.2) to all the single layers and results of operations on layers. And this doesn't happend when Multi-pass is disabled (i.e. single image). Btw, does Cinema use 2.2 or pricise srgb curve? If uses 2.2 then can user change it in the settings?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 19/08/2016 at 06:58, xxxxxxxx wrote:

            Andreas, thank you very much! It works!

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 19/08/2016 at 23:45, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              Hi,

              you are using the wrong MULTIPASSOBJECT_TYPE. Instead of VPBUFFER_POSTEFFECT (which is used with AllocateBuffers()) you need to use VPBUFFER_ALLPOSTEFFECTS. There is no option to add a MultipassObject just for one single specific VideoPost.
              Some more information can be found in the MultipassObject manual.

              Thanks a lot Andreas! - Was facing same issue, all sorted now.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post