ScriptSpot home

Forum topic · Scripts Wanted

Create Named Selectoin Sets based on scene's materials

By 1rv · 2017-12-22

Description

Selection sets names should match corresponding materials names, of course.
Could someone help please?
Thanks

Comments (4)
1rv

Miauu, 1000 thanks!
P.S. Is it possible to modify so it'd create SelSets only from SELECTED objects?

Reply to 1rv
miauu

.

From materials applied to the selected objects?
Can you provide a test scene?

miauu

.



(	
	for sceneMat in sceneMaterials do
	(
		theObjsArr = for n in (refs.dependents sceneMat) where superClassOf n == GeometryClass collect n
		selectionSets[sceneMat.name] = theObjsArr
	)
)