Bandaciu, on 23 December 2010 - 06:17 AM, said:
I want just a part of the geometry generated in one iteration in Foreach SOP to be redirected to be processed again in the loop. The other part not (in fact the other part is the part that interest me and I want it untouched and added together with the ones from previous iterations).
As for the Feedback sop, oups, I don't know what to do with it...
A simple example could be making a procedural snowman with the foreach.
There are three balls that diminish in radius as the amount of iterations goes up. The bottom ball doesn't need anything added, the middle ball needs arms sticking out and the top ball (smallest) needs a face and a hat on top.
( $FORVALUE is replaced with stamp("..","FORVALUE",0) )
If you assume the biggest ball will be the first one ($FORVALUE==0) you could implement something like:
radius: fit($FORVALUE,0,2,10,3) -> using a fit function is convenient as you quickly remap that integer of the FORVALUE to a float with much more precision. (You can also use the $FORVALUE as a seed for a random function for a custom vop).
You also know the middle ball: ((0 + 2) /2)=>1
so you can put in a switch: if($FORVALUE==1)
So it switches to add the arms that you object merged into the subnetwork inside the foreach.
In the same way you can switch: if ($FORVALUE==2)
to object merge in some geometry for the face and merge it together with the current ball and the previous balls coming from the "each".
--if you want to make it more procedural so you have a snowman with 4,5,6,... balls, you can use the start and end values: ch("../numrange1") represents the startvalue, ch("../numrange2") represents the endvalue. So now your fit function becomes:
So to really answer your question: with object merge you bring in external geometry and you merge it with the geometry that has already been going through your network. You can use groups to maintain different streams of geometry, but I find working with groups becomes very slow very quickly. -- Same with exp
ressions... that's why I mentioned the vopsop and the $FORVALUE as a seed. If you have to evaluate a fit exp
ression 100 times versus execute a vopsop fit function 100 times the vopsop will be faster. So where you can put your math in vops, do it.