3dsmax maxscript:如何按照我选择的顺序获得顶点的数组/列表?

问题描述 投票:0回答:1

[我正在为3dsmax写一个工具,要求用户按照在数组中选择它们的顺序来获取选定的顶点,但是到目前为止,这将按照其创建的顺序返回顶点:

sel = getCurrentSeletion()
selvets = vsel[1].selectedVerts

如何使用maxscript在3ds max中以选定的顺序获得选定的顶点?

如果maxscript中没有办法,有没有办法在python中做到这一点?

python selection 3dsmax maxscript
1个回答
0
投票
如果只关心顶点的位置,则可以改用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

© www.soinside.com 2019 - 2024. All rights reserved.