Creating bitmaps in descriptions



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

    On 04/11/2012 at 19:04, xxxxxxxx wrote:

    Is it possible to have bitmaps in descriptions?
    I believe it is possible using a USERAREA but there is nothing documented in the SDK. The elements that the SDK talks about are:

    LINK
    VECTOR
    REAL
    LONG
    BOOL
    IN_EXCLUDE
    DATETIME
    FONT
    PRIORITY
    MATRIX
    STRING
    STATICTEXT
    FILENAME
    TEXTURE
    BUTTON
    BASETIME
    DYNAMIC
    SEPARATOR
    SPLINE
    COLOR
    GRADIENT
    HYPERLINK
    SHADERLINK

    Nothing about USERAREA :-(

    Rui Batista



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

    On 05/11/2012 at 00:35, xxxxxxxx wrote:

    Use a BITMAPBUTTON custom gui. You'll need to implement Message() and respond to MSG_DESCRIPTION_GETBIMAP to load the bitmap into the button.

    In C++ it would look like this:

      
    // In the .res file for the object:   
         BITMAPBUTTON MY_BMBUTTON { }   
      
    // In Message() :   
    case MSG_DESCRIPTION_GETBITMAP:   
         DescriptionGetBitmap *dgb;   
            dgb = static_cast<DescriptionGetBitmap*>(data);   
         if(dgb->id[0].id == MY_BMBUTTON)   
         {   
              Filename bg = GeGetPluginPath() + Filename("res") + Filename("my_bmbutton.tif");   
              if(!GeFExist(bg))   
                   return TRUE;   
              AutoAlloc<BaseBitmap>bm;   
              bm->Init(bg);   
              dgb->bmp = bm.Release();   
         }   
    break;   
    


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

    On 06/11/2012 at 18:47, xxxxxxxx wrote:

    I tried it, spedler, but It didn't work :-(

    My Message method starts like this:
    **
    def Message(self, node, type, data) :
         print "In Message"
         if type==c4d.MSG_DESCRIPTION_GETBITMAP:
              print "MSG_DESCRIPTION_GETBITMAP"
              if data['id'][0].id==AB_PIC_HEADER:
    **
    And in the console I only get "In Message". It never passes the
    **
    if type==c4d.MSG_DESCRIPTION_GETBITMAP:
    **
    And, even if it passed, I don't know how to actually insert the bitmap in the button.
    I'm loading the bitmap with:
    **
    dir, file = os.path.split(__file__)
    banner = bitmaps.BaseBitmap()
    banner.InitWith(os.path.join(dir, "res", "banner01.tif"))
    **
    But then, I don't know what to do with the bitmap.



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

    On 06/11/2012 at 23:17, xxxxxxxx wrote:

    I'm not sure if it's possible in Python, because I haven't yet tried it, but: You can (theoretically) create a SubDialog element, and in the SubDialog, you have a BitmapButton customgui or a UserArea.

    -Nik



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

    On 07/11/2012 at 01:17, xxxxxxxx wrote:

    How do I create a SubDialog or a UserArea?
    I'm creating my dialolg with a .res file.

    Rui Batista



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

    On 07/11/2012 at 04:55, xxxxxxxx wrote:

    Hi Rui,

    You can register your button's bitmap with RegisterIcon(id, bmp) before registering the plugin. In the description resource you can then set the icon, assuming the id is 123456789:

    BITMAPBUTTON MY_BMBUTTON { ICONID1 123456789; }
    

    In the description you have to put the number value, not the identifier value - because the resource parser cannot find them.



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

    On 07/11/2012 at 09:50, xxxxxxxx wrote:

    YES! Great... It works like a charm :-)
    Thank you Yannick.

    By the way, if I want to have an area in the description that shows a bitmap that I want to change and update, what would be the method?



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

    On 07/11/2012 at 14:43, xxxxxxxx wrote:

    Is there any way I can make the BITMAPBUTTON scale to the width of the palette?
    If I add the parameter ALIGN_LEFT, it simply flushes left.
    If I add the parameter SCALE_H, it centers.
    If I add the parameter FIT_H, it simply flushes left.

    Rui Batista


Log in to reply