[我正在为3dsmax写一个工具,要求用户按照在数组中选择它们的顺序来获取选定的顶点,但是到目前为止,这将按照其创建的顺序返回顶点:
sel = getCurrentSeletion()
selvets = vsel[1].selectedVerts
如何使用maxscript在3ds max中以选定的顺序获得选定的顶点?
如果maxscript中没有办法,有没有办法在python中做到这一点?
pickPoint
功能。否则,请进行回调以更新选择更改并记录差异。例如(如果您当前的节点是可编辑多边形):try destroyDialog selectVerts catch()
rollout selectVerts ""
(
local verts, currentSel
fn collectVerts event nodes =
(
local sel = polyop.getVertSelection $
local newVerts = sel - currentSel
local removedVerts = currentSel - sel
for v in removedVerts do if (local index = findItem verts v) > 0 do deleteItem verts index
for v in newVerts do append verts v
currentSel = sel
)
local callback = nodeEventCallback mouseUp:on enabled:off subobjectSelectionChanged:collectVerts
checkButton chbSwitchCallback "Select verts"
on chbSwitchCallback changed state do
(
if state and isKindOf $ Editable_Poly then
(
verts = #()
currentSel = polyop.getVertSelection $
callback.enabled = on
)
else
(
callback.enabled = off
print verts #noMap
)
)
)
createDialog selectVerts