select multiple objects by material ID

i was not able to find a script that select all objects in the scene based on material ID

anyone?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

tassel, the link points to

tassel, the link points to this thread.

tassel's picture

Hehe, Think it's time to jump

Hehe, Think it's time to jump in bed ;)

Raymond H.Ingebretsen - http://www.homme3d.com

tassel's picture
miauu's picture

Something like this?

(
	local matID = 4
	local objWithMatID = #()
	local poGetMatID = polyop.getFaceMatID
	for obj in geometry where (classof obj) == Editable_Poly do
	(
		allFaces = polyop.getNumFaces obj
		notFound = true
		for i = 1 to allFaces while notFound where (matID == (poGetMatID obj i) ) do
		(
			append objWithMatID obj
			notFound = false
		)
	)
	if objWithMatID.count != 0 do select objWithMatID
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.