Store group name in a variable

   4864   7   1
User Avatar
Member
948 posts
Joined: April 2008
Online
I am trying to store my primitive group name in a variable in VEX and I would like to do it in a procedural way something like:

s@name = @group_*;

Off course this doesn't work, any tips?

Thanks.
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
8554 posts
Joined: July 2007
Offline
You can use Name SOP for this, but if you need more flexible way here is how to get all point groups that point belongs to

http://forums.odforce.net/topic/23822-how-to-get-the-group-name-from-points/?p=140187 [forums.odforce.net]

So just change it for prim groups
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
948 posts
Joined: April 2008
Online
Thanks dude!
I`ll try that!
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
55 posts
Joined: Nov. 2019
Offline
I am surprised to see how old this topic is and there is still no function in VEX that could achieve it. Something like isgroup() where you feed a string and it returns 1 if it that group exists and the point/prim/vertex is in the group, 0 if it exists but it is not in the group and -1 if it doesn't exist.

Is there something I am missing on why this function is not a good idea? Or is there already a function that can achieve something similar?

Thanks!
User Avatar
Member
93 posts
Joined: Dec. 2019
Offline
Cicuta
Something like isgroup() where you feed a string and it returns 1 if it that group exists and the point/prim/vertex is in the group, 0 if it exists but it is not in the group and -1 if it doesn't exist.

It is exactly what these functions do, except for the -1 for group existance, it will be 0 in this case :

inprimgroup() [www.sidefx.com]
inpointgroup() [www.sidefx.com]
invertexgroup() [www.sidefx.com]
Edited by ObeidaZakzak - Feb. 16, 2024 13:53:05
Houdini Pipeline Supervisor @ TAT Studio
User Avatar
Member
4515 posts
Joined: Feb. 2012
Offline
You can use the detail intrinsics for the groups.

i@found = 0;
string groups = detailintrinsic ( 0, "primgroups" );
if ( find ( groups, "group1" ) )
    i@found = 1;

Same for pointgroups, edgegroups and vertexgroups.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
8554 posts
Joined: July 2007
Offline
both of which are already mentioned in above links so I'm not sure what this missing VEX question is exactly about
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
55 posts
Joined: Nov. 2019
Offline
tamte
both of which are already mentioned in above links so I'm not sure what this missing VEX question is exactly about

I think I wasn't too clear about what I was looking for and for some reason I got mixed up the link in your first reply with a different post about the same topic that gave a python solution.

animatrix_
You can use the detail intrinsics for the groups.

i@found = 0;
string groups = detailintrinsic ( 0, "primgroups" );
if ( find ( groups, "group1" ) )
    i@found = 1;

Same for pointgroups, edgegroups and vertexgroups.

This was what I was looking for and indeed it is also explained in the link you provided.

Thanks and sorry for the missunderstanding!
Edited by Cicuta - Feb. 16, 2024 19:29:01
  • Quick Links