При создании куба следующий код должен выбрать два верхних треугольника, инвертировать этот выбор, а затем удалить эти вновь выбранные грани. Все идет нормально. Однако, похоже, у меня возникают проблемы, когда на базовом кубе есть модификатор (или больше).
(
--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())
)
Так где я ошибаюсь?