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



  • 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://plugincafe.maxon.net/topic/5716/5761_multipassobject-allocation&KW=MULTIPASSOBJECT_TYPE&PID=24000#24000 which works well for RGBA, but I need Post Effects too! Please, help.



  • 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.



  • 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?



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

    Andreas, thank you very much! It works!



  • 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.


Log in to reply