THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/04/2012 at 21:54, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
Hi folks,
I have the following code sitting in a dialog, and is run when a button is pressed:
BaseContainer *bc_Cube = obj->GetDataInstance();
InExcludeData *List = (InExcludeData* )bc_Cube->GetCustomDataType(7005, CUSTOMDATATYPE_INEXCLUDE_LIST);
BaseObject *cube = BaseObject::Alloc( Ocube );
if(!cube) GePrint("Cube failure");
cube->SetName("Cube");
cube->SetAbsPos(Vector(0,0,0));
doc->InsertObject( cube, NULL, NULL );
List->InsertObject(cube, DESCFLAGS_SET_0);
EventAdd();
I'm wanting to put the cube into a custom InExclude list that's on object "obj". The container ID is 7005. It all compiles, but crashes when run inside Cinema.
Here's the description code in my "obj" object for the customgui element (does this look right also?) :
cid_list = DescLevel(ID_TAB_LIST, CUSTOMGUI_INEXCLUDE_LIST, 0);
if (!id_List || cid_list.IsPartOf(*id_List,NULL))
{
BaseContainer locked = GetCustomDataTypeDefault(CUSTOMGUI_INEXCLUDE_LIST);
locked = GetCustomDataTypeDefault(CUSTOMGUI_INEXCLUDE_LIST);
locked.SetString(DESC_NAME, "");
locked.SetString(DESC_SHORT_NAME, "");
if (!description->SetParameter(cid_list, locked, DescLevel(ID_TAB_LIST_GROUP))) return TRUE;
}
Where might I be going wrong here?
WP.