[Sidefx-houdini-list] For each in VOP

Jesse Erickson mr.nicey.pants at gmail.com
Tue Jan 26 16:59:55 EST 2016


Good advice up top :) Re: the old trick, you can just use a Primitive Vop
now. Vop Sops are deprecated and Attrib Vops will iterate over points,
verts, prims or run only once in detail mode. That's what I meant about
skipping the For Each Loop and just running it in a Primitive Vop! Lotsa
ways to crack this nut

On Tue, Jan 26, 2016 at 1:04 PM, Andrew Lyons <tstexture at gmail.com> wrote:

> and keep in mind that vex is SIMD, and runs in parallel where possible.
> Think of a vop sop as essentially a single function (or shader), and its
> multiple data input is every point in the first input. Last time I checked
> that last part was hard coded, so in some sense a vop sop is always a hard
> coded foreach loop over every point in the first input. Given this, the
> following code:
>
> For each Primitive:
>     Import P from Point index N°3.
>
> Is actually:
>
> Foreach point:
>     For each Primitive:
>         Import P from Point index N°3.
>
> And you may not want that.
>
> An old trick is to make sure your first input only has as many points as
> the number of iterations you actually want, and then index data from the
> second input. In your example, you would want npoints in your first input
> to match nprims. Use a facet sop to Unique points, a primitive sop to scale
> each Primitive to zero on its centroid, and then another facet/fuse sop to
> consolidate points to achieve that.
>
> After that - what Jesse said.
>
> Good luck!
> On Jan 26, 2016 4:49 AM, "Olivier Jeannel" <facialdeluxe at gmail.com> wrote:
>
> > Hi list,
> >
> > I'm looking for simple tutorial or example about the For Each Loop in
> VOP.
> > I've seen the Masterclass https://vimeo.com/142534639
> >
> > What I'd like to do is
> > For each Primitive, Import P from Point index N°3.
> > I managed to write it in vex, but I'm stuck reproducing this in
> AttribVOP.
> >
> > If anyone has 5mn :/
> > _______________________________________________
> > Sidefx-houdini-list mailing list
> > Sidefx-houdini-list at sidefx.com
> > https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
> >
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>



More information about the Sidefx-houdini-list mailing list