Notifications
Clear all

[Closed] polyop.movevert with softselection gives different results than when moving by hand

Hi guys,

I have a script that moves the verts of one mesh to another but when I use polyop.moveverts with the useSoftSel as true I get a total different mesh than when I move the verts by hand. Any ideas why this happens?

Thanks,
Anton

7 Replies

I’d be interested in learning how to go about using Soft Selection via MXS as well.

I have seen this problem too. I guess the polyop.movevert does not take the weight of the vertex into account. So you must get the weights and multiply the move values with it in your script. Like this:

for i=1 to nvert do
(
vdata[i] = polyOp.getVDataValue epoly 1 i
)

Now scale the move distances using vdata[i]

Hi Psan, that makes sense but I am not sure how to apply that as I am feeding the polyop.movevert only the verts with weight of 1 as an array. By using the useSoftSel option it automatically finds and moves the other verts that are part of the soft selection so there is no way for me to multiply the weight unless I am missing something…

Here is a quick sample on how I’m using the function:


vertsToMove = #{1,2,3}
vertOffsets = #([1,1,1],[1,1,1],[1,1,1])

polyOp.moveVert polyObj vertsToMove vertOffsets useSoftSel:true

Thanks,
Anton

Hi
With useSoftSel:true, I’m, guessing that you must supply all the verts to this function. When you supply only the ones with weight 1, only those are moved.

That was my initial thought but it doesn’t make sense that way. You would have then to feed all the verts in the mesh and calculate the soft selection for each of them prior to feeding the offsets array to the movevert function… right? Then what is the purpose of the useSoftSel option?

Ya, movevert doesn’t automatically go to every vertex and move it, so you must feed it all, like #{1…nvert}. But you don’t need to calculate softselection, just feed an offset array with same offsets for all. I tried it as an experiment and it worked.

polyop.moveVert $ #all [1,1,1] useSoftSel:true

this way it moves the verts that are selected and affected by the soft selection…