MaxScript中GW使用范例一则
View Code
try(unRegisterRedrawViewsCallback DrawSelectedShapeVertexIndex) catch()
Fn DrawSelectedShapeVertexIndex =
(
GW.SetTransform(Matrix3 1)
SelectedShapes = for tempObject in Selection where SuperClassOf tempObject == Shape Collect tempObject
for tempShape in SelectedShapes do
(
SplineCount = NumSplines tempShape
for splineIndex = 1 to SplineCount do
(
vertexCount = NumKnots tempShape splineIndex
for vertexIndex = 1 to vertexCount do
(
vertexPosition = GetKnotPoint tempShape splineIndex vertexIndex
vertexScreenPosition = GW.wTransPoint vertexPosition
GW.wText vertexScreenPosition (vertexIndex as String) Color:green
)
)
)
GW.UpdateScreen()
)
registerRedrawViewsCallback DrawSelectedShapeVertexIndex
CompleteRedraw()