On 02/09/2015 at 11:22, xxxxxxxx wrote:
Cinema 4D Version: R16
Platform: Mac OSX ;
Language(s) : C++ ;
I'm looking for a clean example or some directions on how to add user data in c++.
I'm really confused, since I saw a part of an example where that person uses a BaseContainer to store the settings, but if you want to set the user data it must be of type void*.
Could somebody help me with this?
Thanks in advance for your help and time!
On 03/09/2015 at 02:30, xxxxxxxx wrote:
this is a simple example that creates a userdata group with a string parameter:
// This example adds a group and a child string user data parameter to the active object.
BaseObject* op = doc->GetActiveObject();
DynamicDescription* ddesc = op->GetDynamicDescription();
// make group
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_GROUP);
groupID = ddesc->Alloc(bc);
// make string parameter
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_STRING);
bc.SetString(DESC_NAME, "Text 1");
// set group as parent
I wouldn't know when a void pointer should be used. What example did you see?
On 03/09/2015 at 03:03, xxxxxxxx wrote:
Thanks for your answer!
I saw a python example, called Boids4Py, but it didn't help me that much.
And well, doesn't the parameter in SetUserData have to be a void pointer?
On 03/09/2015 at 03:14, xxxxxxxx wrote:
It is still not working.
I really have no idea what I need to fix it.
On 03/09/2015 at 03:22, xxxxxxxx wrote:
I didn't need a group user data, so I've changed it to the stuff I need, and it worked...
Here is my code:
DynamicDescription* ddesc = myObject->GetDynamicDescription();
if (!ddesc) return false;
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_REAL);
userDataID = ddesc->Alloc(bc);
Thanks for setting me upon the right path!!
On 03/09/2015 at 03:31, xxxxxxxx wrote:
One more thing though,
seems to do the same as:
I basically want to disable minimum and maximum values.
Any thoughts on this?
On 03/09/2015 at 05:30, xxxxxxxx wrote:
I have to note that I changed
Yet, the DESC_MINEX/MAXEX are still not working.
On 03/09/2015 at 09:49, xxxxxxxx wrote:
DESC_MINEX and DESC_MAXEX seem to work fine here. Please notice that these description options only apply to float parameters. The limitation is applied with floating point precision, so when your value range is 0 to 100 the possible values are limited to 0.0001 to 99.9999. The precision of the GUI elements is limited so they may round the values.
On 03/09/2015 at 09:56, xxxxxxxx wrote:
It seems like I was looking for the wrong stuff.
What I want is to disable the minimum and maximum value.
Is that possible?
On 04/09/2015 at 00:18, xxxxxxxx wrote:
what exactly do you mean with "disable the minimum and maximum value"? You don't have to set these values.
On 04/09/2015 at 01:27, xxxxxxxx wrote:
Well, if you create user data of data type float, you get two checkboxes (Limit Min/Limit Max) who are enabled by default. I simply want to disable them...
On 04/09/2015 at 09:43, xxxxxxxx wrote:
it seems that these check boxes are enabled by default, so I think you can simply ignore them.
On 04/09/2015 at 11:09, xxxxxxxx wrote:
Well, I want them to be disabled
Is there any way to do that?
On 07/09/2015 at 00:23, xxxxxxxx wrote:
as said before, it looks like that these checkboxes are enabled by default, independent of any settings. So it seems it is not possible to disable them using the parameter description.
On 07/09/2015 at 01:38, xxxxxxxx wrote:
Sorry, but in my opinion, that wasn't clear to me.
First, you said I can simply ignore them, the other time you say it's not possible to do;
Anyways, it's clear now, thanks for your answer!!