Jump to content
Juzwa

vex funtion: XYZ dimentions of a sop

Recommended Posts

Hi, 

I guess this is easy question. I ahve a Bound sop and I want to get its xyz dimentions. What is a vex function for getting sop dimentions? I've been trying to look into help  but Im not getting lucky.

Edited by Juzwa

Share this post


Link to post
Share on other sites

Just as an addendum, the very useful bbox functions work in wrangles. E.g

ysize = `bbox(0, D_YSIZE)`;

Will give you the size of the bound box in the y axis  

 

Share this post


Link to post
Share on other sites
3 hours ago, vtrvtr said:

Just as an addendum, the very useful bbox functions work in wrangles. E.g


ysize = `bbox(0, D_YSIZE)`;

Will give you the size of the bound box in the y axis  

 

It's very important to understand why that appears to "work". Your example uses an expression function that's evaluated while evaluating the string parameter for the wrangle's code. This happens before the VEX code is compiled, and means that the VEX code will keep being recompiled whenever the value is dirtied by the upstream SOP's geometry changing. That can have significant overhead, such as when running inside a foreach loop.

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×