[Closed] soft selection math
Hi guys,
I was trying last night to write a tool that moves a vert in a poly to a specified location and I wanted to implement the soft selection into it. So when I move one vert the rest in the soft selection area to be affected too. I’ve gotten their vDataValue but I cannot figure out what the math should be to get the same result as when you do in max.
Any ideea on how to calculate that or what is the algorithm max uses for that?
Thanks!
Same here – Ive been trying to find out the math of soft selection too for a while – maybe its just linear interpolation with a radius?
It’s easy.
Implementation:
(
local offsetTransformation = lastPos - firstPos
for eachVert in softVerts do
(
local softTransform = (PolyOp.GetVDataValue selection[1] 1 eachVert) * offsetTransformation
PolyOp.MoveVert selection[1] eachVert softTransform
)
)
Light
That’s pretty much what I have but the results are different from what you get when you manually do it… Check the attached image.
it isnt linear,
its based on a curve i think,
look at bubble and pinch…
Yes i think your right, bubble and pinch are just controlling the bias of the interpolation. I should be able to right the math i think for that…
vasilescu_anton – i think the results your getting are correct.
The non linearity of it is controlled by max through the color of the selected verts. When you read the VData for the soft selection channel you get values from 0 to 1 and those are plotted in a non linear fashion. The actual move should be linear…
Ok, my bad, the algorithm works perfect only I was trying to do it to multiple verts at once and then it would do that. With only one vert it does it properly! Thanks, Light!
How would you go about doing it for multiple verts at once? How do you choose the direction to move a vert that would be affected by more that one other vert?
So I got the time to get back to it and figure it out for multiple verts. Light’s algorithm works perfect and you just need to find for each of the verts in the soft selection which selected vert is it closest to then apply the formula based on that. Works as a charm.