Notifications
Clear all
[Closed] Script for "Selecting Faces by multiple ID's"
May 17, 2008 5:52 pm
fn selectFacesByMatIDs objs matIDs = (
getFunc = undefined
setFunc = undefined
for o in objs do (
oNumFaces = o.numFaces
if (classOf o == editable_mesh) then (
getFunc = getFaceMatID
setFunc = setFaceSelection
)
else if (classOf o == editable_poly) then (
getFunc = polyOp.getFaceMatID
setFunc = polyOp.setFaceSelection
)
else ( continue )
newFaceSelection = for i = 1 to oNumFaces collect (
if (findItem matIDs (getFunc o i) != 0) then ( i ) else ( dontcollect )
)
setFunc o newFaceSelection
)
)
-- select faces material IDs 1 or 3 in the currently selected objects
selectFacesByMatIDs (getCurrentSelection()) #(1,3)