-------------------------------
(
arrSpline = for i in selection where classOf i == SplineShape collect i
-- get all knots
global arKnots = #(), mX = 0, mY = 0, mZ = 0
for i in arrSpline do(
for s = 1 to numSplines i do(
nk = numKnots i s
for k = 1 to nk do append arKnots #(i, s, k, getKnotPoint i s k)
)--end s loop
)
----------------
-- get mi value
arCount = arKnots.count
for i=1 to arCount do (
mX+= arKnots[i][4].x
mY+= arKnots[i][4].y
mZ+= arKnots[i][4].z
)
mX = mX/arCount
mY = mY/arCount
mZ = mZ/arCount
------------------
--set all knots
for i = 1 to arCount do(
knt = getKnotPoint arKnots[i][1] arKnots[i][2] arKnots[i][3]
--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--knt.x = mX
--knt.y = mY
knt.z = mZ
--!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
setKnotPoint arKnots[i][1] arKnots[i][2] arKnots[i][3] knt
updateshape arKnots[i][1]
)
)
----------------------------------
Управлять плоскостями можно этими строками:
--knt.x = mX
--knt.y = mY
knt.z = mZ
Удобен скрипт тем, что выравнивает вершины всех выделенных сплайнов в одной плоскости.