检查模型是否为Editable Mesh文件,支持带skin蒙皮的模型
try(destroydialog checkmesh) catch()
rollout checkmesh "CheckMesh" width:162 height:300
(
fn checkmesh =
(
sel = getCurrentSelection()
------------------------------------
for a=1 to sel.count do
(
if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject != editable_mesh then
(
modPanel.setCurrentObject sel[a].baseObject
modPanel.addModToSelection(Edit_Mesh ()) --再加修改命令
maxOps.CollapseNodeTo sel[a] 2 off --塌陷到下方
)
)
--------------------------
for a=1 to sel.count do
(
if sel[a].modifiers[#skin] != undefined and classof sel[a].baseobject == editable_mesh then print sel[a].name
)
------------------------------
for a=1 to sel.count do
(
if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject == editable_mesh then print sel[a].name
)
--------------------------------
for a=1 to sel.count do
(
if sel[a].modifiers[#skin] == undefined and classof sel[a].baseobject != editable_mesh then ConvertToMesh sel[a]
)
)
button 'btn1' "CheckMesh" pos:[40,83] width:75 height:60 align:#left
on btn1 pressed do
checkmesh()
)
createdialog checkmesh