Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/08/2011 at 08:02, xxxxxxxx wrote:
User Information: Cinema 4D Version: 9.6+ Platform: Windows ; Mac ; Mac OSX ; Language(s) : C++ ;
--------- Howdy,
How can I get to the options of an Integer User Data through code?:
Adios, Cactus Dan
On 13/08/2011 at 08:08, xxxxxxxx wrote:
Hi, with C4DAtom::GetDynamicDescription you can browse through the userdata of an object. With DynamicDescription::Browse* and the retrieved BaseContainer you can access all these values. Cheers, Sebastian
On 13/08/2011 at 08:17, xxxxxxxx wrote:
Howdy,
Thanks Sebastian, but which container am I looking for that will be the "Options"?
That's probably how I should have worded the question.
On 13/08/2011 at 08:35, xxxxxxxx wrote:
DOH! The container is "DESC_CYCLE"!
Hehe, I should've known that.
On 13/08/2011 at 15:18, xxxxxxxx wrote:
OK, I can create a User Data popup menu, and I can detect if an object has a popup menu with this code:
Bool TestCommand::Execute(BaseDocument *doc) { BaseObject *op = doc->GetActiveObject(); if(op) { DynamicDescription *dd = op->GetDynamicDescription(); if(dd) { DescID dscID; const BaseContainer *bc; void *dscHnd = dd->BrowseInit(); while(dd->BrowseGetNext(dscHnd, &dscID, &bc)) { GeData gData; CDGetParameter(op,dscID,gData); if(bc->GetLong(DESC_CUSTOMGUI) == CUSTOMGUI_LONG) { BaseContainer *cycle = bc->GetContainerInstance(DESC_CYCLE); if(!cycle) GePrint(bc->GetString(DESC_NAME)+" - No DESC_CYCLE detected"); else { GePrint(bc->GetString(DESC_NAME)+" - DESC_CYCLE detected"); } } } dd->BrowseFree(dscHnd); } } EventAdd(EVENT_FORCEREDRAW); return TRUE; }
But, how would I get the number of entries that are in the popup menu?
I'm not only interested in the current value of the popup menu User Data, but I'd also like to know how many items are available in the popup menu.
On 17/08/2011 at 02:11, xxxxxxxx wrote:
Originally posted by xxxxxxxx I'm not only interested in the current value of the popup menu User Data, but I'd also like to know how many items are available in the popup menu.
Originally posted by xxxxxxxx
I think you need to manually count the entries in the DESC_CYCLE container.
cheers, Matthias
On 18/08/2011 at 08:48, xxxxxxxx wrote:
Thanks, Matthias. That worked.