CustomGui Data
-
On 18/08/2015 at 12:38, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16
Platform: Windows ;
Language(s) : C++ ;---------
Greetings !I have created a customgui extending the CustomGuiData class.
I use it in resource file as:
String MY_PARAMETER_NAME {CUSTOMGUI: MY_PLUGIN_CUSTOM_GUI}The class i use that extends CustomGuiData contains a DataStructure (lets say vector).
What i want to do is to use the GetParameter function of C4DAtom as
GeData parameter_data; my_tag.GetParameter(DescLevel(MY_PARAMETER_NAME ), parameter_data, DESCFLAGS_GET_PARAM_GET );
and somehow make parameter_data contain the complex data structure from CustomGuiData .
What i do now is serializing that vector to String is GetData and deserializing from string to vector in SetData of CustomGuiData subclass.
Can i avoid that and use the vector as it is in GetData and SetData ?Thank you.
-
On 18/08/2015 at 22:52, xxxxxxxx wrote:
you will need a CustomDataType class "plugin" , there is an example in the sdk.
BaseContainer* data = ((BaseMaterial* )node)->GetDataInstance(); GeData parameter_data; data->GetParameter(MY_PARAMETER_NAME , parameter_data); yourCustomDataTypeClass* cData = static_cast<yourCustomDataTypeClass*> (parameter_data.GetCustomDataType(YOUR_CUSTOM_DATA_TYPE_PLUGIN_ID));
-
On 19/08/2015 at 01:45, xxxxxxxx wrote:
Hello,
as Mohamed pointed out, there is a difference between data and GUI. The job of a custom GUI is to display the given datatype and to offer user interaction. The data itself is stored and handed over to the datatype.
So if your custom GUI should handle vectors, you should assign it to a parameter of the type vector. Or you create a new, custom datatype. You find an example on custom datatypes and GUIs on GitHub.
Best wishes,
Sebastian -
On 28/08/2015 at 10:02, xxxxxxxx wrote:
Hello peterakos,
was your question answered?
Best wishes,
Sebastian