Equivalent of old Group SOP expressions?

   1535   6   1
User Avatar
Member
59 posts
Joined: 4月 2006
Offline
So one thing I find intensely annoying in H18 is the lack of expression capabilities in the new Group SOP. What, for example, is the new syntax for the following expression from the old Group SOP?

($BBZ < 1.0) && ($BBZ > 0.95)

I'd like to make a group out of all the points whose Z bounding box coordinate is less than 1.0 but greater than 0.95. Even assuming I go to the (tedious) trouble to create an attribute called, say, BB to store the bounding box values (because the new Group SOP does not allow referencing locals anymore), I still can't seem to put compound conditionals in the Base Group parm like this:

@BB.z<1.0&&@BB.z>0.95

Not only is this horribly unreadable thanks to the inability to use spaces in the new expression syntax, it doesn't even work.

Alternatively, is there a way to drop down the old Group SOP in H18?
User Avatar
Member
209 posts
Joined: 3月 2018
Offline
Hi there!
Please stick with Group by Expression node since it is based on VEX therefore more efficient than old one!

Attachments:
Group by Expression.hip (137.0 KB)

User Avatar
Member
59 posts
Joined: 4月 2006
Offline
Thank you for that example. It was very helpful.

I have to say, though, that this VEX-based approach to things is incredibly obtuse and inconvenient compared to the older methods that the old Point and Group SOPs used to provide. This is especially true for setups that aren't overly complex or slow to cook. Many times, clarity of intent–which a simple expression like “($BBZ < .95) && ($BBZ > 1.0)” expresses very clearly and succinctly–is preferred over an esoteric collection of multi-parms like in the Group by Expression SOP which happens to execute faster.
User Avatar
Member
209 posts
Joined: 3月 2018
Offline
If you still insist on using old group try following code on HScript textport then:
cd /obj/geo1
opadd group
User Avatar
Member
59 posts
Joined: 4月 2006
Offline
Ah, that's very helpful!

I also see that opadd pointcreates an Old Point SOP, which might be handy as well.

Thanks!
User Avatar
Member
7733 posts
Joined: 9月 2011
Online
I would recommend against resurrecting old nodes. They're hidden because they intend to remove them at a future date, and are only present for opening old scene files.
User Avatar
Member
21 posts
Joined: 12月 2008
Offline
You can also drop down a wrangle, it's almost exactly the same syntax as ($BBZ < 1.0) && ($BBZ > 0.95)

vector BB = relbbox(@P);
@group_mygroup = BB.x<1 && BB.z>0.95;


And I agree with @jsmack, do not use old SOPs, some have been deprecated for a few years already.
  • Quick Links