ScriptSpot

Script

SelectObjectsByMaterial

By colinsenner · Credited author: Colin Senner · 2007-12-14

Version
1.0
Date updated
2007-12-14
Votes
13
Downloads

Tags: select objects by material selecting hidden frozen object

Description

This script extends and improves the functionality of the button in the material editor labeled "Select by Material". I was always frustrated by this button because to effectively get every object with a specific material applied I always had to unfreeze/unhide everything, and on heavy scenes, this proved to be difficult. Also, using this functionality is rough because it will only select the group head if an object that has the material applied is part of a group, resulting in me mistakenly assigning materials to whole groups.

This script allows you to select the material, click the button and have all the objects that material is assigned to selected (even if they are hidden or frozen), if the objects happen to be a part of a group, it will open every level of the group till it gets to the object with the assigned material, and select only it.

Additional Info

To Use:
Run the script, goto Customize->Customize User Interface, Toolbars, Group: "Main UI", Category: "All Commands", drag the item "SelectObjsByMaterial" to a toolbar, or alternatively assign it to a QUAD menu.

Now, open the material editor and pick an object assigned to something in your scene (doesn't matter if the object is hidden/frozen/grouped etc.) and click the hotkey, the result will be you will have every object in the scene with that material selected (even if you can't see them, they are still selected).

Alternatively if you assign this script to a quad, you will also have an alternate box, if you use the alt box from the quad, it will automatically unhide/unfreeze all the objects making sure you can see them, so you know exactly what you're affecting.

Comments (18)

Waseem3D · 2021-05-03

I'm looking the same script but to select same materials that used by clicking on object without opening material editor, any idea?
I mean
1. select object which has material needed
2. click on script button
3. All objects that have material to the selected object will be selected.

Hope I could describe it in a good way.

other option

jnls · 2021-05-04

uv puppy is the solution in option material

.

Haider of Sweden · 2014-09-04

Hi Colin,

No, I meant if I have a multisub-material that is assigned to a certain amount of objects.
Now, I want to find the objects that have a certain sub-object material assigned to them.

.

Haider of Sweden · 2014-09-03

Hi!

Could you please improve your script so that it can select what object uses a certain sub-object material?

Currently, I use this solution:
http://www.polycount.com/forum/showpost.php?p=1521792&postcount=12
... that creates a multi-sub-object material for all items in the scene and gives the items an equivalent material ID.

Now, the tricky part is to find the item that uses a certain material ID.

@fajar: regarding "Select by material without open the material editor". I cant make the code work.
Could you please help out?

colinsenner · 2014-09-03

I run this script on the entire object (with the multisub material) then I usually just go into face selection mode and click the face I need the material for and check the id manually.

Awesome !!!!

dub73 · 2012-04-07

I am a former Maya user and this functionality is painful missing in Max. Simply select all objects with a certain material assigned. How can you work without? How else can you replace materials? Max is strange

chalid · 2010-04-02

thanks..another useful n efficient way from you :)

colinsenner · 2010-04-05

Glad to hear. This is one script I really really use alot.

Max 2012

igamaximus · 2011-08-20

Colin, is it possible to make this useful script work on Max 2012? I've tested and it seems it's nonworking there.

Thanks for your time and effort.

2012

colinsenner · 2011-08-20

Yeah, let me get my hands on 2012, and I'll see what I can do.

-Colin

one808 · 2009-12-18

good tool ,trying

fajar · 2009-09-02

Select by material without open the material editor:

rollout MapBySel "Misc Tool"
button MapSel "Selection" toolTip:"Click: Select by Material"

on MapSel pressed do
(
if selection.count==1 then
(
select (for o in objects where o.material==selection[1].material collect o)
)
)
CreateDialog MapBySel

70086504 · 2009-09-02

good tool

vsai · 2009-08-31

Yay Colin, yet another one of the "why isn't this hotkeyable, lets go see if anyones made it already" script ideas that you have already done.

 

Thanks 

colinsenner · 2009-09-08

Yeah right? I've got a ton of em, that honestly...should be standard by now. I love this script, I probably use it more than most.
Good hearing from you vsai.
-Colin

colinsenner · 2009-09-08

Also Fajar, mine does multiple objects as well, it's pretty handy.

colinsenner · 2008-02-13

Thanks a lot wine3d! I'm glad you've found it. (It really has helped my workflow a lot too :))

-Colin

wine3d · 2008-02-13

good tool!