[Sidefx-houdini-list] Multiple copy inputs

Andy Nicholas andy at andynicholas.com
Thu Oct 13 05:48:06 EDT 2016

Hi Olivier,

Possible options for speed up:

* Pack your input primitives first. Either do it yourself, or use the 
setting on the Copy SOP. Generally I'd imagine it's better to do it 
yourself as you can tell it to only pack each of your primitives once, 
but I've not done any memory/speed performance testing on that.
* Split your points into separate groups manually and copy each 
primitive onto the corresponding set of points. Means you don't have to 
stamp, so should be a lot faster.
* Use a pointwrangle to set the instancepath attribute. Then use the 
Instance SOP to create packed geometry on each point. You can unpack if 
you want. It's still faster than copy stamping.

Here's example VEX code for setting the instancepath:

    string @instancepath;
    string str_arr[] = {"op:/obj/geo_sphere", "op:/obj/geo_torus",
    @instancepath = str_arr[@ptnum%len(str_arr)];
    float @pscale = 1.0;

* You could also consider using a VEX Wrangle node in a variety of 
different ways to copy the geometry, but that's a much longer 
discussion, and considerably more work. You do have the option though of 
figuring out the best way to parallelize the operation.

Using the Instance SOP is generally fastest as long as you don't need to 
do anything else to each instance. If you need something more complex 
and still need performance, then VEX is usually hard to beat, but there 
are plenty of caveats depending on your particular situation.


On 13/10/2016 10:07, Olivier Jeannel wrote:
> Hi there,
> When you have a CopySOP, with several "Primitives to Copy" to input (lets
> say you have cube, sphere torus and cone)
> A part from Stamping from a SwitchSOP, are there better / faster / stronger
> solutions ?
> Thank you :)
> _______________________________________________
> 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