Jump to content
ChrisCousins

Instancing multiple objects onto DOP simulation

Recommended Posts

Posted (edited)

I'm hoping this is a fairly simple one, but I'm beating my head against the screen which doesn't seem to help ;-)

I'm working on a scene with a large number of various bottles and trays in a simple dynamics simulation. All bottles can be simulated as tubes, all trays as boxes. Simple enough.

What I can't seem to work out is an efficient way of instancing high-res bottles, trays etc over the proxy geo. My first idea is using an instance SOP with a 'DOP Import' node to give me the positions, using 'create points to represent objects', then varying the path with s@instance="obj/bottle1" etc; but although the points all seem to transfer fine, with data intact, the instances don't follow the point positions properly - the instances all come in at the origin of the sim and then explode out from there. I'm guessing I need to correct the first p/s/r values for each instance... but that's where I've ground to a halt.

Hope someone can help! I'll upload where I've got to if that helps. Cheers -Chris

 

Houdini_bottles_boxes.jpg

Edited by ChrisCousins
extra info

Share this post


Link to post
Share on other sites

Not entirely sure if you've already done this, but have you tried caching the simmed points out and then applying your instances to that, rather than re-running your sim with the new objects?

Share this post


Link to post
Share on other sites

Thanks for the reply. Cached on uncached doesn't seem to fix the problem. I've made a very simple chopped down version of the file, attached. I've got a feeling that the problem lies in extracting the intial transformations of the points, hoping there's a silly setting I've overlooked.

 

SimpleInstanceSetup.hiplc

Share this post


Link to post
Share on other sites

A bit of progress! Did some reading up, and found the problem with the positions was that they needed to be taken from the packedfulltransform intrinsic. So…

matrix m4 = primintrinsic(0,'packedfulltransform',@ptnum);
matrix3 m3 = matrix3(m4);
@orient = quaternion(m3);
v@pivot = primintrinsic(0,'pivot',@ptnum);

dop-inst.gif?raw=1

Last problem to fix is that the rotations don't update - the orient value stays 0,0,0. Grateful for any assistance! Cheers - Chris

Share this post


Link to post
Share on other sites

Here's an example of the workflow. Another one is virtually any RBD workflow, transferring transformations from low to high poly geo is very common in that domain. Basically all you need is consistent names, so the same would work if you instead would like to instance geometry from disk.

high_res_pieces_odf.hip

Share this post


Link to post
Share on other sites

Thanks for laying it out so clearly vtrvtr - all makes sense.

By doing it with instances I was hoping to avoid the memory overhead of using duplicated copies of the same geo. Instances just seem super-efficient, but it became more of a headache than it was worth. I've had a quick poke through your file though and using 'Pack and Instance' option on the high-res side of 'copy to points' does this automatically, and doesn't seem to affect naming process, so they all still match up nicely.

So -- solved! :-) Thanks again - Chris

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

×