align point to y min of each primitive.

   1504   2   0
User Avatar
Member
13 posts
Joined:
Offline
Hi.
I I have a bunch of primitives and i am trying to create a point for each primitive and align each point to the corresponding y-min of each prim.

I can align to the center of each prim no probs but I can only align to the ymin of the 1st primitive( file attached i am assuming this isn't working because I am aligning to the y min of the whole object)

Any help would be greatly appreciated.

Cheers.

Image Not Found

Attachments:
align to ymin.hiplc (71.6 KB)

User Avatar
Member
1737 posts
Joined: May 2006
Online
Try this:

string prim = itoa(@primnum);
vector bbm = getbbox_min(0,prim);
vector bbc = getbbox_center(0,prim);

addpoint(0, set(bbc.x, bbm.y, bbc.z));
removeprim(0, @primnum, 1);

Your original code refers to all the geo entering the wrangle, not per-prim unless you explicitly tell it otherwise.
Edited by mestela - May 19, 2019 02:47:22
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
13 posts
Joined:
Offline
Thank you so much, that worked perfectly.

Man i wish i had the cash to do one of you Houdini courses at uts. I think i better just start saving.

Cheers,

Paul.
  • Quick Links