On 15/11/2015 at 12:45, xxxxxxxx wrote:
Cinema 4D Version: R17
Platform: Windows ;
Language(s) : C++ ;
Can i add a container parameter in an ObjectData plugin (as the effector list in Cloner)?
I need to drag and drop materials in that container. Can i do that ?
If not, can i add a custom checkbox in C4D materials ?
I have a renderer that handles internally the C4D materials. Sometimes these materials have to be recalculated in each frame (this is user defined). So, somehow, the user must discrete those materials that has to be recalculated and those that don't. How can I do that ?
Thank you for your time.
On 15/11/2015 at 13:33, xxxxxxxx wrote:
You can use User Data to add parameters to existing items such as objects, tags, materials, whatnot. This can be done in situ by any user but can also be done programmtically using the SDK as well. Check it out in the interface (Attributes Manager), in the C4D Help, and search here about doing it with C++.
If you are programming an ObjectData plugin, you can add any description parameters you want either in the .h/.res files for it or by adding them dynamically using GetDDescription().
As for the functionality you are describing, this could be attacked in several ways. You could add an In_Exclude (see Description Resource in the C++ API Documentation) list to your ObjectData plugin wherein the user could drop materials that need to be recalculated. You could present a list of all materials in the scene and have the user check/uncheck for the same functionality. No matter which way you go, you need to maintain that list. With In_Exclude, the list and its states will be maintained by C4D. Other solutions might require you to maintain them (using Read(), Write(), CopyTo() for instance).
On 15/11/2015 at 15:13, xxxxxxxx wrote:
In_Exclude is what I had in mind as well.
How can I access that list though ?
How should I use the returned GeData of
object.GetParameter(DescID(LIST_PARAM), ge_data, DESCFLAGS_GET_0) ?
On 15/11/2015 at 16:30, xxxxxxxx wrote:
An "Advanced Search" here using In_Exclude will yield the answers faster than I could collate them for you. It isn't difficult but a bit involved to get the customdata and go through the list of items.
On 16/11/2015 at 08:41, xxxxxxxx wrote:
there are also examples on In_Exclude lists in the SDK examples: gedialog_gadgets.cpp, objectdata_descriptions.cpp
On 18/11/2015 at 03:39, xxxxxxxx wrote:
That was really helpful.
I have created an In_Exclude list and i add there my objects.
Each object has 1 flat with 2 states (on and off)
I want to use the same states used in effector list of cloner.
Where can i find the ids for these 2 icons ?
I couldn't find it in API or in the forum.
On 18/11/2015 at 04:24, xxxxxxxx wrote:
in your Cinema 4D installation directory go into "resource/modules/c4dplugin/icons", there you find the image providing the actual icons plus a text file with icon IDs.
On 18/11/2015 at 06:13, xxxxxxxx wrote:
Thank you very much for your support Andreas !
Allow me please to ask something last which troubles me for a while.
I have an object data which has an InExclude parameter.
I get the InExcludeData* using this (it works great) :
BaseContainer* data = object->GetDataInstance();
InExcludeData* in_exclude_data =(InExcludeData* )data->GetCustomDataType(IN_EXCLUDE_LIST_PARAMETER, CUSTOMDATATYPE_INEXCLUDE_LIST);
The following doesn't:
if (object.GetParameter(DescLevel(paramID), parameter, DESCFLAGS_GET_0))
in_exclude_data = (InExcludeData* )parameter.GetCustomDataType(CUSTOMDATATYPE_INEXCLUDE_LIST);
The in_exclude_data->GetObjectCount() returns an undefined value and in_exclude_data is not null.