XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : Select by effectsChannel within multiMat or sub map

02-11-2009, 02:55 AM
I've written this little tool to select objects by Object ID or by effects
Now I'm looking to dig through multiMaterials and submaps to look for a given effectsChannel.

My thoughts are to somehow collect all of the effectsChannel values (of each material and subs) into an array and then if finditem returns a value then collect the object... make sense? Any hints tips?


here is the working macro for anyone who wants it

macroscript SelectByGBuffer

try (destroyDialog ro_SelGBuff) catch()

rollout ro_SelGBuff "Select by GBuffer ID"
spinner spn_GBuffID "G Buffer ID: " type:#integer mwidth:70
button btn_SelectObjID "Select" width:100

on btn_SelectObjID pressed do
clearselection ()
select (for o in objects where o.gbufferChannel == spn_GBuffID.value collect o)

spinner spn_MattID "Material ID Ch.: " type:#integer mwidth:70
button btn_SelectMatID "Select" width:100

on btn_SelectMatID pressed do
clearselection ()
allGeo = (for g in objects where g.material != undefined collect g)
select (for i in allGeo where i.material.effectsChannel == spn_MattID.value collect i )
label lab_JCredits01 "By: me"
label lab_JCredits02 "---------"
createDialog ro_SelGBuff 180 140

CGTalk Moderation
02-11-2009, 02:55 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.