I need to use a copy to points after a rbd sim, but it doesn't work...
Any idea ?
For the test, i made a simple simulation with a pig head, then create points from the simulation, and when i copy to point the same pighead, it's not working. (blue head are from the simulation, red one are the one i tried to copy on it...)
The only way i can have the correct position, is by unchecked "transform using target point orientations", but then, i loose the rotation/orientation....
Hi, it seems that the pivot attribute is taking the points back to the origin, I don't know where it's coming from, but simply deleting the attribute will fix the issue.
Hm, here is a hot fix, but still not perfect. It seems when orient before packing, the origin/centroid of the pig heads get different from the orginal. So, copy to points after all cant work.
The best solution for now is to calculate the 'convex hull center' with the extractcentroid sop, and then subtract the vector for each point of the init. geo. Then import the geo back from the dops and set the import style to Fetch Geo. from.... In wrangle you can then extract a 3x3 matrix and calculate an orient out of it.
The DOP points have a restxform matrix attribute which will allow you to do what you want. First, add the "restxform" attribute to the DOP Import SOP's "Transfer Attributes" parm so the points get the restxform attrib. Create a point wrangle SOP and use this code:
4@transform = 4@restxform;
@P = 0;
Add an attrib delete SOP and set it to delete all attributes except "transform". Plug the output of the attrib delete SOP into the copytopoints SOP.
You now have all of the copied pig heads at their rest position and orientation. Now use a transform pieces SOP on them and use the points from the dopimport SOP to transform them.
npetit You now have all of the copied pig heads at their rest position and orientation. Now use a transform pieces SOP on them and use the points from the dopimport SOP to transform them.
Do you know if your approach works with rbd emitted every frame? Because i can't figure it out ;x