Jump to content

Attribute driving a fit range value


MadMax50

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...