attach a GeDialog into a MaterialData plugin

On 22/01/2015 at 14:48, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   13+ 
Platform:   Windows  ;   
Language(s) :     C++  ;

I have a working GeDialog which is called with a CommandData plugin, what I want instead is to attach that Dialog inside the material

for example, the SimpleMaterial material from the SDK, it has on the left column "Main....." , and shows a layout which contains a group called "Material Properties" containing a Color field

what I want is just put my GeDialog there instead of this Group, any idea?

On 23/01/2015 at 06:32, xxxxxxxx wrote:


the parameters and the layout of a material are defined by the material's resource file. There is no way of replacing that GUI with anything else.

You could of course simply add a button to your material and then open your dialog when this button is pressed. Alternatively you could create a custom GUI type to display certain GUI element differently.

best wishes,

On 23/01/2015 at 07:48, xxxxxxxx wrote:

so to confirm what I understood:
1- I create iCustomGui class which contains my GeDialog stuff
2- add this iCustomGui class to the MaterialData GetDDescription()

is this what you meant?

or a better approach (as the GeDialog is just a container to hold my GeUserArea class) :
1- create iCustomGui class which contains my GeUserArea class
2- add this iCustomGui class to the MaterialData GetDDescription()

On 23/01/2015 at 09:10, xxxxxxxx wrote:


custom GUI types defined with iCustomGui cannot be just added to an object. These custom GUI types are used as a GUI for existing parameters.

A class based on iCustomGui just defines the custom "look". To register such a custom GUI you need also a CustomGuiData plugin. This plugin declares also the resource symbol that can be used to use that new custom GUI. So you can use that resource symbol in a material's resource files to tell Cinema to use the custom GUI for that particular parameter (see CUSTOMGUI); you don't need to do anything with GetDDescription().

best wishes,

On 23/01/2015 at 10:54, xxxxxxxx wrote:

thanks Sebastian, I will test it and come back to you.

On 23/01/2015 at 14:43, xxxxxxxx wrote:

after some reading in the SDK and other examples, here is what I want to combine:
1- a custom data type similar to datatype.cpp SDK example
2- I see a custom slider iCustomGui example from Niklas, in short it adds the "look" of the custom Gui to the Integer data type "where I want to add it to my newly created custom data type"

virtual LONG GetResourceDataType(LONG*& table)
    static LONG l_table[] = { DA_LONG, };  //This puts the slider into the "Integer Data Type" userdata section 
    table = l_table; 
    return sizeof(l_table);

this function is from CustomGuiData sub class

On 26/01/2015 at 00:54, xxxxxxxx wrote:


to associate a certain custom GUI with a datatype simply add the ID of your custom datatype to the above array.

In your custom datatype class you can define the default custom GUI used of that datatype by setting the DESC_CUSTOMGUI property in in GetDefaultProperties().

Best wishes,

On 26/01/2015 at 03:56, xxxxxxxx wrote:

Hi Sebastian,

thanks for the reply, I think I'm closer now to understand how it works, just got a few questions:

to associate a certain custom GUI with a datatype simply add the ID of your custom datatype to the above array.

1- how to do this? ^
2- in the SDK example, it uses a custom data type which is a three known types "Int32, String, Vector" , they are sub containers, what I want is just a single new data type "MYDATA"

In your custom datatype class you can define the default custom GUI used of that datatype by setting the [DESC_CUSTOMGUI ]( in in [GetDefaultProperties()](

thanks, I understand how to do this part.

On 26/01/2015 at 07:58, xxxxxxxx wrote:


to add an element to an array, simply add the element (in this case an integer number) to the array when you initialize it:

static LONG l_table[] = { DA_LONG, 123456789 };  

If your datatype should not include any content ("subcontainers") you just can ignore this and create a datatype that simply does not handle any data.

For questions no longer related to this thread's orignial topic please open a new thread. Thanks.

Best wishes,

On 26/01/2015 at 08:46, xxxxxxxx wrote:

thanks a lot for the help Sebastian 🙂, you clarified a lot today in this topic , a great support as always.