Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

Showing posts with label theme. Show all posts
Showing posts with label theme. Show all posts

May 21, 2015

my node view theme

Signifant digits probably don't go beyond 4 or 5

Record your current node theme

import bpy
current_theme = bpy.context.user_preferences.themes.items()[0][0]
node_editor = bpy.context.user_preferences.themes[current_theme].node_editor

types = """\
  color_node 
  converter_node 
  distor_node 
  filter_node 
  frame_node 
  gp_vertex 
  gp_vertex_select 
  group_node 
  group_socket_node 
  input_node 
  layout_node 
  matte_node 
  node_active 
  node_selected 
  output_node 
  pattern_node 
  script_node 
  selected_text 
  shader_node 
  texture_node 
  vector_node 
  wire 
  wire_inner 
  wire_select
"""
for c in types.split():
    k = getattr(node_editor, c)
    print(c, str(k[:])[1:-1].replace(' ', ''))

Set the Theme only

import bpy

current_theme = bpy.context.user_preferences.themes.items()[0][0]
node_editor = bpy.context.user_preferences.themes[current_theme].node_editor

settings = """\
color_node 0.8941177129745483,1.0,0.7882353663444519
converter_node 0.9098039865493774,1.0,0.960784375667572
distor_node 0.4549019932746887,0.5921568870544434,0.5921568870544434
filter_node 0.6784313917160034,0.6039215922355652,0.7529412508010864
frame_node 1.0,1.0,1.0,0.501960813999176
gp_vertex 0.0,0.0,0.0
gp_vertex_select 1.0,0.5215686559677124,0.0
group_node 0.5411764979362488,0.6117647290229797,0.572549045085907
group_socket_node 0.874509871006012,0.7921569347381592,0.20784315466880798
input_node 1.0,1.0,1.0
layout_node 0.6784313917160034,0.6039215922355652,0.7529412508010864
matte_node 0.5921568870544434,0.4549019932746887,0.4549019932746887
node_active 1.0,0.6666666865348816,0.250980406999588
node_selected 0.9450981020927429,0.3450980484485626,0.0
output_node 1.0,1.0,1.0
pattern_node 0.6784313917160034,0.6039215922355652,0.7529412508010864
script_node 0.6784313917160034,0.6039215922355652,0.7529412508010864
selected_text 0.7019608020782471,0.6117647290229797,0.6117647290229797
shader_node 0.6392157077789307,0.9098039865493774,1.0
texture_node 0.2392157018184662,0.9764706492424011,1.0
vector_node 0.6784313917160034,0.6039215922355652,0.7529412508010864
wire 1.0,1.0,1.0
wire_inner 1.0,1.0,1.0
wire_select 1.0,0.46274513006210327,0.0
"""

for configurable in settings.split('\n'):
    if not configurable.strip():
        continue
    print(configurable)
    attr_name, attr_value = configurable.split(' ')
    attr_floats = [float(i) for i in attr_value.split(',')]
    setattr(node_editor, attr_name, attr_floats)

November 07, 2014

TextEditor Theme colours

Everyone has their own ideas about themes, for text editor I find this theme quite relaxing even when using flux (which dims and extracts greens and blues after sundown)

Mine looks like this

I guess one might want to save this a json and also write a simple importer.

September 02, 2012

Color changes in UI ( theme, customize )

import bpy  
import struct  
  
current_theme = bpy.context.user_preferences.themes.items()[0][0]  
texed = bpy.context.user_preferences.themes[current_theme].text_editor  
  
def hex_to_rgb(rgb_str):  
    int_tuple = struct.unpack('BBB', bytes.fromhex(rgb_str))  
    return tuple([val/255 for val in int_tuple])  
      
  
texed.space.text = hex_to_rgb('ffffff')  
texed.space.back = hex_to_rgb('2a2a2a')
texed.cursor = hex_to_rgb('FFAAAA')
texed.syntax_builtin = hex_to_rgb('00EFFF') # import, return, for, in..  
texed.syntax_comment = hex_to_rgb('33df05')   
texed.syntax_numbers = hex_to_rgb('0093c8')  
texed.syntax_special = hex_to_rgb('f8ff35') # def, class..  
texed.syntax_string = hex_to_rgb('B2FFB0')
texed.syntax_symbols = hex_to_rgb('FFC5DF') # = ()[] . , > < == etc.
texed.syntax_reserved = hex_to_rgb('45eae4') 
texed.syntax_preprocessor = hex_to_rgb('FFFFFF')
  
texed.line_numbers_background = (0,0,0)  
texed.selected_text = (.4,.4,.4)