Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to write a script to set Interface colours for individual scenes. When I switch scenes in the Info bar drop down menu I want to change the Info Bar background colour. This gives better feedback for scene swapping/tracking. So far I've got bpy.context.user_preferences.themes[0] = (1,0,0)

  • I guess I need to create an open list of scenes that I can append later.

  • Then allocate the spectrum of colours to it?

  • Not sure I can create a UI to allocate colours to scenes, so I'll have to bump the values in increments instead.

But first I'm stuck on calling the colour change (I considered iterating a bunch of themes and switching them as needed). At the BA forum it was suggested that the scene change is a frame change event but I'm not sure how to separate that from any other frame changes...

Hopefully if I can set up colours for the info bar I could tie them to node scene inputs.

share|improve this question
up vote 7 down vote accepted

Cool idea, I wrote this addon for me just now and I triggered the Header draw event. You can copy it from below or from here:

EDIT: Updated to the newer Version. Don't use the old version, it generates a continuous redraw of the Header, wich I don' noticed. leads to cpu inceasement

the updated Version:
bl_info = {
           "name": "Colored Header for each scene",
           "author": "Leon95, Idea: 3pointedit",
           "version": (1, 1),
           "blender": (2, 68, 0),
           "location": "Properties > Scene Tab > Scene Panel > Display Color",
           "description": "Define a Header Color for every scene and display it in the Header",
           "category": "Scene"

import bpy

def_color = bpy.props.FloatVectorProperty(size = 3,min = 0.0,max = 1.0,
def_color = bpy.context.user_preferences.themes[0]

def ui_properties_costum_header_color(self, context):
    row = self.layout.row()
    row.prop(context.scene, "headerColor")

def ui_info_header_refresh(self, context):
    #assign the property to the header theme every time it is redrawn
    ch = context.user_preferences.themes[0]
    cs = context.scene.headerColor
    #check, if reassignment is needed, since  assigning a color leads to redraw
    #(which the causes some kind of stack overflow)
    if not (round(l_co[0],3) == round(cs[0],3) and round(l_co[1],3) == round(cs[1],3) and round(l_co[2],3) == round(cs[2],3)):
        bpy.context.user_preferences.themes[0] = bpy.context.scene.headerColor

def register():
    co = bpy.context.user_preferences.themes[0]
    bpy.types.WindowManager.lastHeaderColor=bpy.props.FloatVectorProperty(size = 3,min = 0.0,max = 1.0)
    bpy.types.Scene.headerColor = bpy.props.FloatVectorProperty(
                                     name = "Display Color",
                                     subtype = "COLOR",
                                     size = 3,
                                     min = 0.0,
                                     max = 1.0,
                                     update = ui_info_header_refresh,
                                     default = co)


    #reassigment forces redraw
    bpy.context.user_preferences.themes[0] = bpy.context.user_preferences.themes[0]

def unregister():
    bpy.context.user_preferences.themes[0] = [def_color[0],def_color[1],def_color[2]]
    del bpy.types.WindowManager.lastHeaderColor

if __name__ == "__main__":
share|improve this answer
The coolest thing is that you can animate the header color :) – Leon95 Aug 30 '14 at 20:57
+1 This is pretty sweet. A cool idea from op indeed, registered and currently using it. Only critique is by default the color changes are rather subtle. – iKlsR Aug 30 '14 at 21:04
That is AWESOME, thanks sooo much! At least now I have a script to learn from, win win. – 3pointedit Aug 31 '14 at 7:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.