User Interface Description
Ogers last edited by m_adam
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();
Hi @Ogers, I know I pointed you to theses articles after you post this topic, so no worry at all.
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.
Ogers last edited by Ogers
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.
DescriptionCustomGui* descr= static_cast<DescriptionCustomGui*>(AddCustomGui(MyCustomGuiID, CUSTOMGUI_STATICTEXT, ""_s, BFV_SCALE, 200, 50, settings));
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
NodeDatabased 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
GeDialogis 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
DescriptionCustomGuielement. That is what the Attribute Manager is doing. Is that what you want to do?
But if you just want to create an ordinary
GeDialogwith some GUI elements, you don't have to do anything with a
Ogers last edited by Ogers
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.
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.
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?
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.
VideoPostDataplugins are based on
NodeDataso the settings are automatically displayed in the Render Settings window.
If you just want to display a
GeDialog, you just have to display a
GeDialogand 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.
This post is deleted!
Thank you so much for your help!