Select all object with black wirecolour

Hi all.

I'd like a script that will select all the objects in a scene with a black wire colour R=0 G=0 B=0 and then apply a random wire colour other than black.

One button that does the following.

1st = selects all objects with wire colour 0 0 0.
2nd = Apply random wire colour to selection.

This sounds simple to me, and I know how to do it using the object colour dialogue box. I just wondered if it was possible to have a button that automates this process with one click?

The reason being I have my backgrounds set to black, and I get a lot of files from people that have black wire colours.

Many thanks.

Comments

Comment viewing options

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

You sir are a gent! I need to

You sir are a gent!

I need to spend some time learning Maxscript. When I see them written like this it looks so simple and I bash my head against the desk for not being able to create scripts. I will learn!

Thanks for your help.

Cheers.

Script_Butler

veneta's picture

Max has built feature 'Select

Max has built feature 'Select by color' but via colour dialogue box you'll assign new uniform wirecolor to all selected objects, so if this is not the case and you want to end with random color for each object then there it is:

-- selecting is not necessary to assign new wirecolor,
-- so just loop through the objects and assign new random color
for obj in objects where obj.wirecolor == black do
    obj.wirecolor = random black white
 
-- and to install it as macros...
macroScript macro_RandomWirecolor
category:"Assistance"
internalCategory:"Assistance"
tooltip:"Random Wirecolor"
buttontext:"Random Wirecolor"
(
    for obj in objects where obj.wirecolor == black do
        obj.wirecolor = random black white
)

Comment viewing options

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