multi object script

Hello

I made scripts to align vertexes (very basic script)

One is for record one vertex as a base

Other is to Align selected vertexes to the base vertex.

(nothing very fun, but very powerfull)

I would like to make this script work with polys, meshes, editpolys, splines,...
I think about "case of" method but I don't know how to....

If somebody can help... :-))

record base object:
--------------
global vertPosition
selectedVert = polyOp.getVertSelection $ as array
vertPosition = polyOp.getVert $ selectedVert[1]
------------------------
and (for z align)=
------------------------
selectedVert = polyOp.getVertSelection $ as array
for loopVerts =1 to selectedVert.count do
(
tempVert = polyOp.getVert $ selectedVert[loopVerts]

polyOp.setVert $ selectedVert[loopVerts] [tempVert.x, vertPosition.y, tempVert.z ]
)
-------------------------

Comments

Comment viewing options

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

There a simple example for

There a simple example for "case of" to start:

x = selection[1]
case of
(
	(classOf x == Editable_mesh): getNumVerts x
	(classOf x == Editable_Poly): polyop.getNumVerts x
)

my recent MAXScripts RSS (archive here)

titane357's picture

Thanks Anubis, I have an

Thanks Anubis,
I have an example in VGspack :-))

Comment viewing options

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