Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    VPBuffers

    SDK Help
    0
    28
    15.6k
    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

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

      On 25/08/2007 at 14:36, xxxxxxxx wrote:

      I don't know anything about VPBuffers.

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

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

        On 27/08/2007 at 03:17, xxxxxxxx wrote:

        Here's how to browse through a multipass bitmap. For lights there is an inner loop that retrieves the data.

        The main bitmap should be checked with bmp->IsMultipassBitmap() first and then casted into a (MultipassBitmap* )

          
             LONG j,i,id;  
             LONG cnt = b3d->GetLayerCount();  
          
             for (i=0; i<cnt; i++)  
             {  
                  MultipassBitmap *sublayer,*layer = b3d->GetLayerNum(i);  
                  if (!layer) continue;  
          
                  LONG subcnt = layer->GetLayerCount();  
          
                  for (j=0;j<subcnt || subcnt==-1;j++)  
                  {  
                       if (subcnt>0)  
                            sublayer   = layer->GetLayerNum(j);  
                       else   
                            sublayer = layer;  
          
                       if (!sublayer) continue;  
          
                       id = sublayer->GetParameter(MPB_USERID).GetLong();  
                  }  
             }  
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

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

          On 27/08/2007 at 10:47, xxxxxxxx wrote:

          Thanks Philip,

          but what do you mean about main bitmap?

          do i need to get it from Multipass::VPBitmap[0]?

          Cheers
          Renato

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

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

            On 28/08/2007 at 12:26, xxxxxxxx wrote:

            You can retrieve the main bitmap by calling

              
            MultipassBitmap *mpb = (MultipassBitmap* )renderinstance->GetBuffer(NOTOK,0);  
            
            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

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

              On 29/08/2007 at 08:49, xxxxxxxx wrote:

              Hello Philip,

              where:
              LONG subcnt = layer->GetLayerCount();

              subcnt always is -1 so the internal cycle go in loop forewer.

              What's mean that GetLayerCount() return -1 ?

              cheers
              Renato

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

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

                On 29/08/2007 at 11:08, xxxxxxxx wrote:

                But Philip did this in his loop:

                for (j=0;j<subcnt || subcnt==-1;j++)
                

                Probably explicitly to avoid the infinite loop. No idea about what -1 represents here though.

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

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

                  On 29/08/2007 at 11:35, xxxxxxxx wrote:

                  Hello dear Robert,

                  but when the subcnt == -1.. it loop

                  🙂
                  renato

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

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

                    On 29/08/2007 at 12:29, xxxxxxxx wrote:

                    Are you sure of your types (LONG)? In actuality, all that is needed is:

                    for (j = 0; j < subcnt; ++j)
                    

                    Since -1L is less than 0L, the loop should exit immediately. But if ULONG is used, -1L is of course 4 billion.

                    All else failing, just check for -1 on subcnt and avoid the loop altogether:

                    LONG subcnt = layer->GetLayerCount();  
                    if (subcnt < 0)     continue;  
                    for (j=0; j!=subcnt; ++j)  
                    ...
                    
                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

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

                      On 30/08/2007 at 01:54, xxxxxxxx wrote:

                      My excuses... one line of source code was missing!

                        
                           LONG j,i,id;  
                           LONG cnt = b3d->GetLayerCount();  
                        
                           for (i=0; i<cnt; i++)  
                           {  
                                MultipassBitmap *sublayer,*layer = b3d->GetLayerNum(i);  
                                if (!layer) continue;  
                        
                                LONG subcnt = layer->GetLayerCount();  
                        
                                for (j=0;j<subcnt || subcnt==-1;j++)  
                                {  
                                     if (subcnt>0)  
                                          sublayer   = layer->GetLayerNum(j);  
                                     else  
                                          sublayer = layer;  
                        
                                     if (!sublayer) continue;  
                        
                                     id = sublayer->GetParameter(MPB_USERID).GetLong();  
                                     if (subcnt==-1) break;       
                                }  
                           }  
                      
                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

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

                        On 30/08/2007 at 11:10, xxxxxxxx wrote:

                        Hello Philip,

                        ok now 🙂 but the objectID are the only buffers not detected with this way 😞

                        any suggestions?

                        Cheers
                        Renato

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

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

                          On 30/08/2007 at 14:25, xxxxxxxx wrote:

                          To retrieve the alpha channels use:

                            
                          cnt = b3d->GetAlphaLayerCount();  
                          for (i=0; i<cnt; i++)  
                          {  
                               B3dBitmap *layer = b3d->GetAlphaLayerNum(i);  
                               if (!layer) continue;  
                            
                               id = sublayer->GetParameter(MPB_USERID).GetLong();  
                               if (!id) continue;  
                            
                               ...  
                          }  
                          
                          1 Reply Last reply Reply Quote 0
                          • H
                            Helper
                            last edited by

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

                            On 30/08/2007 at 14:26, xxxxxxxx wrote:

                            Ah.. thanks.. i forgot that ObjectID are in fact alpha channels 🙂

                            Thanks a lot
                            Renato

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