Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 20/05/2011 at 12:44, xxxxxxxx wrote:
User Information: Cinema 4D Version: 12 Platform: Windows ; Mac ; Language(s) : C++ ;
--------- Hey Everyone, How can one go about inserting a new Multipass layer (i.e VPBUFFER_OBJECTBUFFER) into the RenderData? The RenderData has a method InsertMultipass which takes a MultipassObject*, but the MultipassObject has no allocation methods. So essentially I am asking how can I allocate a MultipassObject*.
I've tried using BaseList2D::Alloc(VPBUFFER_OBJECTBUFFER) and casting the resulting pointer to a MultipassObject to no avail.
Thanks in advance, Josh
On 23/05/2011 at 02:18, xxxxxxxx wrote:
A multipass is allocted and inserted like this:
RenderData *rd = doc->GetActiveRenderData(); MultipassObject *mpo = NULL; mpo = (MultipassObject* )MultipassObject::Alloc(Zmultipass); if (!mpo) return FALSE; BaseContainer *data = mpo->GetDataInstance(); data->SetLong(MULTIPASSOBJECT_TYPE, VPBUFFER_RGBA); doc->StartUndo(); rd->InsertMultipass(mpo, NULL); doc->AddUndo(UNDOTYPE_NEW, mpo); doc->EndUndo(); rd->Message(MSG_UPDATE); EventAdd();
I will include this into the docs.
cheers, Matthias
On 23/05/2011 at 08:58, xxxxxxxx wrote:
Mattias,
Could you please consider adding this line of code in your docs example as well:
rd->SetParameter(RDATA_MULTIPASS_ENABLE, 1, DESCFLAGS_SET_0); // Enable the multi pass option
That way people reading that SDK will also know how to enable it too.
Just a friendly suggestion , -ScottA
On 23/05/2011 at 10:15, xxxxxxxx wrote:
Thanks Matthias! That is exactly what I needed to know.
Regards, Josh