rotate pivot

hello
I wanted to clone objects on selected polys of an object.
I didn't succeed.... (it has grown into a habit)
so I tried this :
example for a sphere :
- Break vertex
- detach all faces individualy (thanks soulburnscripts)
- apply my script, so I rotate pivot in face direction
- replace all these objects by another one (thanks soulburnscripts)

My problem is that my script rotate the pivot WITH the object.
No problem for what I want to achieve, but I don't like to see the objects rotate...
Can somebody explain what I've done wrong ?
Thanks.

-------------
for a in selection do
(
setrefCoordSys #local
CenterPivot a
theNormal=polyop.getFaceNormal a 1
maxOps.pivotMode == #pivotOnly
a.dir = theNormal
)
--------------

Comments

Comment viewing options

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

first off maxOps.pivotMode ==

first off
maxOps.pivotMode == #pivotOnly (should be =)

But it wont work like that anyway...

search for "Using Node Transform Properties" in maxscript help,
there's an example there that may help you

titane357's picture

thanks for help. I just found

thanks for help.
I just found what I needed....
If that can help :
-------------
fn RotatePivotOnly obj index=
(
rot = (matrixFromNormal (polyop.getFaceNormal obj index)*obj.transform ) as quat
rotValInv=inverse rot
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
for a in selection do
(
setrefCoordSys #local
CenterPivot a
theNormal=polyop.getFaceNormal a 1
RotatePivotOnly a 1
)
-------------

Comment viewing options

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