Some thing wrong with working - pivot ?

i make simple script , it move object pivot to normal select face , every thing is ok , but when i move selected face it not work , i dont know why , can you help me ?

my code :
-------------------------------------------------------------------

ar = (polyop.getFaceSelection $ ) as array
dd = polyop.getFaceCenter $ ar[1]
matran1 = matrixFromNormal (polyop.getFaceNormal $ ar[1])
matran = matran1 + (matrix3 [0,0,0] [0,0,0] [0,0,0] dd)
WorkingPivot.EditMode = true
WorkingPivot.setTM matran
WorkingPivot.UseMode = true
in coordsys matran move $.selectedFaces [0,0,1000]

-------------------------------------------------------------------

i think the problem is : can not use move select face in working pivot ? , is it 3dsmax bug ?

AttachmentSize
capture.png28.33 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexnguyen's picture

.

thank you for your help

miauu's picture

.

The working pivot stays where it was placed initialy. In your case its position is defined by the matran variable.
When you move the selected face, the matran variable is not recalcualted. Thw Wroking Pivot is not set to the new positoon.
To do it you can use the

when construct

to detect when the desired face is moved and to set the working pivot position(transformation).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.