Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    GroupBorderNoTitle change GUI or flags after user input

    Cinema 4D SDK
    3
    4
    618
    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.
    • M
      mogh
      last edited by

      Dear developers,

      I would like to change the appearance of a group with these nice border styles after the user interacted with the interface. (inserting a filepath)

      self.GroupBorderNoTitle(c4d.BORDER_NONE) # filepath fine
      self.GroupBorderNoTitle(c4d.BORDER_ACTIVE_4) # orange filepath empty
      self.GroupBorderNoTitle(c4d.BORDER_ACTIVE_3) # red filepath does not exist
      

      I have a def Command(self, id, msg): section which checks the inputs but I cannot "change" the interface cosmetically in this section - still self.SetString(1103, str(self.folder)) works as intended ...

      how would this be feasible for changing elements where no dedicated "SET" is available.

      thank you for your time.
      mogh

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by

        Hello mogh.

        I usually come over such tasks by having a helper routine that does the layout (re-)building.
        In that routine, I can freely decide the gadget's appearance based on certain conditions. After rebuilding, the "old" gadgets have to be removed and replaced by the new ones and the only thing that's left is the refreshing of the dialog. Note that this only works for dynamic gadgets/groups.

        1 Reply Last reply Reply Quote 0
        • M
          mogh
          last edited by

          Thanks @mp5gosu

          you pointed me in the right direction I have some working code for now, even though I fear that I don't know what I am doing with all these classes 🙏

          this script example helped me a little bit even though its pretty rough

          https://github.com/PluginCafe/cinema4d_py_sdk_extended/blob/master/scripts/03_application_development/gui/dialog/customgui_quicktab_r19.py

          kind regards mogh

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by ferdinand

            Hi @mogh,

            thank you for reaching out to us and thank you @mp5gosu for providing help. I think the most meaningful thing I can say is that GeDialog is pretty forgiving and not as strict as the sum of its methods might imply; at least that was my insight to be gained when I encountered the class first. Since you said you consider this to be still rough, here are some tips that might be helpful.

            All following method references are members of GeDialog.

            • You can define and load file based resources for dialogs, just like it is implicitly done with descriptions, with LoadDialogResource. This helps to clean up GeDialog implementations from the inherent clutter that comes with complex interface definitions. You can also do this to some extent in a modular fashion, i.e., invoking LoadDialogResource multiple times will not replace the former content but instead append new content.
            • CreateLayout is mostly a convenience method. Or in other words, there is nothing which does prevent you from modifying the resource of a dialog from anywhere else where you have access to the dialog instance (be careful with threading though).
            • Resources are organized in groups and you can flush these groups with LayoutFlushGroup, for example to rebuild them on user interaction. Single arbitrary elements can be removed by invoking RemoveElement. The relevant methods are all grouped under Dialog Change Methods in the GeDialog documentation.

            If anything remains unclear, please do not hesitate to ask.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

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