how can i create a window form dialog?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 29/03/2012 at 07:26, xxxxxxxx wrote:

    I would to create a button into cinema4d gui that when I click it opens up a window dialog form with some form field, like integer texbox and a button to run the code.
    How can i create this dialog and integrate phyton code?



  • 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



  • 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



  • 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
    


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



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



  • 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



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



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



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



  • 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()
    

Log in to reply