ScriptSpot

Forum topic · Scripts Wanted

Select objects by texture (path)

By asymptote · 2012-05-25

Description

I have an imported scene with nearly 4000 objects, I run Relink Bitmaps to fix the texture paths, but if I show all textures in viewport, max hangs and crashes due too the hundreds of duplicate textures.
There are literally 100's of objects with the same texture.but different material colours.
Is it possible to select objects via texture ? I've tried all other methods in max and none do what I need,I don't fancy doing this manually.
I found this thread of a similar problem....

http://www.polycount.com/forum/showthread.php?t=60923

but no solution other than it may be possible via maxscript.

thanks

Comments (13)

asymptote · 2012-05-26

Thanks barigazy, my steps are now simply to select an object, pick material, run your script, apply material, then run soulburns attach all objects.
I optimize my scenes in no time ;)

barigazy · 2012-05-26

ok, i'm glad that my little script help you

asymptote · 2012-05-25

1. Diffuse only

2. I've Attached a summary info of the scene

3. I think so ;) I just need to select an object, and have max select all other objects using the same texture,Max has just about every selection method but this, then attach them to one mesh and apply a single texture, of course I can do the last steps manually.
What seems to happening as they all have separate materials max is loading hundreds of duplicates of the same texture.

4. No, code gives me migraine ;)

thanks for looking.

Attachments

barigazy · 2012-05-25

Give me 10 min to finis the code. I think that i find better solution

barigazy · 2012-05-25

Because you have very large scene i suggest you to select the objects,
then isolate selection, and do attach multiple obj manually. But before attach any object pick one which have material that you need to keep.

barigazy · 2012-05-25

I have a couple of questions:
#1 in which map slot is the texture (diffuse or any)?
#2 list the materials that need to be used?
#3 are you need tool for selection objects with same texture only?
#4 are you wrote any code so far for this problem (post something)?