THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/10/2008 at 09:26, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9+
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
---------
Howdy,
I'm trying to add a priority attribute to an object, so that the user can change the priority of the object's execution. I've got the priority data showing up in the object's AM with this in the .res file:
> \> INCLUDE Obase; \> \> GROUP Obaselist \> { \> PRIORITY MY_OBJECT_PRIORITY { ANIM OFF; } \> } \>
Then in the ObjectData::Init() function, I added these lines just like it is in an expression tag:
> \> GeData d; \> if (node->GetParameter(DescLevel(MY_OBJECT_PRIORITY),d,0)) \> { \> PriorityData \*pd = (PriorityData\* )d.GetCustomDataType(CUSTOMGUI_PRIORITY_DATA); \> if (pd) \> { \> pd->SetPriorityValue(PRIORITYVALUE_MODE,CYCLE_EXPRESSION); \> pd->SetPriorityValue(PRIORITYVALUE_PRIORITY,0); \> pd->SetPriorityValue(PRIORITYVALUE_CAMERADEPENDENT,FALSE); \> } \> else GePrint("no priority data"); \> node->SetParameter(DescLevel(MY_OBJECT_PRIORITY),d,0); \> } \> else GePrint("MY_OBJECT_PRIORITY not found"); \>
But when the object is created, the priority in the AM defaults to "Initial" and the console prints "no priority data". It doesn't print "MY_OBJECT_PRIORITY not found" so it's getting the GeData from the parameter.
Is there a different way you have to it with an object?
Also, I'm not sure how you'd get the value of the priority attribute to use in the ObjectData::AddToExecution() function to set the priority the user selected.
Can you give me an example of how to set this up on an object?
Adios,
Cactus Dan