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

    ShowPopUp with Details? [SOLVED]

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

      On 11/01/2015 at 02:31, xxxxxxxx wrote:

      Dear Python Experts.

      I´ve made a plugin which execute the GUI ShowPopUpDialog and populate it with all layer names in the current document. When a names is pressed, the selected objects are added to that layer.

      This works perfect, but i would like to get the layer color indicator into the popup aswell.

      Is this even possible with the gui.showpopupdialog or do i need to go the GeDialog way?

      If i have to go the GeDialog way, can someone push me in the right direction to start of such a custom gui? 🙂

      Looking forward to hear from you !

      Best Regards
      Nicolaj

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

        On 12/01/2015 at 10:45, xxxxxxxx wrote:

        Hello,

        you can use an icon in the popup menu. Using "& i....&" you can define an icon id that is used for that element:

          
        menu.SetString(c4d.FIRST_POPUP_ID+99,"&i5119&Something")  
        

        So you could create preview icons and register them using RegisterIcon()[URL-REMOVED]. But I'm not sure if this is a good workflow.

        If you want to draw something in a GeDialog you may use a GeUserArea[URL-REMOVED]. There you can draw whatever you want. You find some code that shows how to use that class in the Py-MemoryViewer.pyp[URL-REMOVED] example.

        Best wishes,
        Sebastian


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

          On 12/01/2015 at 10:56, xxxxxxxx wrote:

          Hi Sebastian

          Thanks for answer, it seems like a Good solution with the Registericon..
          But is it possible to colorize the icons?

          I wan't grab to the color from each layer and link it to the icon in the PopUp 🙂

          Best Regards
          Nicolaj

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

            On 13/01/2015 at 00:06, xxxxxxxx wrote:

            Hello,

            when you call RegisterIcon() you register a bitmap. You can fill this bitmap any way you like.

            best wishes,
            Sebastian

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

              On 13/01/2015 at 03:16, xxxxxxxx wrote:

              I like to extend the question

              I try the code of

              menu.SetString(19, '&d&i5119& '+group.GetName());
                  menu.SetString(0, "" )
                  menu.SetString(31, 'select')
              

              - but I can`t get a disable menu item and a icon

              and all following menu item have the same icon

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

                On 13/01/2015 at 05:11, xxxxxxxx wrote:

                Hello,

                to disable a menu element simply add "&d&"[URL-REMOVED]:

                  
                menu.SetString(c4d.FIRST_POPUP_ID+100,"&i5150&Something Else &d&")  
                

                best wishes,
                Sebastian


                [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

                  On 17/01/2015 at 03:53, xxxxxxxx wrote:

                  Hi Sebastian

                  I´m having trouble finding the right code-snippet for filling a bitmap in python.
                  So far i managed i attach my custom icon to every entry in my popup dialog, but after looking thru the bitmap class, i can´t seem to find anything useful.

                  Best Regards
                  Nicolaj

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

                    On 19/01/2015 at 01:06, xxxxxxxx wrote:

                    Hello,

                    you can set the data of a bitmap using BaseBitmap.SetPixel()[URL-REMOVED]. An example can be found in SculptSaveMask.pyp[URL-REMOVED].

                    A little more comfortable way of filling a bitmap would be to use the GeClipMap[URL-REMOVED] class.

                      
                    geClipMap = c4d.bitmaps.GeClipMap()  
                    geClipMap.Init(800,600,32)  
                      
                    geClipMap.BeginDraw()  
                      
                    geClipMap.SetColor(255,0,0)  
                    geClipMap.FillRect(0,0,800,600)  
                      
                    geClipMap.EndDraw()  
                      
                    bitmap = geClipMap.GetBitmap()  
                      
                    filename = c4d.storage.SaveDialog(title="Save image")  
                    bitmap.Save(filename,c4d.FILTER_TIF)  
                    

                    For questions no longer related to this thread's original topic please open a new thread. Thanks.

                    best wishes,
                    Sebastian


                    [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

                      On 30/01/2015 at 10:44, xxxxxxxx wrote:

                      Hello sortsovs,

                      was your question answered?

                      Best wishes,
                      Sebastian

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

                        On 30/01/2015 at 10:52, xxxxxxxx wrote:

                        Hi Sebastian

                        Oh Ya, Sorry! How do i close the topic? 🙂

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

                          On 02/02/2015 at 03:15, xxxxxxxx wrote:

                          Hello,

                          you do not need to close this topic; we will handle this.

                          Best wishes,
                          Sebastian

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