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

    User Interface Description

    Cinema 4D SDK
    3
    10
    1.8k
    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.
    • O
      Ogers
      last edited by m_adam

      Hello. Everyone!
      I am trying to build a GUI on c4d but I am having problems with the description class.
      Below I have Created 1 group with two columns and I am trying to add a static text using the description and BaseContainer class but the text is not showing on my gui. I also used AddCustomGui but that didn't give any result too. Is there any change that I should do to the code to make it work.
      Thank you in advance.

              GroupBegin(GROUP_ID_PIXEL_SAMPLE + _dialogIdx, BFH_SCALEFIT | BFV_TOP, 2, 0, String(), 0, 0);
      	GroupBorderSpace(20, 0, 10, 0);
      
      	AddStaticText(ID_PIXEL_SAMPLE_SLIDER , BFH_LEFT | BFV_TOP, 220, 0, "First Text"_s, BORDER_WITH_TITLE_MONO);
      	AutoAlloc<Description> description;
      
              DescID cid = DescID(DescLevel(56464, DTYPE_STATICTEXT, 0));
      	BaseContainer settings = GetCustomDataTypeDefault(DTYPE_STATICTEXT);
      	AutoAlloc<Description> description;
      	settings.SetString(DESC_NAME, "Not Working Text"_s);
      	settings.SetInt32(DESC_SCALEH, 1);
      	settings.SetBool(DESC_NEWLINE, true);
      	
      	description->SetParameter(cid, settings, DESCID_ROOT);
      
      	GroupEnd();
      
      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @Ogers, I know I pointed you to theses articles after you post this topic, so no worry at all.

        But Just in case please read and follow:
        -Q&A New Functionality.
        -About Tags and Tagging.

        I've setup your topic correctly.

        I would like to point you to the Descriptions Manual, which demonstrate how to add a parameter to a description.

        If you have any question please let me know.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • O
          Ogers
          last edited by Ogers

          Hello @m_adam.
          As you mentioned before that there should be a DescriptionCustomGui is it correct to declare it like the one below?
          And shouldn't I have an object first to add parameters to the description. I've been reading through the documentation a lot but still I am not solving it. I would really appreciate it if you could help me on this issue.
          Thank you!

                  DescriptionCustomGui* descr= static_cast<DescriptionCustomGui*>(AddCustomGui(MyCustomGuiID, 
                  CUSTOMGUI_STATICTEXT, ""_s, BFV_SCALE, 200, 50, settings));
          
          1 Reply Last reply Reply Quote 0
          • S
            s_bach
            last edited by

            Hello,

            maybe we could clarify some things.

            In Cinema 4D there are two different kinds of GUIs.

            The first are parameter descriptions. Such a description stores information on the parameters found on NodeData based elements like objects, tags or materials. Note that this description is about parameters, not GUI elements. See Description Manual and Description Settings Manual.

            The other GUI system is based on GeDialogs. Such a GeDialog is more or less an ordinary GUI window. This window contains groups and standard GUI elements. If you want to create a custom GUI element, you can do so by implementing a custom class based on GeUserArea. See GeDialog Manual and GeUserArea Manual.

            So make that clear: Descriptions and GeDialogs are two different things that have nothing to do with each other. Object parameters ≠ GUI elements. See GUI & User Interaction.

            The only connection is that you can display the parameters of an object in a GeDialog using the DescriptionCustomGui element. That is what the Attribute Manager is doing. Is that what you want to do?

            But if you just want to create an ordinary GeDialog with some GUI elements, you don't have to do anything with a Description.

            Best wishes,
            Sebastian

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • O
              Ogers
              last edited by Ogers

              Hello @s_bach
              Your explanation was very clear and I understood it well but I have just starting to learn Maxon sdk and I am having some difficulties in the beginning. What I am trying to do has to do with this ready code from : GeDialog Manual

              This example creates a "Progress Bar" custom GUI element.

                       const Int32         flags = BFH_LEFT | BFV_FIT;
                       const BaseContainer settings;
                       AddCustomGui(10000, CUSTOMGUI_PROGRESSBAR, String(), flags, SizePix(100), 
                       SizePix(12), settings);
              

              How can I add this CustomGui_Progressbar or any other CustomGui elements to the GeDialog Layout. I tried it by implementing a GeUserArea but it didn't work.
              I know how to use the groups and standard GUI elements.But I want to learn how to modify the GeDialog by using CustomGui.
              Can you please provide me with a short code if it is possible how to do that.

              1 Reply Last reply Reply Quote 0
              • S
                s_bach
                last edited by

                Hello,

                how registered Custom GUI elements are added is show in the GeDialog Manual. Please notice that these "custom GUI elements" are specially registered GUI components that already exist. If you want to create a simple, self-made component you have to implement a GeUserArea.

                You find an extensive example on how to add elements to a GeDialog (including custom GUI elments and GeUserAreas) in the cinema4dsdk example and on GitHub: gedialog_gadgets.cpp.

                best wishes,
                Sebastian

                MAXON SDK Specialist

                Development Blog, MAXON Registered Developer

                1 Reply Last reply Reply Quote 1
                • O
                  Ogers
                  last edited by

                  Thank you very much @s_bach . You are making things so much clearer for me.

                  I would very much appreciate your general advice on the following task to make sure we're on the right path:
                  We need to create a plugin for a rendering engine. We've made good progress with the conversion of geometry/lighting/shaders etc. We're currently working on the UI of the settings. As far as I could tell from your explanations, the Cinema4D way to do this is to create an object of type NodeData, attach the settings as attributes of the object and show these settings in dialogs/panels using DescriptionCustomGui. Do you think this is correct?

                  1 Reply Last reply Reply Quote 0
                  • S
                    s_bach
                    last edited by

                    @ogers said in User Interface Description:

                    As far as I could tell from your explanations, the Cinema4D way to do this is to create an object of type NodeData, attach the settings as attributes of the object and show these settings in dialogs/panels using DescriptionCustomGui. Do you think this is correct?

                    this is NOT correct; this is the exact opposite of what I was trying to explain 😉

                    How exactly are you creating your render plugin? How do you want to present the "settings"?

                    There is the VideoPostData plugin type which can be used to add render engines to Cinema 4D. VideoPostData plugins are based on NodeData so the settings are automatically displayed in the Render Settings window.

                    If you just want to display a GeDialog, you just have to display a GeDialog and fill it with with standard or custom gadgets.

                    As written in my previous post, GeDialogs and parameter Descriptions have nothing to do with each other. I think in your case, just forget about Descriptions and DescriptionCustomGui.

                    Just create a GeDialog with standard gadgets.

                    best wishes,
                    Sebastian

                    MAXON SDK Specialist

                    Development Blog, MAXON Registered Developer

                    1 Reply Last reply Reply Quote 1
                    • O
                      Ogers
                      last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • O
                        Ogers
                        last edited by

                        @s_bach
                        Thank you so much for your help!

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