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

    Creating bitmaps in descriptions

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 553 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 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

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

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

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

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

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

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

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