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

    Some confusing things about Python standard dialogs

    Cinema 4D SDK
    r21 s22 python
    2
    3
    352
    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.
    • CairynC
      Cairyn
      last edited by Cairyn

      Hello;

      I was just going through the standard dialogs in the Python API like MessageDialog etc (https://developers.maxon.net/docs/py/2023_2/modules/c4d.gui/index.html?highlight=selectionlistdialog#c4d.gui.SelectionListDialog ; most of which do not exist in this form in the C++ API), and there are some questions open...

      1. The flag GEMB_FORCEDIALOG is unexplained (well, the explanation is "Forces dialog"). What does it actually do? I tried it in a script and see no change whether I use it or not.

      2. When does a MessageDialog return GEMB_R_UNDEFINED? (Does it ever?)

      3. The input dialog shows an OK and a Cancel button and can be closed with the Window Close icon. But it always returns the input string, other than RenameDialog which looks almost the same but returns None if the user presses Cancel.
        To be fair, the description does say that (no screenshot though). But what is the Cancel button for, then?

      4. The ColorDialog has ominous Flags as first parameter. The doc doesn't say which flags. I have found that you can use (some of) the DR_COLORFIELD_xxx flags to hide some parts of the color gadget (most of the _NO_ ones), but not all of them. The ColorDialog always opens in the mode it was closed in; the _ENABLE_ flags do not affect the state.
        Is there a list of the flags that actually take effect? Maybe there are more than just COLORFIELD?

      5. The SelectionListDialog has an X and a Y coordinate in the parameters. They don't seem to do anything, though? The menu always open at the mouse position. I would use c4d.MOUSEPOS, as for ShowPopupDialog, but the doc doesn't mention that.

      (Using the newest online docs here.)

      Thanks for information on these points!

      1 Reply Last reply Reply Quote 1
      • ManuelM
        Manuel
        last edited by

        hi,
        thanks for your questions πŸ™‚

        1 - Probably the only case is when you have a team render client, this will force the popup to be displayed on the client. Otherwise i don't see where i can be usefull.

        2 - GEMB_R::V_UNDEFINED That's the "default" state. So it will only return that function in the case of the other case (OK, CANCEL ...) failed. It's used in different dialog and always the same thing. Init with this value and than handle other cases.

        3 - Looks like a bug I've Opened a bug entry for that one. In fact InputDialog just return true in its Command function.

        4 - internally it's using GeChooseColor witch use AddColorChooser the flags will be transfered to the layoutflags of that function, so every DR_COLORFIELD could be used. (i didn't tested all)
        The current config is stored in the WorldBaseContainer. Something like this will remove it.
        the symbol is COLORCHOOSER_POPUP_LAYOUT_ID but it's not exposed so you have to use its ID.

            bc = c4d.GetWorldContainerInstance()
            del(bc[1035669])
        

        5 - this function is using internally the c++ function SelectionListShowMenu both are bugged (if i can call it so) the position is ignore and MOUSEPOS is used. I've opened a bug report.

        I hope i got every question answered, please point me to the I forgot if there's some πŸ™‚

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        CairynC 1 Reply Last reply Reply Quote 1
        • CairynC
          Cairyn @Manuel
          last edited by

          @m_magalhaes thanks, that'll do! πŸ‘

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