Been trying to wrap my head around this one for a while but after a few days of being completely stuck it would be amazing to get some help with this point deform problem I'm having.
I've got a pretty simple set-up (or so I thought) that's using the grain solver for quick softbody deformation, I've got three primitives scattered onto some geo which is then being fed into a dop net for simulations,
That part is working well, (and works fine when I want to deform a single object) the only issue I have is when I want to re-attach the original mesh to these objects with a point deform while dealing with multiple input geo's. I've been trying to create a for-each connected primitives loop for my point deform node so the in an attempt to have each piece recognised as its own object however I'm getting some strange deformations on my objects when I try to point deform them.
To avoid loops, one technique I use is to move the rest inputs apart in space, so each island shares no bind points. The point deform supports ‘deform only’ and ‘capture only’ modes that work in conjunction with this technique. Since capture data is only an array of indices and weights, translations have no affect on capture data.
To reduce the impact of float precision when there are a large number of islands, I encode the index (the island's identifier) as a cell position in 3-space.
a cell pattern can be computed from index as so:
intsx,sy,sz,i;
floatx,y,z,pitch;
intnumelem = number_of_elements(); // pseudocode, insert the relevant value/function herei = @id; // use your identifier index herepitch = spacing; // space width of each cellsx = stride_x; // number of cells in xsy = stride_y; // number of cells in ysz = sx * sy;
z = i / sz - numelem/sz/2;
y = (i % sz) / sx - sy/2;
x = (i % sz) % sx - sx/2;
@P += set(x,y,z)*pitch;