Mesh colors, do they always have to be white?

Please forgive me if this has been covered already, but would appreciate some input.

I’m a long time gmax user, and whenever you add a mesh to the viewport, every object created is given a default color. And you also have the option of changing those colors. (i.e. a sphere may be blue, cube is red, plane is green…). Unless I’m overlooking something, In blender, all mesh is white until you add a material to it, (and even then it does not display in that color until rendering.)

For very large projects, (i.e. building a steam engine) it is much easier to see individual parts if each part is in a unique color. Sometimes you don’t want to add texture until you’re finished with the project.

Is it possible to have blender display the mesh in different colors prior to adding the material as it did in gmax? Is there a setting or an Add-on that will allow this? Or if do have to add my own color, (material) and is there a way for it to display in the 3D viewport in those colors during the entire project?

Thank you,

You will need to add a material, but you don’t need to fully detail it out.

There is a viewport display mode that will show up in solid mode, the actual shading nodes you have setup for the surface will take over in lookdev or rendered mode

Thanks for the inputs! TheRedWaxPolice, that is what I’m looking for, but do you know if it can be done in blender 2.79? Mostly curious and plan on evolving into 2.8 when I get a little more mileage under my belt.

also, is this a setting that can be saved in user preferences? (both versions).

Thanks!!!

import bpy
from random import random

for o in bpy.data.objects:
    if(o.type == 'MESH'):
        if((o.color[:4] == (1,1,1,1)) or (o.color[:4] == (0,0,0,0))):
            o.color = (random(),random(),random(),1)
        
        if(bpy.context.scene.render.engine == 'BLENDER_RENDER'):
            o.material_slots.data.active_material.use_object_color = True
            
        if(bpy.context.scene.render.engine == 'CYCLES'):
            o.material_slots.data.active_material_index = 0
            o.material_slots.data.active_material.diffuse_color = o.color[:3]

What it does is set a random color for the object, and then make the first material use it. It generates a new color if the object color is default white with alpha 1, or black with alpha 0, where latter comes from resetting the color.

No idea how to do that in 2.79… and yes, you can save the startup file…

Also, if you are just starting with blender, my advice is to go straight to 2.8… the stable release should be out next month or so…

I would go directly to 2.8, except the tutorials I’m following are done in 2.79 :grin:

There is enough of a difference that it would be hard to follow them in 2.8. However, once I get a handle on the program and understand the basics and “language”, I’m confident going to 2.8 wouldn’t be too much of a challenge.

JA12, that sounds good, but not sure what to do with it. I would need some better direction on where to plug this into.

Thanks!

The objects need an unique material. Add one, select the rest with the one with material as active, ctrl+L -> materials. U -> mat&tex to make them unique.

Then the script sets the colors when you run it from the Blender text editor, paste, alt+P or run script from the header.

I really do appreciate the input and the attempts, but I need a bit more direction than that. I am just starting out with blender, and I am very computer literate, but I have not learned how to run scripts in blender. I tried searching on line, and attempted to follow their directions, but I’m spending WAY too much time getting it to work without success.

If you, or anyone else know of a step by step approach to getting this script to work, then I would appreciate that and confident I can follow it.

TB2