HDK: groups parsing

   3282   6   1
User Avatar
Member
128 posts
Joined: July 2005
Offline
If I have a stirng parameter which I may assign a space limeted group names list (as it happens automatically with ui) - do I need to tokenize it to access entries with separated findGroup calls, or it is sufficient to pass that string, to get all entries already united from different groups?

sample code

GB_PointGroup* ptgrp1 = gdp->findPointGroup(“group1”);
GB_PointGroup* ptgrp2 = gdp->findPointGroup(“group2”);

// …PARSE AND UNITE GROUPS
or

GB_PointGroup* ptgrp = gdp->findPointGroup(“group1 group2”);
// …GROUP IS ALREADY COLLECTED AND UNITED

which code is working?

Thank you!
Anything that flies
User Avatar
Member
7752 posts
Joined: July 2005
Offline
Look in the SOP_Flatten.C HDK sample for an example. In particular, look at the code related to the parsePointGroups() call.
User Avatar
Member
46 posts
Joined: Jan. 2012
Offline
Hello advance
is that posible parse the group parm with “*”??
when I use parsePrimitiveGroups(),
it just give a hole prims in one group “*”
have any body know how to loop specified group name from parm?

Thanks a lot!
User Avatar
Member
678 posts
Joined: July 2005
Offline
+1 to this topic. Some time ago I wrote to SESI support with almost the same question. I wanted to know what the hell is going on behind the curtain in each of the parseGroups() methods. Since I don't own Houdini or work in any company that use it (or in 3D industry at all), I couldn't get the answers. And there are no info about them in examples too.

I use it in one of my Sops but in another one where I needed to filter multiple groups it gived me strange results, for example, it didn't notice that one of the specified groups was not existing at all and and since other two where correct it parsed without noticing it. More examples about parsing parameters with built in methods would be really nice.
User Avatar
Member
7752 posts
Joined: July 2005
Offline
Sorry, I'm not sure what the confusion is? parseGroups(), parsePrimitiveGroups(), parsePointGroups(), etc. take a Houdini group pattern string value (ie. the values used for those Group parameters in SOPs) and generate a GA_ElementGroup subclass for use.

The parsing is not very strict on purpose, and their syntax is documented:
http://www.sidefx.com/docs/houdini12.5/model/groups#manual [sidefx.com]
User Avatar
Member
46 posts
Joined: Jan. 2012
Offline
hi edward
I just test the pattern,
if you type in the “grp*” then you will loop all prims or points in one group “grp*”, this function is not auto provide loop all name start with “grp” groups.
if anything wrong plz tell me.
and thanks for ur attention.!
User Avatar
Member
7752 posts
Joined: July 2005
Offline
I'm not sure what your problem is but I did a quick test with SOP_Flatten.C and two point groups (grp1 and grp2) and “grp*” did the expected thing.
  • Quick Links