ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Hi How can i select all the objects in the scene by its material name?
lets say material name is "Grass1" i want to have a button you press it and it only finds material name called "grass1" thanks
-- function
fn findObjsByMtlName name = (
local theObjs = #()
theMtl = (for m in sceneMaterials where \
m.name == name collect m)[1]if theMtl != undefined do(
theObjs = for n in (refs.dependents theMtl) where \
superClassOf n == GeometryClass collect n
)
theObjs
)-- usage
select (findObjsByMtlName "Grass1")
* note - this function is case sensitive, ie "Grass1" is not equal to "grass1"
Comments
try this
* note - this function is case sensitive, ie "Grass1" is not equal to "grass1"
my recent MAXScripts RSS (archive here)
Thanks allot! Works
Thanks allot! Works perfectly...
like i said before the forum needs you :)