THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/12/2007 at 15:11, xxxxxxxx wrote:
Cinema 4D Version: 10.111
Platform: Windows ;
Language(s) : C++ ;
in my expression tag, I use an InExcludeList Element to get a list of objects from the user. But I have some problems...
In the Execute() function, I do the following:
1. Get the List of objects that are linked in the InExclude box:
> GeData myList;
> tag->GetParameter(DescID(SCOOBYCAMEXP_LIST), myList, NULL);
> InExcludeData* SC_List = static_cast<InExcludeData*>(myList.GetCustomDataType(CUSTOMDATATYPE_INEXCLUDE_LIST));
2. Get the number of linked objects:
> LONG ListCount = SC_List->GetObjectCount();
But the value that is returned, is not always correct. For example, I have linked 6 objects in the list, it returns 6. But when I delete some of those objects from the scene (without removing them from the InExclude box first) it still returns 6.
I only want my calculations to be performed if there are at least 2 objects linked in the list. But because of the problem described above, the following code does not work:
> if (ListCount > 1)
> GePrint("Hello World");
It always prints "Hello World", even if there is only 1 or even 0 objects in the list.
What can I do? Is there some way to refresh the InExclude box? Do I have to free myList or SC_List at the end of the Execute() function? How would that work?
Best regards & big thanks for any help,