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

    GeDialog command

    SDK Help
    0
    3
    431
    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

      On 29/08/2017 at 14:12, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   18 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;   PYTHON  ;

      ---------
      hi guys
      i have a images in folder , i loop to it to ceate a BitmapButtonCustomGui, in the for loop i use one define ID,
      i want to konw how i can use the button  in a gedialog command, 
      thanks

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

        On 29/08/2017 at 19:19, xxxxxxxx wrote:

        I guess everything you need is written here

        Typically in a Gedialog when you create a widget (independant from it's type, it can be a slider, a button or a customGui for exemple) you assign them an unique ID. And whhen user click it's trigger Command function with this Unique ID as id.

        Since you are in a dynamics things you may want to do something like this (its pseudo code)

        UI_ID = 1001
        MAX_ELEMENT = 100
          
        def CreateLayout(self) :
          #ensure user will not ovveride others id
          if nb_widget > MAX_ELEMENTS: return True
          
          for i in xrange(nb_widget) :
            CreateMyWidget(UI_ID + i) #you are sure every widget created get an unique id
          
        def Command(self, id, msg=None) :
          if UI_ID <= id < UI_ID + MAX_ELEMENT:
        	element = id - UI_ID
        

        I also suggest you to read the C++ manual about Gedialog it can be helpful even if you develop in python.

        Finally welcome here!  😉

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

          On 30/08/2017 at 11:34, xxxxxxxx wrote:

          thinks 👍

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