How to get bounding box with a VEX expression

   20589   3   3
User Avatar
Member
10 posts
Joined: Nov. 2018
Offline
I want the Capture Length of a Bend SOP to be always the size of the incoming geometry. getbbox_size(0).x and $BBX are not working, however I'm mostly just interessted in the VEX expression and not so much in HScript solution.

What am I doing wrong?

And before you suggest alternative solutions, my actual geometry is a little more complex than the simple Grid here, so it has to be the bounding box instead of just getting the width of the Grid with a ch() function.

Attachments:
getBoundingBox.hipnc (92.0 KB)

User Avatar
Member
1743 posts
Joined: March 2012
Offline
Parameters only support HScript (the default language) or Python (if you set the parameter's language to Python), not VEX. bbox(0,D_XSIZE)seems to work.

If you really want to use VEX, you can use an Attribute Wrangle with Run Over set to Detail to write the bounding box size to a detail attribute like @length = getbbox_size(0).x;, then read the detail attribute from the parameter like detail(0,"length",0), or something similar.

Hopefully one of those is what you were looking for.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
10 posts
Joined: Nov. 2018
Offline
That was very helpful, thanks.
User Avatar
Member
17 posts
Joined: Feb. 2017
Offline
super useful for me also,
thanks !
  • Quick Links