I am a beginner of Houdini. Now I would like to get the lowest Y position among a group of points. I have tried a lot, but them don't work. Is there any specialist can help me with that?
I really appreciate it!
Is there a way to get the lowest Y position among a group of points?
3719 3 1- lilianghan
- Member
- 6 posts
- Joined: Dec. 2018
- Offline
- mrCatfish
- Member
- 731 posts
- Joined: Dec. 2006
- Online
Easiest way way is to append an attribute promote to your node. Set it to:
Now you can access this detail attribute somewhere else using:
- Original name: P
- New class: detail
- Promotion method: minimum
Now you can access this detail attribute somewhere else using:
detail("../nameOfSop","P",1)
Edited by mrCatfish - Dec. 3, 2018 16:58:45
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
CG Supervisor
Machine FX - Cinesite MTL
- wesw
- Member
- 50 posts
- Joined: Jan. 2018
- Offline
- jpoopi
- Member
- 7 posts
- Joined: July 2014
- Online
Hi
this will give you the lowest position and the corresponding point number and put it in a group
this will give you the lowest position and the corresponding point number and put it in a group
vector bbmin = getbbox_min(0); float lowest_y = bbmin.y; //lowest postion in y setdetailattrib(0,"lowestY",lowest_y,"set"); // find the point number of the lowest y pos for(int pt = 0; pt<@numpt; pt++){ if(@P.y ==lowest_y){ setdetailattrib(0,"lowestPt",@ptnum,"set"); @Cd = {1,0,0}; setpointgroup(0,"lowestY",@ptnum,1,"set"); } }
Edited by jpoopi - Dec. 18, 2018 05:34:56
-
- Quick Links