Jump to content

Instancing multiple objects onto DOP simulation


Recommended Posts

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
Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...