Page 1 of 1

Blender "Diffuse" Color in Viewport

Posted: Wed Dec 07, 2016 10:57 pm
by sinesium
Hi
does anybody know how to add a color to object solid mesh for specific material slot ?
When there is no Diffuse Shader then color is always white.

Re: Blender "Diffuse" Color in Viewport

Posted: Thu Dec 08, 2016 8:29 am
by sinesium
JimStar,
is it possible to add "Diffuse" colour for every material slot based on Output node?
Output node should have colour picker field to select colour that shown in the 3d Viewport for mesh that has this material attached:
bpy.data.materials["<MATERIAL_NAME>"].diffuse_color

Could you think about this feature ?

Re: Blender "Diffuse" Color in Viewport

Posted: Thu Dec 08, 2016 9:10 am
by sinesium
I made simple script ( I am python rookie ) for changing color for object in selected material - it changes color in viewport to RED.
It changes colour for every FACE of every object that has attached this material name. This is what I need :)

Currently I do not know how to build a additional panel in Materials to select colour by Color Selector.
I will try to find out how to create it.

Now you can run it from text editor:

import bpy
print (bpy.context.object.active_material.name)
bpy.data.materials[ bpy.context.object.active_material.name ].diffuse_color=(1,0,0)

Re: Blender "Diffuse" Color in Viewport

Posted: Sun Dec 11, 2016 11:46 am
by sinesium
Ok. I made it.
My own script that helps to change Diffuse Material Colour.

I did not make __init script for install from zip.
Just unpack and install by directly picking a file 3dViewMatColor.py
After installation it appears in Material tab panel named 3D Viewport Material Colour


Let it make you work easier !
:)

Re: Blender "Diffuse" Color in Viewport

Posted: Tue Dec 13, 2016 11:05 am
by J.C
Thanks, super useful :) I wish it worked automatically by taking the color from the diffuse input of a material node :)

Re: Blender "Diffuse" Color in Viewport

Posted: Tue Dec 13, 2016 2:17 pm
by sinesium
I think it is better to have possibility to set it manually. Cause sometimes is very needed to mark material in scene with specific colour.

Re: Blender "Diffuse" Color in Viewport

Posted: Thu Dec 15, 2016 2:47 pm
by J.C
There coluld be a swich manual/auto viewport color assign ;)

Re: Blender "Diffuse" Color in Viewport

Posted: Fri Feb 10, 2017 4:27 pm
by zukan
Very useful, thank you sinesium!