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

    how can i create a window form dialog?

    Scheduled Pinned Locked Moved PYTHON Development
    11 Posts 0 Posters 973 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 29/03/2012 at 07:32, xxxxxxxx wrote:

      http://www.thirdpartyplugins.com/python/modules/c4d.gui/GeDialog/index.html#c4d.gui.GeDialog

      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 29/03/2012 at 07:51, xxxxxxxx wrote:

        yes i watched this and i'm trying to do something:

        def main() :
         
          myDialog = c4d.gui.GeDialog()
          myDialog.AddEditSlider(30, c4d.BFH_CENTER, initw=-100, inith=100)

        but i get SystemError: error return without exception set

        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 29/03/2012 at 08:31, xxxxxxxx wrote:

          please read the manual. you need to overwrite CreateLayout. however scripts are not meant to 
          use dialogs. c4ds native gui approach are descriptions, so create a command/object/tooldata plugin
          and use descriptions or use a python generator/tag in cobination with the custom description 
          frontend userdatas.

          your example for a scripting solution could be solved with something like this :

          def main() :
              myDialog = CustomDialog()
              myDialog.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE)
              
          class CustomDialog(c4d.gui.GeDialog) :
              def CreateLayout(self) :
                  self.AddEditSlider(30, c4d.BFH_CENTER, initw=-70, inith=0)
                  return True
          
          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 29/03/2012 at 09:22, xxxxxxxx wrote:

            PS: "descriptions" for dialogs are called "dialog resources", descriptions and resources are quite different. 😉

            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 29/03/2012 at 09:58, xxxxxxxx wrote:

              not sure what you want to say, but i meant what i said , descriptions - user interfaces displayed 
              in the attributes manger. don't see a reason to use dialogs, as they interrupt the intended 
              workflow of c4d (non-modal or not).

              what i was trying to say was - i don't think it is good choice to learn the dialog system as it 
              provides only a small advantage on layout possibilities, while many disadvantages on workflow 
              and genral design.

              when you are trying to learn the c4d api i would advise to stick with descriptions/userdata and 
              simply ignore dialogs. at least i am doing so.

              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 30/03/2012 at 02:23, xxxxxxxx wrote:

                thanks

                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 30/03/2012 at 03:25, xxxxxxxx wrote:

                  how can i from a class call a function of the main code?

                  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 30/03/2012 at 03:56, xxxxxxxx wrote:

                    depends on where the *main* code is located. your method has either to be public (aka global in 
                    python) or static and public if it is located in another class.

                    edit : or just public if you have got an instance of the respective class or the class itself is static
                    (not sure if there are static classes in python)

                    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 30/03/2012 at 04:48, xxxxxxxx wrote:

                      Class someClass:
                           print "I want to call aFunction from here!!!"

                      def aFunction() :
                             print "I'm aFunction"

                      def main() :
                           print "I'm main"

                      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 30/03/2012 at 05:45, xxxxxxxx wrote:

                        class someClass:
                            def Do(self) :
                                aFunction()
                                
                        def aFunction() :
                            print "I'm aFunction"
                                      
                        def main() :
                            myClass = someClass()
                            myClass.Do()
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post