resample sop

   5648   5   3
User Avatar
Member
282 posts
Joined: Jan. 2006
Offline
Hi. I want to set length parameter to $PR or $PT or use smth like point(“…..”, $PT, “….) or prim(”…..“, $PR, ”…..) but it doesn't work with variables.
What can I do to set length parm to some attribute value
Thanks
Houdini is great! O'right?
User Avatar
Member
460 posts
Joined: July 2005
Offline
Hi

you can use npoints(“../line1”)

which will get you the number on points in line1, just change the node there, or you could get what ever you input to the node like this

npoints(opinputpath(“.”, 0))


hope that helps
varomix - Founder | Educator @ Mix Training
Technical Artist @ Meta Reality Labs
User Avatar
Member
282 posts
Joined: Jan. 2006
Offline
Hi. Yes I know this. And this is nice. But not for me. I need to use attribute instead of npoints or nprims
Houdini is great! O'right?
User Avatar
Member
2199 posts
Joined: July 2005
Online
You can't, the resample sop doesn't cook each point and re-evaluate the parameters so using a local variable in that sop won't work.
The trick is finding just the right hammer for every screw
User Avatar
Member
282 posts
Joined: Jan. 2006
Offline
Ok. What about currnet primitive or current detail attributes?
Houdini is great! O'right?
User Avatar
Member
321 posts
Joined: July 2005
Offline
Wish
Ok. What about currnet primitive or current detail attributes?
If you are trying to resample non-uniformly, i.e. control the length of each segment individually, then your best bet is to take your set of values (one value per segment) into CHOPs, and integrate the length via the area CHOP. This will effectively add each individual length, and the resulting curve will be the distance from one end of each point. Then take your fixed-interval resampled points and with a point() function position each point according to the value of the area CHOP for that given point. Oh, you'll need to normalize the result of the area CHOP (math CHOP divide by max value of area CHOP), so that the max value is 1. The point() function has a nice feature where you can give it non-integer point numbers, and it will interpolate between adjacent point. Thus if you resample the original curve with 100 segments, point() position 95.5 is halfway between points 95 and 96.
Antoine Durr
Floq FX
antoine@floqfx.com
_________________
  • Quick Links