sibarrick Posted April 15, 2006 Share Posted April 15, 2006 Hi, How do you make a group menu choicelist replace and not append? That is I have a string parameter that has a choice menu that lets you pick named prim groups, but it seems to default to the normal append type, where each time you pick a group from the dropdown it adds it to the field. I want to just make it replace so you can only pick one group name at a time. So this is what I have at the moment PRM_Template((PRM_Type)(PRM_STRING|PRM_TYPE_LABEL_NONE), 1, &names[5], 0, &SOP_Node::primNamedGroupMenu), Any ideas how to modify this to make it replace? There is a PRM_ChoiceListType called PRM_CHOICELIST_REPLACE but I'm not sure how to combine it with the group menu type which is defined in the SOP_Node class as static PRM_ChoiceList primNamedGroupMenu; ta Quote Link to comment Share on other sites More sharing options...
edward Posted April 16, 2006 Share Posted April 16, 2006 I think you need to build your own PRM_ChoiceList then to use PRM_CHOICELIST_REPLACE ... something like ... #define POINT_GROUP 0x01 #define PRIM_GROUP 0x02 #define BOTH_GROUPS 0x03 #define EDGE_GROUP 0x04 #define BREAKPOINT_GROUP 0x08 static void buildNamedPrimGroup(void *data, PRM_Name *menuEntries, int thelistsize, const PRM_SpareData *spare, PRM_Parm *parm) { SOP_Node *sop; int value; sop = CAST_SOPNODE((OP_Node *)data); if (sop) { sop->buildInputGroups(0, menuEntries, thelistsize, PRIM_GROUP, 0, false, parm); } else { menuEntries[0].setToken(0); menuEntries[0].setLabel(0); } } static PRM_ChoiceList thePrimChoiceList(PRM_CHOICELIST_REPLACE,buildNamedPrimGroup); Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 16, 2006 Author Share Posted April 16, 2006 Cheers Edward. I thought it would be something simply There's no way i'd have figured that out for myself. Many thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.