[Sidefx-houdini-list] vex sop for loop help

Rangi Sutton rangi.sutton at optusnet.com.au
Tue Oct 25 00:21:55 EDT 2005


Dave Nunez wrote:

>Hi there,
>
>I am having great difficulties optimizing a for loop in vex and was
>wondering if anybody had any ideas:
>
>
>	for (i = 0; i < ptnum; i++)
>	{
>	"custom function which calculates point positions x y z"
>	}
>	out = vop_floattovec (x, y, z);
>	P = out;
>
>  
>
Hi Dave,

I might have you wrong here.. but the very nature of a vex sop is that 
it does it "for each pt"... The same way a shader will run for each 
pixel sample. So your above loop is nesting a loop around every point 
for every point. When you assign P (or any other point attribute), it's 
implicetely for the current point. Check the docs and have a look at a 
few simple vex sops. Play with vops!

Beers,
r.




More information about the Sidefx-houdini-list mailing list