PDA

View Full Version : Script for "Selecting Faces by multiple ID's"


abyjoe
05-17-2008, 05:52 PM
is there a way to select faces by specifying multiple ID's

ZeBoxx2
05-18-2008, 12:15 AM
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)

abyjoe
05-18-2008, 12:26 AM
u are a star man... thanks again

CGTalk Moderation
05-18-2008, 12:26 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.