Syntax to query if a field is blank

   3451   3   1
User Avatar
Member
100 posts
Joined: 8月 2014
Offline
So hopefully this is simple.

So I need to know how to write an expression that is equal to a blank field. Specifically a group field.

I am trying to write an expression in a “switch” node that does one thing if the group filed is blank.. otherwise us the string(group) they have entered.

this is what i think it should be houdini does not agree.

ifs(ch(“../Link_LinearVerts_to_points/group”) == ``, 1, 0)

ifs(ch(“../Link_LinearVerts_to_points/group”) == 0, 1, 0) - this passes syntax but does not work, it always sees the field as not equaling zero.

Thanks for your help, Ken
User Avatar
Member
1922 posts
Joined: 11月 2006
Offline
You can use the strmatch() expression.
ifs(strmatch(chs(“../Link_LinearVerts_to_points/group”), “”), 1, 0)
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
100 posts
Joined: 8月 2014
Offline
Thank you!
User Avatar
Member
7 posts
Joined: 10月 2016
Offline
Not sure why Grahams solution did not work for me, but I found a "strlen" function that did the trick:
ifs(strlen(chs("../node_name_override")), 1, 0)
  • Quick Links