1
$\begingroup$

I am wondering if there is a way that I can change the background color and possibly the color of other elements slightly, for each mode (Object, Edit, Sculpt, Vertex, Weight, Texture) so that it is easier to tell visually which mode I am in aside from the mode selector as an indicator.

Could it be done with some python scripting? Is there an add-on out there that would do it?

Example: Object Mode = slight blue background, Edit Mode = slight green background, etc.

$\endgroup$
2
  • 1
    $\begingroup$ I am mostly sure that this is not possible, but at a longer thought I think it is a great idea. Try maybe posting it here: blender.community/c/rightclickselect $\endgroup$
    – cgslav
    Commented Feb 10, 2018 at 9:25
  • $\begingroup$ I'm pretty hopeful it's doable with python. $\endgroup$ Commented Feb 10, 2018 at 11:55

1 Answer 1

3
$\begingroup$

Set World Background on and run this script via Blender text editor.

enter image description here

import bpy

Modes = {'OBJECT':(1, 0, 0),
        'EDIT':(0, 1, 0),
        'SCULPT':(0, 0, 1),
        'VERTEX_PAINT':(1, 1, 0),
        'WEIGHT_PAINT':(1, 0, 1),
        'TEXTURE_PAINT':(0, 1, 1)}

def my_handler(scene):
    mode = bpy.context.object.mode
    scene.world.horizon_color = Modes[mode]

def register():
    bpy.app.handlers.scene_update_post.append(my_handler)

def unregister():
    bpy.app.handlers.scene_update_post.remove(my_handler)

if __name__ == "__main__":
    register()      
$\endgroup$
4
  • $\begingroup$ I don't understand what you mean by "Set World Background on". Isn't it enabled by default? When I go into the World tab>Surface>Surface it is set to background and has a color. I ran the script but nothing changed. $\endgroup$ Commented Feb 12, 2018 at 22:55
  • $\begingroup$ Okay, I was able to get your script to work if Viewport Shading mode is set to rendered. How difficult would it be to modify that script to alter the theme background color based on the different modes? $\endgroup$ Commented Feb 13, 2018 at 23:04
  • $\begingroup$ Thanks for explaining that. I appreciate you offering a working solution. I can get it to work with factory settings but in my startup file it doesn't work. Some add-on must be interfering with the script. I guess I am still looking for a solution. $\endgroup$ Commented Feb 22, 2018 at 19:51
  • $\begingroup$ How would one get the script to also enable Paper Sky and Blend Sky? Also, how would one get the script to load on startup? $\endgroup$ Commented Feb 22, 2018 at 20:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .