从创建立方体开始,以下代码应选择顶部的两个三角形,反转该选择,然后删除那些新选择的面。到现在为止还挺好。但是,当基本立方体上有一个修改器(或更多)时,我似乎遇到了麻烦。
(
--clear the listener
clearListener()
theObj = $
-- init. an array to collect faces
selArray = #{}
invArray = #{}
append selArray 3
append selArray 4
-- get the number of faces in the object
theMeshCount = theObj.numfaces
-- invert the array
for f = 1 to theMeshCount do
(
if (selArray[f] == false) then invArray[f] = true
else invArray[f] = false
)
-- set the face selection in the EMesh
setFaceSelection theObj invArray
-- go to modify mode
max modify mode
-- select the mesh
select theObj
-- add the Mesh Select modifier
modPanel.addModToSelection (Mesh_Select ())
-- go to Face level
subObjectLevel = 3
--add a delete mesh, preserving the selection
modPanel.addModToSelection (deleteMesh())
)
那么我哪里错了?