Group by pattern with condition?

   4231   3   2
User Avatar
Member
2 posts
Joined: May 2016
Offline
Hi All,

I am trying to specify a particular surface selection based on extrude dist, so I added the following condition inside group's pattern field as follow:

if(ch(“../polyextrude2/dist”) == 0, 13, 19)

But it does not work. Any idea how to resolve it?

-K
User Avatar
Member
948 posts
Joined: April 2008
Offline
It is not going to work because the parameter ‘dist’ is a parameter global value, in order to Houdini recognize a value per component it needs to be an attribute, you need to find a way to create an attribute per face that stores this value so you can later use those values in the expression to evaluate your condition per component. I suggest you take a look on how attributes work on Houdini first, in the Sidefx website there are some good tutorials about this. I hope that helps.
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
did you put it in backticks?
User Avatar
Member
1743 posts
Joined: March 2012
Offline
ikkman
…I added the following condition inside group's pattern field as follow:

if(ch(“../polyextrude2/dist”) == 0, 13, 19)

The field is a string parameter, not a numeric parameter, so try
ifs(ch("../polyextrude2/dist") == 0, "13", "19")

Also, string parameters are a bit different than other parameters, in that you have to first “Toggle Expression” (under RMB > Expression > Toggle Expression), and then “Edit Expression” (under RMB > Expression > Edit Expression). It won't automatically switch to using an expression if you just type, even if you've done Toggle Expression. Many people put the expression in backticks instead, which works, but then it's a bit less obvious how to see what it evaluates to.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
  • Quick Links