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

    newbie: GeDialog example?

    Scheduled Pinned Locked Moved SDK Help
    10 Posts 0 Posters 787 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 28/10/2010 at 04:58, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:   Windows  ;   
      Language(s) :       PYTHON  ;

      ---------
      Hello there,

      I am trying to get a grip on GUI interfaces within Python for C4D.
      Unfortunately just now learning python (and coding) so I still am not able to understand the SDK in a way that I can code right away.

      Is there a example somwhere over making a simple GeDialog with lets say one input value? so that I understand the structure that is nessesary?

      thanks a lot

      Jops
      (who is trying not to flood this nice forum with newbie questions)

      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 28/10/2010 at 05:09, xxxxxxxx wrote:

        Hi Jops,

        here is a small example for you. I hope this helps:

        import c4d
        from c4d import gui
        #Welcome to the world of Python
          
        GROUP_ID1=1000
        TEXTBOX=1001
        BUTTON1=1002
        BUTTON2=1003
          
        class ExampleDlg(gui.GeDialog) :
            
            def CreateLayout(self) :
                #creat the layout of the dialog
                self.GroupBegin(GROUP_ID1, c4d.BFH_SCALEFIT, 3, 1)
                self.AddEditText(TEXTBOX, c4d.BFH_SCALEFIT)
                self.AddButton(BUTTON1, c4d.BFH_SCALE, name="MessadeDialog")
                self.AddButton(BUTTON2, c4d.BFH_SCALE, name="Close")
                self.GroupEnd()
                return True
          
            def InitValues(self) :
                #initiate the gadgets with values
                self.SetString(TEXTBOX, "Hello World!")
                return True
          
            def Command(self, id, msg) :
                #handle user input
                if id==BUTTON1:
                    gui.MessageDialog(self.GetString(TEXTBOX))
                elif id==BUTTON2:
                    self.Close()
                return True
          
          
        dlg = ExampleDlg()
        dlg.Open(c4d.DLG_TYPE_MODAL, defaultw=300, defaulth=50)
        

        Cheers, Sebastian

        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 28/10/2010 at 05:52, xxxxxxxx wrote:

          Hello Sebastian,

          that is great, thanks a lot!!!
          may I put you example in Per-Anders Python Wiki?

          all The best
          Jops

          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 28/10/2010 at 06:05, xxxxxxxx wrote:

            Sure, do with the code what ever you want.

            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 28/10/2010 at 06:28, xxxxxxxx wrote:

              if you have time you might answer me one more question:

              if I define the dialog as a async dialog it just pops up and closes again. even if I put it into the mail loop.

              Is there a trick or is there more to it?

              thanks again
              Jops

              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 28/10/2010 at 07:20, xxxxxxxx wrote:

                Asynchronous dialogs can just be used in plugins (in combination with CommandData).

                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 28/10/2010 at 14:54, xxxxxxxx wrote:

                  is it on principle possible to code a python plugin with plug ID and Asynchronous dialogs?

                  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 03/11/2010 at 03:13, xxxxxxxx wrote:

                    Originally posted by xxxxxxxx

                    is it on principle possible to code a python plugin with plug ID and Asynchronous dialogs?

                    Yes, that's possible.

                    cheers,
                    Matthias

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

                      On 01/11/2017 at 12:43, xxxxxxxx wrote:

                      Originally posted by xxxxxxxx

                       
                          def Command(self, id, msg) :
                              #handle user input
                              if id==BUTTON1:
                                  gui.MessageDialog(self.GetString(TEXTBOX))
                              elif id==BUTTON2:
                                  self.Close()
                              return True
                       
                      
                      

                      The buttons aren't working for me. Nothing happens when I click on them.

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

                        On 02/11/2017 at 10:29, xxxxxxxx wrote:

                        Hi,

                        welcome to the Plugin Café forums 🙂

                        I think, you'd need to post a bit more of your code, the Command() function doesn't look wrong to me.

                        We have a few examples making use of GeDialog in our GitHub repository.
                        The simplest, basically with two buttons in a GeDialog (just like the example above) is Py-TextureBaker.pyp.

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