MadMax50 Posted June 25, 2018 Share Posted June 25, 2018 I have a color ramp on the Y value of an object. To properly use the ramp I have to remap the P.y from 0-1 respectively. Now, instead of manually going into the geometry spreadsheet and searching for the largest P.y value, I created an attribute called "myMax" and used the max function to automatically grab the largest Y value. How do I drive my fit range with this new attribute instead of manually typing it in? I would like to proceduralize this as much as possible. I thought I could just type @myMax in the fitrange max source value but apparently it doesn't work like that.. I even tried it in vops by hooking up a bind and typing myMax... Thought that would have worked for sure... someone please help! findMaxY.hip Quote Link to comment Share on other sites More sharing options...
merlino Posted June 25, 2018 Share Posted June 25, 2018 Instead of using the attribute wrangle, you should promote the P attribute from "point" class to "detail" class, and if you want the max value from the positions, you can specify "Maximum" as promotion method. Rename it as maxP (for example) and bind that parameter in your VOP, just use a get vector component and select "Compoment 2" so you read the Y channel. Another option is using the attribute wrangle running ovber "detail" with an expression like f@myMax = getbbox_max(0).y; this way you get the Y componente of the bbox of the object. The problem with your expression is that it runs over all the points, (that's what an attribute wrangle does, it iterate over every geometry's component, in your case every "point") so the expression simply returns 0 if P.y is negative, and @P.y if @P.y is positive and store that result on a new Point variable called myMax. Quote Link to comment Share on other sites More sharing options...
logix1390 Posted June 28, 2018 Share Posted June 28, 2018 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.