# Point Instancing From Houdini
This guideline will focus on creating Point Instancing from Houdini / Solaris and read it back in Maya through Multiverse. We are going to use the same examples from the Point Instancing From Maya document which is scattering instances of mushrooms.
# Writing the sources as USD from Maya
When instancing in Houdini we can use any source of data, it could be from SOP level or even referencing an asset that was modeled in Maya. In this example the sources are coming from Maya. We need to make sure that each of the transforms are frozen so that the orientation when instancing in Houdini behaves as expected.
In Maya, select the Mushrooms group and Multiverse Asset Write as
mushrooms.usd
.
TODO: material export from Maya
# Point Instancing in Houdini
After we have the assets from Maya, create a Reference node in Houdini and make sure we are in the "Stage" network view.
Create the "Instance to Points" node. If we check the default settings from Instance to Points the Location Source is set to Internal SOP, which is what we want here.
Since we use Internal SOP to create the point scatter, double click the Instance Points node and create the points that we’d like to use for our mushrooms.
Please see the image below for the steps:
- Add a poly grid.
- Add a scatter node to scatter points based on the poly grid input.
- Finally add a Point SOP where we define the scale and the orientations.
Connect the Reference node to the first input of Instance to Points node. The first time we connect it, the instancer will complain that it doesn’t find any "Prototype Primitives" to be used as the source for instancing. So all we have to do is go to the Prototype section in the Instancer and in the Prototype Primitives delete the default string and press a drop down menu on the side and select "All Mesh Primitives". Houdini will add an expression to make sure that it will instance any Mesh Primitives that comes from First Input of the instancer.
Now we should have the mushrooms properly instanced with random transformations and random meshes. The default Prototype Index in the instancer already set to Random so we shouldn’t do anything unless we want to customize it.
Last step would be writing the instance. Create a USD ROP and connect the instancer the ROP. We need to set Output File and change the Save Style to "Flatten All Layers (Collapse All Sublayer, Preserve References)".
Once we have successfully written the data, we can read it back into Maya with Multiverse.
If we inspect from MEOW we should see the Point Instancing from Houdini to work exactly the same as we did in the Point Instancing From Maya guideline.
# Conclusion
Point instancing from Houdini is very powerful: if we use USD assets from Maya with attributes being set, such as for example "material assignment", make sure after setting up your instancing in Houdini that when writing out the resulting instances the original attributes are being preserved as-is, this way when they come back to Maya material assignment is preserved and they will shade accordingly. This workflow speed up tremendously production work.
This concludes the guideline for Point Instancing from Houdini.