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
    • Recent
    • Tags
    • Users
    • Login

    MultipassObject Allocation

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 407 Views
    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 Offline
      Helper
      last edited by

      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

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        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

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          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  Smile,
          -ScottA

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 23/05/2011 at 10:15, xxxxxxxx wrote:

            Thanks Matthias! That is exactly what I needed to know.

            Regards,
            Josh

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