HtoA supports Houdini's instance object node, a powerful geometry instancing tool.
Notes about instancing support in HtoA:
- Houdini will set the rotations when instancing, depending upon a number of different point attributes. The logic is described here and the instancing in HtoA should work the same way.
- For instancing, use the Instance object with fast point instancing. HtoA doesn’t support full point instancing.
- You can assign material to instances with the shop_materialpath string attribute on the instance points.
- Fast point instancing supports per-instance user data and instance OBJ property overrides.
- Light instancing is not supported [yet]. Actually, Arnold itself doesn’t support light instances, but what plugins like MtoA and SItoA do is translate the light instances into duplicates of the light for Arnold.
- Procedural can be instanced (see below).
- The Copy SOP is not supported.
There are a number of ways instancing can be done in Houdini:
- Instance object
- Instance attributes
- Instance file
Example 1: Instancing a Torus Object
- Start off by creating a torus object.
- Connect the torus to a Scatter node. In the options for the Scatter, increase the Force Total Count to around 200.
Under Instance Object in the Instance tab, choose the torus. Change the Point Instancing to Fast point instancing. You should see now that the torus is instanced across itself.
- We can add some randomness to the points by using the following VEXpression code in a Point Wrangle node:
// Random Point Color:
float seed = 0.12345; // seed for rand
@N = rand(seed + @ptnum);
@N *= 2;
@N -= 1;
@Cd = rand(seed + 654654.1654 + @ptnum);
Example 2: Instancing Ass Files with Instance
- First you must render out a .ass file of the object to disk using an Arnold ROP node. Choose where to save the .ass file and select Render to Disk.
- Create an Arnold Procedural and choose the .ass file that was exported previously. In this case, it is a soldier model.
- Create an Instance node. The import points will represent the instances position, scale, and orientation (P, orient, pscale attributes). Enable Point instancing and under Instance Object, choose the Arnold Procedural object node which will point to the .ass file that was rendered to disk previously.
Example 3: Instancing Ass Files with Geometry and VEXpression
In this example, an Attribute Wrangle node (connected to a Scatter node) inside a Geometry node has been used to source the .ass file using the following VEXpression:
s@instancefile = "C:/Users/Documents/soldier_houdini.ass";