Jump to content
ch3

Efficient way to instance/copy geometry onto points

Recommended Posts

On 6/30/2015 at 6:22 PM, ch3 said:

Actually for the time being I don't need to modify the points afterwards, but it's important for me to be able to preview the result and modify the simulation in an interactive way.

 

 

So when copying a selection of packed primities on to points, how do you select which primitive will go on each point? The only way I know so far is using stamping which is rather slow.

 

 

 

 

On the other side I manage to find a better way. The instance node seems to be the fastest, but the problem is the various pieces need to exist at object level with a transform, which could be rather painful to build and manage hundreds of different pieces. So what I did was to export all my packed primitives into a single frame alembic archive and create an hierarchy using a pathAttribute. Then I imported the alembic file, which automatically creates and manages the hierarchy under one alembic node and re-constructed the necessary path at the point's instance attribute to determine which piece of geometry should go on each point. So far this works really well, but I still need to see how well it translates to arnold archive for rendering in maya.

 

thank again

An example hip would be super helpful. This is what I've been trying to achieve. Please share if you can. I realize it's ages past.

Share this post


Link to post
Share on other sites
On 7/9/2015 at 5:26 AM, Kardonn said:

 

A little trick I do because sometimes there's WAY too many SHOPS in the file to be worth taking the compilation hit...just make a little script that goes through all of the shop_materialpath values, makes a point or sphere or whatever you want for each, and attaches every single SHOP the asset needs to these placeholders. Then you either set them to phantom, scale them down to microscopic, etc., but having them in your scene with force Mantra to compile those SHOPS at render time and make them available to the packed objects.

An example hip please for us cool koo donkeys would be nice. Lol. Thanks for the tip though. 

Share this post


Link to post
Share on other sites
On 6/30/2015 at 11:13 PM, pbarua said:

I created a tool for faster instancing. Most of the tool is written in VEX.

It can instance live node from network and file from disk.

It's ultra fast compare to copy SOP. You will notice huge difference on more 100,000 points. 

File attached. Check and let me know if you have any difficulty.

copy_instancing.hipnc

pbInstance.hda.tar.gz

the instance node in your file is not loading in houdini H18

Share this post


Link to post
Share on other sites

It isn't really necessary to use fancy tricks for varying copy shapes in Houdini 18... the new Copy SOP has a pretty straightforward workflow for this. Pack each of the objects you want to instance and merge them, then on your template points create an integer attribute that will refer to the primitive number from the merge that you want to copy to each point. Then on the Copy to Points SOP just activate the "piece attribute" parameter and give it the name of the integer attribute you created on the template points.

  • Like 1

Share this post


Link to post
Share on other sites

Here's a scenefile to illustrate what toadstorm mentioned. A couple of ways to vary packed geo for the Copy to Points SOP,

all of them basically create a random integer attribute with values between 0 and 2.

image.thumb.png.fd40214dfcdd1fa0e2e45b73bcc6efb4.png

 

image.png.d8f52075050f9192986ffdd68b3bc810.png

Vary_Copies.hiplc

Edited by Yader

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×