Select objects that have no material assigned

Is there a script to select all objects in a scene that don't have a material applied yet?

Comments

Comment viewing options

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

this what you looking for

select (for i in objects where i.material==undefined collect i)

fajar's picture

hey what an coincidence im

hey what an coincidence im architect too also not scripter (like you , script is just hobby)...nice to meet you barigazy.

barigazy's picture

my pleasure, fajar I think

my pleasure, fajar
I think that 90% members here use maxscript for hobby and the others are
pro scripters. It is good to know that I have a colleague here :)
Regards!

bga

fajar's picture

dont know about that , but as

dont know about that , but as far as I know its "geometry" mean its filtering by only geometry object, but how about editable spline, helper....not to mean to offend but he said "select all objects in a scene that had no material" may be he mean all object including spline, helper or something like that. But mey be youre correct in geometry more faster, im not script master, just learning maxscript few month ago with no foundation from scripters or so whatever corelating with script.

Best regard

Fajar

barigazy's picture

For his questions your

For his questions your solution is OK (better).
But i never saw helper with assigned material, also light, cams etc.
You are longer than me on this forum(site), also you have very useful scripts
here. Just keep it up.
I'm architect no script master. maxscript is only my hobby.

Cheers!

bga

fajar's picture

select (for i in objects

select (for i in objects where i.material==undefined collect i)

Vendetta's picture

I hope you see this.. How

I hope you see this..

How would I add for it to select both geometry and shapes. I changed objects to geometry but I don't know how to add another selection to the script.

barigazy's picture

...

No need for that. Just use this

select (for o in objects where canconvertto o Editable_Mesh and o.mat != undefined collect o)

bga

IgrBessonov's picture

It works!

Thank you! It is very helpful!

barigazy's picture

Hi fajar, Probably would be

Hi fajar,
Probably would be faster for larger scenes if you use "geometry" instead of "objects"

bga

Comment viewing options

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