Min And Max Values From A Point Attribute

   14769   11   2
User Avatar
Member
691 posts
Joined: June 2006
Offline
Hi!!

In VOP SOP how can i find the Min And Max values of a point attribute from all the existent points in the input geometry?

Thanks
Feel The Knowledge, Kiss The Goat!!!
http://www.linkedin.com/in/alejandroecheverry [linkedin.com]
http://vimeo.com/lordpazuzu/videos [vimeo.com]
User Avatar
Member
4262 posts
Joined: July 2005
Offline
I don't think you can without looping through all the points. Its probably better to just use the AttribPromote SOP to do it for you, then look up the results.
if(coffees<2,round(float),float)
User Avatar
Member
1908 posts
Joined: Nov. 2006
Online
What Wolfwood said. Because of the way VOPs works you cannot get that information from a feature inside of your VOP network. The Attribute Promote is the best way to do it.

Attached is an example file that uses two of them to get the min/max as detail attributes and passes them to the Vop Sop using Parameter vops.

Attachments:
min_max_pt_attrib_in_vops.hip (56.0 KB)

Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
691 posts
Joined: June 2006
Offline
Thank you very very much.

But if i want to do in the VOP SOP; how is the workflow for looping all the points?

Thanks you!!
Feel The Knowledge, Kiss The Goat!!!
http://www.linkedin.com/in/alejandroecheverry [linkedin.com]
http://vimeo.com/lordpazuzu/videos [vimeo.com]
User Avatar
Member
4262 posts
Joined: July 2005
Offline
If you must then you'd use a For Loop VOP and the Import VOP.
if(coffees<2,round(float),float)
User Avatar
Member
1532 posts
Joined: July 2005
Offline
I've always maintained that such often-used values (min, max, avg) need to be stored at creation – can you imagine how much easier it'll be normalize attribute values for whatever devious purpose you might want?!

G
User Avatar
Member
8602 posts
Joined: July 2007
Offline
alejandro

But if i want to do in the VOP SOP; how is the workflow for looping all the points?

you probably do not want to do that
because it will be run for every point of your geo
so imagine you have 1000 points
when 1st point is processed it will invoke for loop which will import point 1000 times and calculate min, max, avg or whatever
and use that value for something
so far so good

but 2nd point will do the same thing, it has to loop through 1000 points to compute the value for itself because it cannot access min, max, avg computed by 1st point

so if 1000 points compute this value 1000 times then your code will be way slower than if you bring allready precomputed value from outside this VOP

this is how i understand VOPs, if it is wrong or not completely accurate please correct me someone
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
1532 posts
Joined: July 2005
Offline
Once again, not to dance around the issue, but to offer a workflow alternative:

I believe it might have been Jesta that turned me onto this particular trick many moon ago, but it works quite well.

in a branch off your network stuff your attribute into $TY. This will allow you to use $YMAX and $YMIN to look up the relevant bits of information.

Best,

G
User Avatar
Member
5 posts
Joined: Oct. 2017
Offline
keyframe
Once again, not to dance around the issue, but to offer a workflow alternative:

I believe it might have been Jesta that turned me onto this particular trick many moon ago, but it works quite well.

in a branch off your network stuff your attribute into $TY. This will allow you to use $YMAX and $YMIN to look up the relevant bits of information.

Best,

G
I understood your concern.
branch off your network stuff your attribute into $TY. This will allow you to use $YMAX and $YMIN. Stuck with the same kind of problem and kind of new to Houdini. can you explain me the process exactly?
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
@himkhu….your responding to the last post from 2009.

Perhaps you could post your hip with the issue so that someone might be able to help you.
User Avatar
Member
5 posts
Joined: Oct. 2017
Offline
BabaJ
@himkhu….your responding to the last post from 2009.

Perhaps you could post your hip with the issue so that someone might be able to help you.

so I have 1000 points in a 3d space, and i calculated the distance of each of them from the camera and stored in f@dist point attribute.
right now i am using attibpromote node 4 times ( first to promote min dist to detail second for max dist and then rest of the two back to point attribute ).

I am wondering what Mr keyframe implying is if you can store it in $TY and use query $YMAX and $YMIN would be the best alternative way of doing the same thing. but i am not sure what exactly has to be layed down in houdini to achieve this.

so if someone can explain the step by step process would be a great help.

thanks for the concern by the way didn't notice this post was from 2009. just stumbled upon it from google.
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
As for myself I don't know what he is referring too other than he is using an hscript approach using $TY and $TMAX $TMIN.

Which although is an old post is still perfectly valid way of doing something - its just I'm not versed well in Hscript and can't help you.

I do know a couple ways of doing it in a vex wrangle - but that's not what your interested in knowing , and I don't know if it would be more efficient than using the attribute nodes the way you have done.

Hopefully at some point someone can chime in for you on the Hscript at some point.



so if someone can explain the step by step process would be a great help.

To help someone help you, post your hip so its less work for them and more likely to respond. There can many different ways of doing the same thing. So if you give people your approach (your current step by step attempt), they might be able to respond with a simple comment or modification of your code. Otherwise, they just might not have the time to lay out an example for you.
  • Quick Links