hi,
I have a problem and I wonder if a ForEach guru can nudge me in the right direction.
I am hoping to procedurally rig some eels with a wire deformer, so I need to generate a curve down the center of some low poly tube like models.
To get the concept, I've made up in my .hip a quick skinned tube from profiles copied to a curve, the plan being to drop into a ForEach loop by number method in order to extract the number of points per each profile, add a centroid point, delete the rest, loop through to the next 50 points, and so on, to be left with a set of points I can turn back into a curve running down the center of the skinned tube.
First time I have tried the ‘by number’ method and it doesn't work out for me. I can add a color ramp with UV's, partition group by color, then ForEach by group and it will work for the contents of the ForEach. (related question, anyone know a good method of creating groupps by proximity?). But I really want to get my head around iterating by a number and range of points.
In the .hip I left the first delete value hard wired with values and I get a point where I want. Same if I move it to 50-99 range or 100-149 range, and so on. (There are 1299 points, 50 per profile, 26 profiles). When I try the ForEach stamp values in the other node, they don't work as I thought.
So where do I pickup my iterations in the number method? (group, attribute, point or prim method all seem to pickup the stamp value automatically, no fuss). The stamp is not isolating 50 points, then moving on, as I would expect.
Also, in the range value at sop level for the node, the range end doesn't seem to want to accept incoming attribute values or point expressions for $NPT.
Sorry if I am missing something really obvious but much appreciated if you can point me the right way.
thankyou!
ForEach by number and range - it's not working out for me
4877 1 0-
- frankvw
- Member
- 61 posts
- Joined: Feb. 2006
- Offline
-
- draxysd
- Member
- 3 posts
- Joined: Aug. 2012
- Offline
Here is a fixed version of your file. The thing you need to query with the stamp is FORVALUE (by default, you can change it), which is referenced by either explicitly stating FORVALUE or stamp(“..”, chs(“../forstamp”) + “1”, 0). The other values you can find in the each node by default:
stamp(“..”, chs(“../forstamp”) + “2”, 0)
stamp(“..”, chs(“../forstamp”) + “3”, 0)
are for cases where you are iterating through a vector attribute in which case the attribute components are mapped in
chs(“../forstamp”) + “1”
chs(“../forstamp”) + “2”
chs(“../forstamp”) + “3”
(by default FORVALUE1 FORVALUE2 FORVALUE3).
Now, back to your problem, you referenced chs(“../forstamp”) + “3” which doesn't exist since you are iterating through scalar values (numbers).
As for the other question, you can proceuraly get the number of points in the incoming node with the expression:
chs(“../forstamp”) + “1”
since the $NPT is not defined for the foreach sop.
Cheers
stamp(“..”, chs(“../forstamp”) + “2”, 0)
stamp(“..”, chs(“../forstamp”) + “3”, 0)
are for cases where you are iterating through a vector attribute in which case the attribute components are mapped in
chs(“../forstamp”) + “1”
chs(“../forstamp”) + “2”
chs(“../forstamp”) + “3”
(by default FORVALUE1 FORVALUE2 FORVALUE3).
Now, back to your problem, you referenced chs(“../forstamp”) + “3” which doesn't exist since you are iterating through scalar values (numbers).
As for the other question, you can proceuraly get the number of points in the incoming node with the expression:
chs(“../forstamp”) + “1”
since the $NPT is not defined for the foreach sop.
Cheers
-
- Quick Links

