ChrisCousins Posted January 5, 2020 Share Posted January 5, 2020 (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 Edited January 5, 2020 by ChrisCousins extra info Quote Link to comment Share on other sites More sharing options...
JH12 Posted January 7, 2020 Share Posted January 7, 2020 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? Quote Link to comment Share on other sites More sharing options...
ChrisCousins Posted January 7, 2020 Author Share Posted January 7, 2020 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 Quote Link to comment Share on other sites More sharing options...
ChrisCousins Posted January 7, 2020 Author Share Posted January 7, 2020 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); Last problem to fix is that the rotations don't update - the orient value stays 0,0,0. Grateful for any assistance! Cheers - Chris Quote Link to comment Share on other sites More sharing options...
vtrvtr Posted January 7, 2020 Share Posted January 7, 2020 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 Quote Link to comment Share on other sites More sharing options...
ChrisCousins Posted January 8, 2020 Author Share Posted January 8, 2020 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.