Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select objects with simiar diffuse color texture

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
MatthiasGose3847
734 Views, 2 Replies

Select objects with simiar diffuse color texture

Hey guys,

 

I have an issue here with imported meshes from another software package. For each imported object a new material is created however it references the same bitmap.

As this are hundreds it's quite nasty to reassign them.

So is there a way to do a little script where I can say. "Look for texture file "Enter-A-NAME.extension" in the dissuse color channel and select all objects which do reference this at once?

Search must rely on the bitmap name as materials and bitmap "name" are not equal 😞

 

I am a graphic nerd but weak in programming. You would save me hours of lifetime.

 

Regards

Matthias

2 REPLIES 2
Message 2 of 3

There's one important information missing, what kind of material is that? The following would work for a standard material: 

 

filename = @"C:\Path\image.jpg"

select (for obj in objects
	where isKindOf obj.mat standardMaterial and
	isKindOf obj.mat.diffuseMap bitmapTexture and
	obj.mat.diffuseMap.filename == filename collect obj)

 

Message 3 of 3

Awesome! Yes for standard materials. You saved me a lot of my lifetime ;). Thanks man!


Regards Matthias

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report