From the course: Houdini: Particles

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create instance

Create instance - Houdini Tutorial

From the course: Houdini: Particles

Start my 1-month free trial

Create instance

- [Instructor] Alright, so now we're gonna create an attribute called "instance" that's a string attribute on each of the points that is actually the full path to the instance geometry we want on that point. And we're gonna use a node we haven't used yet, which is the attribute wrangle, so grab this little cowboy hat guy here, and the attribute wrangle basically allows us to do all this stuff we're doing in the point VOPs, but do it in code over here, and some of it is a preferential thing, how you like to work, and some things are easier to do in one context or another. So this is what we're gonna do. We're gonna write an expression, that basically for each of the points it's gonna randomly assign one of the four instance geometries based on a modulus of the ID number. So as we remember, let me close this, we have instance 00123, so if we use a modulus 4 on the ID attribute, we're gonna get a value that's zero, one, two, or three, so if we manually prefix it with everything up to the…

Contents