&& in group parameter?

   9903   11   0
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Hi all,

In the blast sop group parameter, I say if myAttrib is greater than five OR myOtherAttrib is equal to “test”:

@myAttrib>5, @myOtherAttrib=“test”

What is the syntax for performing an ‘and’ operation?
www.kmcnamara.com
User Avatar
Member
8837 posts
Joined: July 2007
Offline
I don't think there is specifically AND operator , but as there is ^(except) and !(not)

you can do :
@myAttrib>5 ^!@myOtherAttrib=“test”
in other words group if myAttrib is greater than 5 except if myOtherAttrib not equals “test”
so that would mean if myAttrib is greater than 5 and myOtherAttrib equals “test”

and btw. for OR use just space, comas are not allowed
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Great thanks. A little tough to read, but it works just fine for two conditions. Thanks!

My guess is that this doesn't work if you want to add a third ‘and’ condition, right?
www.kmcnamara.com
User Avatar
Member
8837 posts
Joined: July 2007
Offline
Why wouldn't it?
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Well it doesn't seem to work with groups. If I have three groups that represent P.x>0, P.y>0, P.z>0:

xpos ^!ypos ^!zpos

is not equal to:

@P.x>0 ^!@P.y>0 ^!@P.z>0

Is Houdini evaluating things differently when I'm listing groups? If I just have two clauses, it works fine. The addition of the third is where it diverges.

Note, just corrected an error in the .hip

Attachments:
blast_expression.hip (65.6 KB)

www.kmcnamara.com
User Avatar
Member
8837 posts
Joined: July 2007
Offline
it looks like it evaluates the pattern for groups incorrectly (bug?)
the result with attribute ad-hoc groups seems to be correct though

remember you can always use Group SOP/Combine tab to do more complex logic using both groups and ad-hoc groups
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
228 posts
Joined: Dec. 2012
Offline
Totally, just trying to streamline my larger setups and use as few nodes as possible

I'll submit the group eval as a possible bug.

Thanks!
www.kmcnamara.com
User Avatar
Member
4730 posts
Joined: Feb. 2012
Offline
Btw the Group SOP's Expression evaluation is extremely slow compared to Wrangle SOPs. So if you can do it using VEX, you would see a much better performance if you care about that.
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 | pragmaticvfx.gumroad.com
User Avatar
Member
1 posts
Joined: Feb. 2021
Offline
For anyone looking for a numeric replacement for && (e.g. selecting points between two values):

Group syntax uses '-' in the following manner:

@P.x = -0.05 - 0.05

(This will select everything having a position along x between -0.05 and 0.05.)
User Avatar
Member
25 posts
Joined: May 2023
Offline
Resurrecting an old topic: Is this still an issue? Still no way to logically combine conditions for the groups like "@attr1=val1 && @attr2=val2"?
User Avatar
Member
8837 posts
Joined: July 2007
Offline
voidcoder
Resurrecting an old topic: Is this still an issue? Still no way to logically combine conditions for the groups like "@attr1=val1 && @attr2=val2"?
You should still be able to do
@attr1=1 ^@attr2!=2
Like mentioned above
Edited by tamte - Oct. 10, 2024 01:59:22
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
3 posts
Joined: Dec. 2017
Offline
@attr1=val1 ^!@attr2=val2
Edited by HirotaY2 - Oct. 21, 2024 01:08:19
  • Quick Links