Blender "Diffuse" Color in Viewport

Blender (Export script developed by yoyoz; Integrated Plugin developed by JimStar)
Post Reply
sinesium
Licensed Customer
Posts: 50
Joined: Thu Aug 13, 2015 8:11 am

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.
Be patient for me, please. I am new here.
sinesium
Licensed Customer
Posts: 50
Joined: Thu Aug 13, 2015 8:11 am

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 ?
Be patient for me, please. I am new here.
sinesium
Licensed Customer
Posts: 50
Joined: Thu Aug 13, 2015 8:11 am

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)
Be patient for me, please. I am new here.
sinesium
Licensed Customer
Posts: 50
Joined: Thu Aug 13, 2015 8:11 am

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 !
:)
Attachments
3DViewportMaterialColor.zip
(838 Bytes) Downloaded 324 times
Be patient for me, please. I am new here.
J.C
Licensed Customer
Posts: 1857
Joined: Thu May 13, 2010 6:35 pm
Location: Wrocław

Thanks, super useful :) I wish it worked automatically by taking the color from the diffuse input of a material node :)
CPU – i9 13900KF, 128GB RAM, GPU – RTX 4090
System – Windows 11
My Behance portfolio, Blender plugin FB support group
sinesium
Licensed Customer
Posts: 50
Joined: Thu Aug 13, 2015 8:11 am

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.
Be patient for me, please. I am new here.
J.C
Licensed Customer
Posts: 1857
Joined: Thu May 13, 2010 6:35 pm
Location: Wrocław

There coluld be a swich manual/auto viewport color assign ;)
CPU – i9 13900KF, 128GB RAM, GPU – RTX 4090
System – Windows 11
My Behance portfolio, Blender plugin FB support group
zukan
Licensed Customer
Posts: 16
Joined: Fri Jul 08, 2016 6:14 am

Very useful, thank you sinesium!
MacOS Sierra 10.12.3 - GTX 970 + GTX 780 Ti - 16 GB RAM - Nvidia Driver: 367.15.10.35f01 - Octane Blender 3.05.3 - 11.23 - Blender 2.78a
Post Reply

Return to “Blender”