Jump to content

how to get Multi-Parms group menu


Recommended Posts

single group menu i can use 

cookInputPointGroups(context, myGroup, myDetailGroupPair, alone);

 

but when custom sop node need group menu as Multi-Parms 

 

such as "object merge" parameter "group" 

 

how to do get the select of group

 

 

Link to comment
Share on other sites

The key to the method is to supply the "parm_index" parameter, which defaults to 0 because the Group parameter is usually the first parameter of a SOP. If you want to run this for some other parameter, you need to give it an appropriate parm_index value.

 

eg. (untested code!)

int n = evalInt("num_groups", 0, context.getTime());
for (int i = 0; i < n; ++i)
{
     PRM_Name multi_group("group#");
     multi_group.harden();
     multi_group.instance(&i, 1);
     int parm_index = getParmList()->getParmIndex(multi_group.getToken());
     // call cookInputPointGroups with parm_index here
}
Link to comment
Share on other sites

  • 2 weeks later...
GU_DetailGroupPair myPointDetailGroupPair;

const GA_PointGroup *mypointGroup; 

 

mypointGroup = gdp->findPointGroup(group_name);

 
cout<<"no cook groupname: "<<mypointGroup->getName()<<endl;
 
if(cookInputPointGroups(context, mypointGroup, myPointDetailGroupPair, 0,true,0,attribindex) < UT_ERROR_ABORT);
{
cout<<"cook groupname: "<<mypointGroup->getName()<<endl;
}
 
the callback is:
no cook groupname: group1
cook groupname: __groupparse1__
 
why?
can someone help me?
Link to comment
Share on other sites

cookInputPointGroups() returns "mypointGroup" as the group parsed by evaluating the parameter "attribindex". This creates an internal group since the string can by just like "0-9" meaning the first ten points.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...