2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL/BL DUAL LICENSE BLOCK *****
28 /** \file blender/editors/interface/resources.c
29 * \ingroup edinterface
36 #include "MEM_guardedalloc.h"
38 #include "DNA_curve_types.h"
39 #include "DNA_screen_types.h"
40 #include "DNA_space_types.h"
41 #include "DNA_userdef_types.h"
42 #include "DNA_windowmanager_types.h"
44 #include "BLI_blenlib.h"
45 #include "BLI_utildefines.h"
48 #include "BKE_appdir.h"
49 #include "BKE_DerivedMesh.h"
50 #include "BKE_global.h"
52 #include "BKE_texture.h"
56 #include "UI_interface.h"
57 #include "UI_interface_icons.h"
59 #include "interface_intern.h"
61 /* global for themes */
62 typedef void (*VectorDrawFunc)(int x, int y, int w, int h, float alpha);
64 /* be sure to keep 'bThemeState' in sync */
65 static struct bThemeState g_theme_state = {
71 #define theme_active g_theme_state.theme
72 #define theme_spacetype g_theme_state.spacetype
73 #define theme_regionid g_theme_state.regionid
75 void ui_resources_init(void)
77 UI_icons_init(BIFICONID_LAST);
80 void ui_resources_free(void)
86 /* ******************************************************** */
88 /* ******************************************************** */
90 const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
92 ThemeSpace *ts = NULL;
93 static char error[4] = {240, 0, 240, 255};
94 static char alert[4] = {240, 60, 60, 255};
95 static char headerdesel[4] = {0, 0, 0, 255};
96 static char setting = 0;
97 const char *cp = error;
99 /* ensure we're not getting a color after running BKE_blender_userdef_free */
100 BLI_assert(BLI_findindex(&U.themes, theme_active) != -1);
101 BLI_assert(colorid != TH_UNDEFINED);
105 /* first check for ui buttons theme */
106 if (colorid < TH_THEMEUI) {
151 ts = &btheme->tuserpref;
154 ts = &btheme->tconsole;
163 ts = &btheme->tlogic;
175 if (theme_regionid == RGN_TYPE_WINDOW)
177 else if (theme_regionid == RGN_TYPE_CHANNELS)
179 else if (theme_regionid == RGN_TYPE_HEADER)
185 cp = ts->gradients.gradient;
188 cp = ts->gradients.high_gradient;
190 case TH_SHOW_BACK_GRAD:
192 setting = ts->gradients.show_grad;
195 if (theme_regionid == RGN_TYPE_WINDOW)
197 else if (theme_regionid == RGN_TYPE_CHANNELS)
199 else if (theme_regionid == RGN_TYPE_HEADER)
200 cp = ts->header_text;
202 cp = ts->button_text;
205 if (theme_regionid == RGN_TYPE_WINDOW)
207 else if (theme_regionid == RGN_TYPE_CHANNELS)
208 cp = ts->list_text_hi;
209 else if (theme_regionid == RGN_TYPE_HEADER)
210 cp = ts->header_text_hi;
212 cp = ts->button_text_hi;
215 if (theme_regionid == RGN_TYPE_WINDOW)
217 else if (theme_regionid == RGN_TYPE_CHANNELS)
219 else if (theme_regionid == RGN_TYPE_HEADER)
220 cp = ts->header_title;
222 cp = ts->button_title;
226 cp = ts->header; break;
228 /* we calculate a dynamic builtin header deselect color, also for pulldowns... */
230 headerdesel[0] = cp[0] > 10 ? cp[0] - 10 : 0;
231 headerdesel[1] = cp[1] > 10 ? cp[1] - 10 : 0;
232 headerdesel[2] = cp[2] > 10 ? cp[2] - 10 : 0;
236 cp = ts->header_text; break;
237 case TH_HEADER_TEXT_HI:
238 cp = ts->header_text_hi; break;
240 case TH_PANEL_HEADER:
241 cp = ts->panelcolors.header; break;
243 cp = ts->panelcolors.back; break;
244 case TH_PANEL_SHOW_HEADER:
246 setting = ts->panelcolors.show_header;
248 case TH_PANEL_SHOW_BACK:
250 setting = ts->panelcolors.show_back;
254 cp = ts->button; break;
255 case TH_BUTBACK_TEXT:
256 cp = ts->button_text; break;
257 case TH_BUTBACK_TEXT_HI:
258 cp = ts->button_text_hi; break;
261 cp = ts->tab_active; break;
262 case TH_TAB_INACTIVE:
263 cp = ts->tab_inactive; break;
265 cp = ts->tab_back; break;
267 cp = ts->tab_outline; break;
270 cp = ts->shade1; break;
272 cp = ts->shade2; break;
274 cp = ts->hilite; break;
277 cp = ts->grid; break;
278 case TH_VIEW_OVERLAY:
279 cp = ts->view_overlay; break;
281 cp = ts->wire; break;
283 cp = ts->syntaxr; break;
285 cp = ts->wire_edit; break;
287 cp = ts->lamp; break;
289 cp = ts->speaker; break;
291 cp = ts->camera; break;
293 cp = ts->empty; break;
295 cp = ts->select; break;
297 cp = ts->active; break;
299 cp = ts->group; break;
300 case TH_GROUP_ACTIVE:
301 cp = ts->group_active; break;
303 cp = ts->transform; break;
305 cp = ts->vertex; break;
306 case TH_VERTEX_SELECT:
307 cp = ts->vertex_select; break;
308 case TH_VERTEX_UNREFERENCED:
309 cp = ts->vertex_unreferenced; break;
311 cp = &ts->vertex_size; break;
312 case TH_OUTLINE_WIDTH:
313 cp = &ts->outline_width; break;
315 cp = ts->edge; break;
317 cp = ts->edge_select; break;
319 cp = ts->edge_seam; break;
321 cp = ts->edge_sharp; break;
323 cp = ts->edge_crease; break;
324 case TH_EDITMESH_ACTIVE:
325 cp = ts->editmesh_active; break;
326 case TH_EDGE_FACESEL:
327 cp = ts->edge_facesel; break;
329 cp = ts->face; break;
331 cp = ts->face_select; break;
333 cp = ts->face_dot; break;
334 case TH_FACEDOT_SIZE:
335 cp = &ts->facedot_size; break;
336 case TH_DRAWEXTRA_EDGELEN:
337 cp = ts->extra_edge_len; break;
338 case TH_DRAWEXTRA_EDGEANG:
339 cp = ts->extra_edge_angle; break;
340 case TH_DRAWEXTRA_FACEAREA:
341 cp = ts->extra_face_area; break;
342 case TH_DRAWEXTRA_FACEANG:
343 cp = ts->extra_face_angle; break;
345 cp = ts->normal; break;
347 cp = ts->vertex_normal; break;
349 cp = ts->loop_normal; break;
351 cp = ts->bone_solid; break;
353 cp = ts->bone_pose; break;
354 case TH_BONE_POSE_ACTIVE:
355 cp = ts->bone_pose_active; break;
357 cp = ts->strip; break;
358 case TH_STRIP_SELECT:
359 cp = ts->strip_select; break;
360 case TH_KEYTYPE_KEYFRAME:
361 cp = ts->keytype_keyframe; break;
362 case TH_KEYTYPE_KEYFRAME_SELECT:
363 cp = ts->keytype_keyframe_select; break;
364 case TH_KEYTYPE_EXTREME:
365 cp = ts->keytype_extreme; break;
366 case TH_KEYTYPE_EXTREME_SELECT:
367 cp = ts->keytype_extreme_select; break;
368 case TH_KEYTYPE_BREAKDOWN:
369 cp = ts->keytype_breakdown; break;
370 case TH_KEYTYPE_BREAKDOWN_SELECT:
371 cp = ts->keytype_breakdown_select; break;
372 case TH_KEYTYPE_JITTER:
373 cp = ts->keytype_jitter; break;
374 case TH_KEYTYPE_JITTER_SELECT:
375 cp = ts->keytype_jitter_select; break;
377 cp = ts->keyborder; break;
378 case TH_KEYBORDER_SELECT:
379 cp = ts->keyborder_select; break;
381 cp = ts->cframe; break;
382 case TH_TIME_KEYFRAME:
383 cp = ts->time_keyframe; break;
384 case TH_TIME_GP_KEYFRAME:
385 cp = ts->time_gp_keyframe; break;
387 cp = ts->nurb_uline; break;
389 cp = ts->nurb_vline; break;
390 case TH_NURB_SEL_ULINE:
391 cp = ts->nurb_sel_uline; break;
392 case TH_NURB_SEL_VLINE:
393 cp = ts->nurb_sel_vline; break;
394 case TH_ACTIVE_SPLINE:
395 cp = ts->act_spline; break;
397 cp = ts->lastsel_point; break;
399 cp = ts->handle_free; break;
401 cp = ts->handle_auto; break;
402 case TH_HANDLE_AUTOCLAMP:
403 cp = ts->handle_auto_clamped; break;
405 cp = ts->handle_vect; break;
406 case TH_HANDLE_ALIGN:
407 cp = ts->handle_align; break;
408 case TH_HANDLE_SEL_FREE:
409 cp = ts->handle_sel_free; break;
410 case TH_HANDLE_SEL_AUTO:
411 cp = ts->handle_sel_auto; break;
412 case TH_HANDLE_SEL_AUTOCLAMP:
413 cp = ts->handle_sel_auto_clamped; break;
414 case TH_HANDLE_SEL_VECT:
415 cp = ts->handle_sel_vect; break;
416 case TH_HANDLE_SEL_ALIGN:
417 cp = ts->handle_sel_align; break;
418 case TH_FREESTYLE_EDGE_MARK:
419 cp = ts->freestyle_edge_mark; break;
420 case TH_FREESTYLE_FACE_MARK:
421 cp = ts->freestyle_face_mark; break;
424 cp = ts->syntaxb; break;
426 cp = ts->syntaxv; break;
428 cp = ts->syntaxc; break;
430 cp = ts->syntaxl; break;
432 cp = ts->syntaxd; break;
434 cp = ts->syntaxr; break;
436 cp = ts->syntaxn; break;
438 cp = ts->syntaxs; break;
441 cp = ts->syntaxl; break;
443 cp = ts->syntaxn; break;
445 cp = ts->nodeclass_output; break;
447 cp = ts->syntaxb; break;
449 cp = ts->nodeclass_filter; break;
451 cp = ts->nodeclass_vector; break;
452 case TH_NODE_TEXTURE:
453 cp = ts->nodeclass_texture; break;
454 case TH_NODE_PATTERN:
455 cp = ts->nodeclass_pattern; break;
457 cp = ts->nodeclass_script; break;
459 cp = ts->nodeclass_layout; break;
461 cp = ts->nodeclass_shader; break;
462 case TH_NODE_CONVERTOR:
463 cp = ts->syntaxv; break;
465 cp = ts->syntaxc; break;
466 case TH_NODE_INTERFACE:
467 cp = ts->console_output; break;
469 cp = ts->movie; break;
471 cp = ts->syntaxs; break;
472 case TH_NODE_DISTORT:
473 cp = ts->syntaxd; break;
474 case TH_NODE_CURVING:
475 cp = &ts->noodle_curving; break;
478 cp = ts->movie; break;
479 case TH_SEQ_MOVIECLIP:
480 cp = ts->movieclip; break;
482 cp = ts->mask; break;
484 cp = ts->image; break;
486 cp = ts->scene; break;
488 cp = ts->audio; break;
490 cp = ts->effect; break;
491 case TH_SEQ_TRANSITION:
492 cp = ts->transition; break;
494 cp = ts->meta; break;
496 cp = ts->text_strip; break;
498 cp = ts->preview_back; break;
500 case TH_CONSOLE_OUTPUT:
501 cp = ts->console_output; break;
502 case TH_CONSOLE_INPUT:
503 cp = ts->console_input; break;
504 case TH_CONSOLE_INFO:
505 cp = ts->console_info; break;
506 case TH_CONSOLE_ERROR:
507 cp = ts->console_error; break;
508 case TH_CONSOLE_CURSOR:
509 cp = ts->console_cursor; break;
510 case TH_CONSOLE_SELECT:
511 cp = ts->console_select; break;
513 case TH_HANDLE_VERTEX:
514 cp = ts->handle_vertex;
516 case TH_HANDLE_VERTEX_SELECT:
517 cp = ts->handle_vertex_select;
519 case TH_HANDLE_VERTEX_SIZE:
520 cp = &ts->handle_vertex_size;
526 case TH_GP_VERTEX_SELECT:
527 cp = ts->gp_vertex_select;
529 case TH_GP_VERTEX_SIZE:
530 cp = &ts->gp_vertex_size;
533 case TH_DOPESHEET_CHANNELOB:
536 case TH_DOPESHEET_CHANNELSUBOB:
537 cp = ts->ds_subchannel;
540 case TH_PREVIEW_BACK:
541 cp = ts->preview_back;
544 case TH_STITCH_PREVIEW_FACE:
545 cp = ts->preview_stitch_face;
548 case TH_STITCH_PREVIEW_EDGE:
549 cp = ts->preview_stitch_edge;
552 case TH_STITCH_PREVIEW_VERT:
553 cp = ts->preview_stitch_vert;
556 case TH_STITCH_PREVIEW_STITCHABLE:
557 cp = ts->preview_stitch_stitchable;
560 case TH_STITCH_PREVIEW_UNSTITCHABLE:
561 cp = ts->preview_stitch_unstitchable;
563 case TH_STITCH_PREVIEW_ACTIVE:
564 cp = ts->preview_stitch_active;
567 case TH_PAINT_CURVE_HANDLE:
568 cp = ts->paint_curve_handle;
570 case TH_PAINT_CURVE_PIVOT:
571 cp = ts->paint_curve_pivot;
577 case TH_METADATA_TEXT:
578 cp = ts->metadatatext;
588 case TH_MARKER_OUTLINE:
589 cp = ts->marker_outline; break;
591 cp = ts->marker; break;
593 cp = ts->act_marker; break;
595 cp = ts->sel_marker; break;
596 case TH_BUNDLE_SOLID:
597 cp = ts->bundle_solid; break;
599 cp = ts->dis_marker; break;
601 cp = ts->path_before; break;
603 cp = ts->path_after; break;
605 cp = ts->camera_path; break;
607 cp = ts->lock_marker; break;
613 case TH_SELECT_HIGHLIGHT:
614 cp = ts->selected_highlight;
622 cp = ts->anim_active;
624 case TH_ANIM_INACTIVE:
625 cp = ts->anim_non_active;
629 cp = ts->nla_tweaking;
631 case TH_NLA_TWEAK_DUPLI:
632 cp = ts->nla_tweakdupli;
635 case TH_NLA_TRANSITION:
636 cp = ts->nla_transition;
638 case TH_NLA_TRANSITION_SEL:
639 cp = ts->nla_transition_sel;
644 case TH_NLA_META_SEL:
645 cp = ts->nla_meta_sel;
650 case TH_NLA_SOUND_SEL:
651 cp = ts->nla_sound_sel;
654 case TH_WIDGET_EMBOSS:
655 cp = btheme->tui.widget_emboss; break;
658 cp = btheme->tui.xaxis; break;
660 cp = btheme->tui.yaxis; break;
662 cp = btheme->tui.zaxis; break;
664 case TH_INFO_SELECTED:
665 cp = ts->info_selected;
667 case TH_INFO_SELECTED_TEXT:
668 cp = ts->info_selected_text;
673 case TH_INFO_ERROR_TEXT:
674 cp = ts->info_error_text;
676 case TH_INFO_WARNING:
677 cp = ts->info_warning;
679 case TH_INFO_WARNING_TEXT:
680 cp = ts->info_warning_text;
685 case TH_INFO_INFO_TEXT:
686 cp = ts->info_info_text;
691 case TH_INFO_DEBUG_TEXT:
692 cp = ts->info_debug_text;
694 case TH_V3D_CLIPPING_BORDER:
695 cp = ts->clipping_border_3d;
701 return (const unsigned char *)cp;
704 /* use this call to init new bone color sets in Theme */
705 static void ui_theme_init_boneColorSets(bTheme *btheme)
709 /* define default color sets - currently we only define 15 of these, though that should be ample */
711 rgba_char_args_set(btheme->tarm[0].solid, 0x9a, 0x00, 0x00, 255);
712 rgba_char_args_set(btheme->tarm[0].select, 0xbd, 0x11, 0x11, 255);
713 rgba_char_args_set(btheme->tarm[0].active, 0xf7, 0x0a, 0x0a, 255);
715 rgba_char_args_set(btheme->tarm[1].solid, 0xf7, 0x40, 0x18, 255);
716 rgba_char_args_set(btheme->tarm[1].select, 0xf6, 0x69, 0x13, 255);
717 rgba_char_args_set(btheme->tarm[1].active, 0xfa, 0x99, 0x00, 255);
719 rgba_char_args_set(btheme->tarm[2].solid, 0x1e, 0x91, 0x09, 255);
720 rgba_char_args_set(btheme->tarm[2].select, 0x59, 0xb7, 0x0b, 255);
721 rgba_char_args_set(btheme->tarm[2].active, 0x83, 0xef, 0x1d, 255);
723 rgba_char_args_set(btheme->tarm[3].solid, 0x0a, 0x36, 0x94, 255);
724 rgba_char_args_set(btheme->tarm[3].select, 0x36, 0x67, 0xdf, 255);
725 rgba_char_args_set(btheme->tarm[3].active, 0x5e, 0xc1, 0xef, 255);
727 rgba_char_args_set(btheme->tarm[4].solid, 0xa9, 0x29, 0x4e, 255);
728 rgba_char_args_set(btheme->tarm[4].select, 0xc1, 0x41, 0x6a, 255);
729 rgba_char_args_set(btheme->tarm[4].active, 0xf0, 0x5d, 0x91, 255);
731 rgba_char_args_set(btheme->tarm[5].solid, 0x43, 0x0c, 0x78, 255);
732 rgba_char_args_set(btheme->tarm[5].select, 0x54, 0x3a, 0xa3, 255);
733 rgba_char_args_set(btheme->tarm[5].active, 0x87, 0x64, 0xd5, 255);
735 rgba_char_args_set(btheme->tarm[6].solid, 0x24, 0x78, 0x5a, 255);
736 rgba_char_args_set(btheme->tarm[6].select, 0x3c, 0x95, 0x79, 255);
737 rgba_char_args_set(btheme->tarm[6].active, 0x6f, 0xb6, 0xab, 255);
739 rgba_char_args_set(btheme->tarm[7].solid, 0x4b, 0x70, 0x7c, 255);
740 rgba_char_args_set(btheme->tarm[7].select, 0x6a, 0x86, 0x91, 255);
741 rgba_char_args_set(btheme->tarm[7].active, 0x9b, 0xc2, 0xcd, 255);
743 rgba_char_args_set(btheme->tarm[8].solid, 0xf4, 0xc9, 0x0c, 255);
744 rgba_char_args_set(btheme->tarm[8].select, 0xee, 0xc2, 0x36, 255);
745 rgba_char_args_set(btheme->tarm[8].active, 0xf3, 0xff, 0x00, 255);
747 rgba_char_args_set(btheme->tarm[9].solid, 0x1e, 0x20, 0x24, 255);
748 rgba_char_args_set(btheme->tarm[9].select, 0x48, 0x4c, 0x56, 255);
749 rgba_char_args_set(btheme->tarm[9].active, 0xff, 0xff, 0xff, 255);
751 rgba_char_args_set(btheme->tarm[10].solid, 0x6f, 0x2f, 0x6a, 255);
752 rgba_char_args_set(btheme->tarm[10].select, 0x98, 0x45, 0xbe, 255);
753 rgba_char_args_set(btheme->tarm[10].active, 0xd3, 0x30, 0xd6, 255);
755 rgba_char_args_set(btheme->tarm[11].solid, 0x6c, 0x8e, 0x22, 255);
756 rgba_char_args_set(btheme->tarm[11].select, 0x7f, 0xb0, 0x22, 255);
757 rgba_char_args_set(btheme->tarm[11].active, 0xbb, 0xef, 0x5b, 255);
759 rgba_char_args_set(btheme->tarm[12].solid, 0x8d, 0x8d, 0x8d, 255);
760 rgba_char_args_set(btheme->tarm[12].select, 0xb0, 0xb0, 0xb0, 255);
761 rgba_char_args_set(btheme->tarm[12].active, 0xde, 0xde, 0xde, 255);
763 rgba_char_args_set(btheme->tarm[13].solid, 0x83, 0x43, 0x26, 255);
764 rgba_char_args_set(btheme->tarm[13].select, 0x8b, 0x58, 0x11, 255);
765 rgba_char_args_set(btheme->tarm[13].active, 0xbd, 0x6a, 0x11, 255);
767 rgba_char_args_set(btheme->tarm[14].solid, 0x08, 0x31, 0x0e, 255);
768 rgba_char_args_set(btheme->tarm[14].select, 0x1c, 0x43, 0x0b, 255);
769 rgba_char_args_set(btheme->tarm[14].active, 0x34, 0x62, 0x2b, 255);
771 /* reset flags too */
772 for (i = 0; i < 20; i++)
773 btheme->tarm[i].flag = 0;
776 /* use this call to init new variables in themespace, if they're same for all */
777 static void ui_theme_init_new_do(ThemeSpace *ts)
779 rgba_char_args_set(ts->header_text, 0, 0, 0, 255);
780 rgba_char_args_set(ts->header_title, 0, 0, 0, 255);
781 rgba_char_args_set(ts->header_text_hi, 255, 255, 255, 255);
784 rgba_char_args_set(ts->panel_text, 0, 0, 0, 255);
785 rgba_char_args_set(ts->panel_title, 0, 0, 0, 255);
786 rgba_char_args_set(ts->panel_text_hi, 255, 255, 255, 255);
789 ts->panelcolors.show_back = false;
790 ts->panelcolors.show_header = false;
791 rgba_char_args_set(ts->panelcolors.back, 114, 114, 114, 128);
792 rgba_char_args_set(ts->panelcolors.header, 0, 0, 0, 25);
794 rgba_char_args_set(ts->button, 145, 145, 145, 245);
795 rgba_char_args_set(ts->button_title, 0, 0, 0, 255);
796 rgba_char_args_set(ts->button_text, 0, 0, 0, 255);
797 rgba_char_args_set(ts->button_text_hi, 255, 255, 255, 255);
799 rgba_char_args_set(ts->list, 165, 165, 165, 255);
800 rgba_char_args_set(ts->list_title, 0, 0, 0, 255);
801 rgba_char_args_set(ts->list_text, 0, 0, 0, 255);
802 rgba_char_args_set(ts->list_text_hi, 255, 255, 255, 255);
804 rgba_char_args_set(ts->tab_active, 114, 114, 114, 255);
805 rgba_char_args_set(ts->tab_inactive, 83, 83, 83, 255);
806 rgba_char_args_set(ts->tab_back, 64, 64, 64, 255);
807 rgba_char_args_set(ts->tab_outline, 60, 60, 60, 255);
810 static void ui_theme_init_new(bTheme *btheme)
814 for (ts = UI_THEMESPACE_START(btheme); ts != UI_THEMESPACE_END(btheme); ts++) {
815 ui_theme_init_new_do(ts);
819 static void ui_theme_space_init_handles_color(ThemeSpace *theme_space)
821 rgba_char_args_set(theme_space->handle_free, 0, 0, 0, 255);
822 rgba_char_args_set(theme_space->handle_auto, 0x90, 0x90, 0x00, 255);
823 rgba_char_args_set(theme_space->handle_vect, 0x40, 0x90, 0x30, 255);
824 rgba_char_args_set(theme_space->handle_align, 0x80, 0x30, 0x60, 255);
825 rgba_char_args_set(theme_space->handle_sel_free, 0, 0, 0, 255);
826 rgba_char_args_set(theme_space->handle_sel_auto, 0xf0, 0xff, 0x40, 255);
827 rgba_char_args_set(theme_space->handle_sel_vect, 0x40, 0xc0, 0x30, 255);
828 rgba_char_args_set(theme_space->handle_sel_align, 0xf0, 0x90, 0xa0, 255);
829 rgba_char_args_set(theme_space->handle_vertex, 0x00, 0x00, 0x00, 0xff);
830 rgba_char_args_set(theme_space->handle_vertex_select, 0xff, 0xff, 0, 0xff);
831 rgba_char_args_set(theme_space->act_spline, 0xdb, 0x25, 0x12, 255);
835 * initialize default theme
836 * \note: when you add new colors, created & saved themes need initialized
837 * use function below, init_userdef_do_versions()
839 void ui_theme_init_default(void)
843 /* we search for the theme with name Default */
844 btheme = BLI_findstring(&U.themes, "Default", offsetof(bTheme, name));
846 if (btheme == NULL) {
847 btheme = MEM_callocN(sizeof(bTheme), "theme");
848 BLI_addtail(&U.themes, btheme);
849 strcpy(btheme->name, "Default");
852 UI_SetTheme(0, 0); /* make sure the global used in this file is set */
855 ui_widget_color_init(&btheme->tui);
857 btheme->tui.iconfile[0] = 0;
858 rgba_char_args_set(btheme->tui.wcol_tooltip.text, 255, 255, 255, 255);
859 rgba_char_args_set_fl(btheme->tui.widget_emboss, 1.0f, 1.0f, 1.0f, 0.02f);
861 rgba_char_args_set(btheme->tui.xaxis, 220, 0, 0, 255);
862 rgba_char_args_set(btheme->tui.yaxis, 0, 220, 0, 255);
863 rgba_char_args_set(btheme->tui.zaxis, 0, 0, 220, 255);
865 btheme->tui.menu_shadow_fac = 0.5f;
866 btheme->tui.menu_shadow_width = 12;
868 /* Bone Color Sets */
869 ui_theme_init_boneColorSets(btheme);
871 /* common (new) variables */
872 ui_theme_init_new(btheme);
875 rgba_char_args_set_fl(btheme->tv3d.back, 0.225, 0.225, 0.225, 1.0);
876 rgba_char_args_set(btheme->tv3d.text, 0, 0, 0, 255);
877 rgba_char_args_set(btheme->tv3d.text_hi, 255, 255, 255, 255);
879 rgba_char_args_set_fl(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0);
880 rgba_char_args_set_fl(btheme->tv3d.button, 0.45, 0.45, 0.45, 0.5);
881 // rgba_char_args_set(btheme->tv3d.panel, 165, 165, 165, 127);
883 rgba_char_args_set(btheme->tv3d.shade1, 160, 160, 160, 100);
884 rgba_char_args_set(btheme->tv3d.shade2, 0x7f, 0x70, 0x70, 100);
886 rgba_char_args_set_fl(btheme->tv3d.grid, 0.251, 0.251, 0.251, 1.0);
887 rgba_char_args_set(btheme->tv3d.view_overlay, 0, 0, 0, 255);
888 rgba_char_args_set(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255);
889 rgba_char_args_set(btheme->tv3d.wire_edit, 0x0, 0x0, 0x0, 255);
890 rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
891 rgba_char_args_set(btheme->tv3d.speaker, 0, 0, 0, 255);
892 rgba_char_args_set(btheme->tv3d.camera, 0, 0, 0, 255);
893 rgba_char_args_set(btheme->tv3d.empty, 0, 0, 0, 255);
894 rgba_char_args_set(btheme->tv3d.select, 241, 88, 0, 255);
895 rgba_char_args_set(btheme->tv3d.active, 255, 170, 64, 255);
896 rgba_char_args_set(btheme->tv3d.group, 8, 48, 8, 255);
897 rgba_char_args_set(btheme->tv3d.group_active, 85, 187, 85, 255);
898 rgba_char_args_set(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255);
899 rgba_char_args_set(btheme->tv3d.vertex, 0, 0, 0, 255);
900 rgba_char_args_set(btheme->tv3d.vertex_select, 255, 133, 0, 255);
901 rgba_char_args_set(btheme->tv3d.vertex_unreferenced, 0, 0, 0, 255);
902 btheme->tv3d.vertex_size = 3;
903 btheme->tv3d.outline_width = 1;
904 rgba_char_args_set(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255);
905 rgba_char_args_set(btheme->tv3d.edge_select, 255, 160, 0, 255);
906 rgba_char_args_set(btheme->tv3d.edge_seam, 219, 37, 18, 255);
907 rgba_char_args_set(btheme->tv3d.edge_facesel, 75, 75, 75, 255);
908 rgba_char_args_set(btheme->tv3d.face, 0, 0, 0, 18);
909 rgba_char_args_set(btheme->tv3d.face_select, 255, 133, 0, 60);
910 rgba_char_args_set(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
911 rgba_char_args_set(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
912 rgba_char_args_set(btheme->tv3d.loop_normal, 0xDD, 0x23, 0xDD, 255);
913 rgba_char_args_set(btheme->tv3d.face_dot, 255, 133, 0, 255);
914 rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
915 rgba_char_args_set_fl(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
916 rgba_char_args_set(btheme->tv3d.edge_sharp, 0, 255, 255, 255);
917 rgba_char_args_set(btheme->tv3d.header_text, 0, 0, 0, 255);
918 rgba_char_args_set(btheme->tv3d.header_text_hi, 255, 255, 255, 255);
919 rgba_char_args_set(btheme->tv3d.button_text, 0, 0, 0, 255);
920 rgba_char_args_set(btheme->tv3d.button_text_hi, 255, 255, 255, 255);
921 rgba_char_args_set(btheme->tv3d.button_title, 0, 0, 0, 255);
922 rgba_char_args_set(btheme->tv3d.title, 0, 0, 0, 255);
923 rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
924 rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
925 rgba_char_args_set_fl(btheme->tv3d.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f);
926 rgba_char_args_set_fl(btheme->tv3d.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f);
927 rgba_char_args_set(btheme->tv3d.gp_vertex, 0, 0, 0, 255);
928 rgba_char_args_set(btheme->tv3d.gp_vertex_select, 255, 133, 0, 255);
929 btheme->tv3d.gp_vertex_size = 3;
931 btheme->tv3d.facedot_size = 4;
933 rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
934 rgba_char_args_set(btheme->tv3d.extra_edge_angle, 32, 32, 0, 255);
935 rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 32, 0, 255);
936 rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 0, 128, 255);
938 rgba_char_args_set(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
940 rgba_char_args_set(btheme->tv3d.nurb_uline, 0x90, 0x90, 0x00, 255);
941 rgba_char_args_set(btheme->tv3d.nurb_vline, 0x80, 0x30, 0x60, 255);
942 rgba_char_args_set(btheme->tv3d.nurb_sel_uline, 0xf0, 0xff, 0x40, 255);
943 rgba_char_args_set(btheme->tv3d.nurb_sel_vline, 0xf0, 0x90, 0xa0, 255);
945 ui_theme_space_init_handles_color(&btheme->tv3d);
947 rgba_char_args_set(btheme->tv3d.act_spline, 0xdb, 0x25, 0x12, 255);
948 rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
950 rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255);
951 /* alpha 80 is not meant editable, used for wire+action draw */
952 rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80);
953 rgba_char_args_set(btheme->tv3d.bone_pose_active, 140, 255, 255, 80);
955 rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
956 rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
958 rgba_char_args_set(btheme->tv3d.skin_root, 180, 77, 77, 255);
959 rgba_char_args_set(btheme->tv3d.gradients.gradient, 0, 0, 0, 0);
960 rgba_char_args_set(btheme->tv3d.gradients.high_gradient, 58, 58, 58, 255);
961 btheme->tv3d.gradients.show_grad = false;
963 rgba_char_args_set(btheme->tv3d.clipping_border_3d, 50, 50, 50, 255);
965 /* to have something initialized */
966 btheme->tbuts = btheme->tv3d;
968 rgba_char_args_set_fl(btheme->tbuts.back, 0.45, 0.45, 0.45, 1.0);
969 // rgba_char_args_set(btheme->tbuts.panel, 0x82, 0x82, 0x82, 255);
972 btheme->tipo = btheme->tv3d;
973 rgba_char_args_set_fl(btheme->tipo.back, 0.42, 0.42, 0.42, 1.0);
974 rgba_char_args_set_fl(btheme->tipo.list, 0.4, 0.4, 0.4, 1.0);
975 rgba_char_args_set(btheme->tipo.grid, 94, 94, 94, 255);
976 // rgba_char_args_set(btheme->tipo.panel, 255, 255, 255, 150);
977 rgba_char_args_set(btheme->tipo.shade1, 150, 150, 150, 100); /* scrollbars */
978 rgba_char_args_set(btheme->tipo.shade2, 0x70, 0x70, 0x70, 100);
979 rgba_char_args_set(btheme->tipo.vertex, 0, 0, 0, 255);
980 rgba_char_args_set(btheme->tipo.vertex_select, 255, 133, 0, 255);
981 rgba_char_args_set(btheme->tipo.hilite, 0x60, 0xc0, 0x40, 255);
982 btheme->tipo.vertex_size = 6;
984 rgba_char_args_set(btheme->tipo.handle_vertex, 0, 0, 0, 255);
985 rgba_char_args_set(btheme->tipo.handle_vertex_select, 255, 133, 0, 255);
986 rgba_char_args_set(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
987 rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
988 btheme->tipo.handle_vertex_size = 5;
990 rgba_char_args_set(btheme->tipo.ds_channel, 82, 96, 110, 255);
991 rgba_char_args_set(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
992 rgba_char_args_set(btheme->tipo.group, 79, 101, 73, 255);
993 rgba_char_args_set(btheme->tipo.group_active, 135, 177, 125, 255);
996 btheme->tact = btheme->tipo;
997 rgba_char_args_set(btheme->tact.strip, 12, 10, 10, 128);
998 rgba_char_args_set(btheme->tact.strip_select, 255, 140, 0, 255);
1000 rgba_char_args_set(btheme->tact.anim_active, 204, 112, 26, 102);
1002 rgba_char_args_set(btheme->tact.keytype_keyframe, 232, 232, 232, 255);
1003 rgba_char_args_set(btheme->tact.keytype_keyframe_select, 255, 190, 50, 255);
1004 rgba_char_args_set(btheme->tact.keytype_extreme, 232, 179, 204, 255);
1005 rgba_char_args_set(btheme->tact.keytype_extreme_select, 242, 128, 128, 255);
1006 rgba_char_args_set(btheme->tact.keytype_breakdown, 179, 219, 232, 255);
1007 rgba_char_args_set(btheme->tact.keytype_breakdown_select, 84, 191, 237, 255);
1008 rgba_char_args_set(btheme->tact.keytype_jitter, 148, 229, 117, 255);
1009 rgba_char_args_set(btheme->tact.keytype_jitter_select, 97, 192, 66, 255);
1011 rgba_char_args_set(btheme->tact.keyborder, 0, 0, 0, 255);
1012 rgba_char_args_set(btheme->tact.keyborder_select, 0, 0, 0, 255);
1015 btheme->tnla = btheme->tact;
1017 rgba_char_args_set(btheme->tnla.anim_active, 204, 112, 26, 102); /* same as for dopesheet; duplicate here for easier reference */
1018 rgba_char_args_set(btheme->tnla.anim_non_active, 153, 135, 97, 77);
1020 rgba_char_args_set(btheme->tnla.nla_tweaking, 77, 243, 26, 77);
1021 rgba_char_args_set(btheme->tnla.nla_tweakdupli, 217, 0, 0, 255);
1023 rgba_char_args_set(btheme->tnla.nla_transition, 28, 38, 48, 255);
1024 rgba_char_args_set(btheme->tnla.nla_transition_sel, 46, 117, 219, 255);
1025 rgba_char_args_set(btheme->tnla.nla_meta, 51, 38, 66, 255);
1026 rgba_char_args_set(btheme->tnla.nla_meta_sel, 105, 33, 150, 255);
1027 rgba_char_args_set(btheme->tnla.nla_sound, 43, 61, 61, 255);
1028 rgba_char_args_set(btheme->tnla.nla_sound_sel, 31, 122, 122, 255);
1030 rgba_char_args_set(btheme->tnla.keyborder, 0, 0, 0, 255);
1031 rgba_char_args_set(btheme->tnla.keyborder_select, 0, 0, 0, 255);
1034 /* to have something initialized */
1035 btheme->tfile = btheme->tv3d;
1036 rgba_char_args_set_fl(btheme->tfile.back, 0.3, 0.3, 0.3, 1);
1037 // rgba_char_args_set_fl(btheme->tfile.panel, 0.3, 0.3, 0.3, 1);
1038 rgba_char_args_set_fl(btheme->tfile.list, 0.4, 0.4, 0.4, 1);
1039 rgba_char_args_set(btheme->tfile.text, 250, 250, 250, 255);
1040 rgba_char_args_set(btheme->tfile.text_hi, 15, 15, 15, 255);
1041 // rgba_char_args_set(btheme->tfile.panel, 145, 145, 145, 255); /* bookmark/ui regions */
1042 rgba_char_args_set(btheme->tfile.active, 130, 130, 130, 255); /* selected files */
1043 rgba_char_args_set(btheme->tfile.hilite, 255, 140, 25, 255); /* selected files */
1045 rgba_char_args_set(btheme->tfile.grid, 250, 250, 250, 255);
1046 rgba_char_args_set(btheme->tfile.image, 250, 250, 250, 255);
1047 rgba_char_args_set(btheme->tfile.movie, 250, 250, 250, 255);
1048 rgba_char_args_set(btheme->tfile.scene, 250, 250, 250, 255);
1052 btheme->tseq = btheme->tv3d;
1053 rgba_char_args_set(btheme->tseq.back, 116, 116, 116, 255);
1054 rgba_char_args_set(btheme->tseq.movie, 81, 105, 135, 255);
1055 rgba_char_args_set(btheme->tseq.movieclip, 32, 32, 143, 255);
1056 rgba_char_args_set(btheme->tseq.mask, 152, 78, 62, 255);
1057 rgba_char_args_set(btheme->tseq.image, 109, 88, 129, 255);
1058 rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255);
1059 rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255);
1060 rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255);
1061 rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
1062 rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
1063 rgba_char_args_set(btheme->tseq.text_strip, 162, 151, 0, 255);
1064 rgba_char_args_set(btheme->tseq.preview_back, 0, 0, 0, 255);
1065 rgba_char_args_set(btheme->tseq.grid, 64, 64, 64, 255);
1068 btheme->tima = btheme->tv3d;
1069 rgba_char_args_set(btheme->tima.back, 53, 53, 53, 255);
1070 rgba_char_args_set(btheme->tima.vertex, 0, 0, 0, 255);
1071 rgba_char_args_set(btheme->tima.vertex_select, 255, 133, 0, 255);
1072 rgba_char_args_set(btheme->tima.wire_edit, 192, 192, 192, 255);
1073 rgba_char_args_set(btheme->tima.edge_select, 255, 133, 0, 255);
1074 btheme->tima.vertex_size = 3;
1075 btheme->tima.facedot_size = 3;
1076 rgba_char_args_set(btheme->tima.face, 255, 255, 255, 10);
1077 rgba_char_args_set(btheme->tima.face_select, 255, 133, 0, 60);
1078 rgba_char_args_set(btheme->tima.editmesh_active, 255, 255, 255, 128);
1079 rgba_char_args_set_fl(btheme->tima.preview_back, 0.0, 0.0, 0.0, 0.3);
1080 rgba_char_args_set_fl(btheme->tima.preview_stitch_face, 0.5, 0.5, 0.0, 0.2);
1081 rgba_char_args_set_fl(btheme->tima.preview_stitch_edge, 1.0, 0.0, 1.0, 0.2);
1082 rgba_char_args_set_fl(btheme->tima.preview_stitch_vert, 0.0, 0.0, 1.0, 0.2);
1083 rgba_char_args_set_fl(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
1084 rgba_char_args_set_fl(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
1085 rgba_char_args_set_fl(btheme->tima.preview_stitch_active, 0.886, 0.824, 0.765, 0.140);
1087 rgba_char_args_test_set(btheme->tima.uv_others, 96, 96, 96, 255);
1088 rgba_char_args_test_set(btheme->tima.uv_shadow, 112, 112, 112, 255);
1090 ui_theme_space_init_handles_color(&btheme->tima);
1091 btheme->tima.handle_vertex_size = 5;
1094 btheme->text = btheme->tv3d;
1095 rgba_char_args_set(btheme->text.back, 153, 153, 153, 255);
1096 rgba_char_args_set(btheme->text.shade1, 143, 143, 143, 255);
1097 rgba_char_args_set(btheme->text.shade2, 0xc6, 0x77, 0x77, 255);
1098 rgba_char_args_set(btheme->text.hilite, 255, 0, 0, 255);
1100 /* syntax highlighting */
1101 rgba_char_args_set(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
1102 rgba_char_args_set(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings Red */
1103 rgba_char_args_set(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments Greenish */
1104 rgba_char_args_set(btheme->text.syntaxv, 95, 95, 0, 255); /* Special Yellow*/
1105 rgba_char_args_set(btheme->text.syntaxd, 50, 0, 140, 255); /* Decorator/Preprocessor Dir. Blue-purple */
1106 rgba_char_args_set(btheme->text.syntaxr, 140, 60, 0, 255); /* Reserved Orange*/
1107 rgba_char_args_set(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin Red-purple */
1108 rgba_char_args_set(btheme->text.syntaxs, 76, 76, 76, 255); /* Gray (mix between fg/bg) */
1111 btheme->toops = btheme->tv3d;
1112 rgba_char_args_set_fl(btheme->toops.back, 0.45, 0.45, 0.45, 1.0);
1114 rgba_char_args_set_fl(btheme->toops.match, 0.2, 0.5, 0.2, 0.3); /* highlighting search match - soft green*/
1115 rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
1118 btheme->tinfo = btheme->tv3d;
1119 rgba_char_args_set_fl(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
1120 rgba_char_args_set(btheme->tinfo.info_selected, 96, 128, 255, 255);
1121 rgba_char_args_set(btheme->tinfo.info_selected_text, 255, 255, 255, 255);
1122 rgba_char_args_set(btheme->tinfo.info_error, 220, 0, 0, 255);
1123 rgba_char_args_set(btheme->tinfo.info_error_text, 0, 0, 0, 255);
1124 rgba_char_args_set(btheme->tinfo.info_warning, 220, 128, 96, 255);
1125 rgba_char_args_set(btheme->tinfo.info_warning_text, 0, 0, 0, 255);
1126 rgba_char_args_set(btheme->tinfo.info_info, 0, 170, 0, 255);
1127 rgba_char_args_set(btheme->tinfo.info_info_text, 0, 0, 0, 255);
1128 rgba_char_args_set(btheme->tinfo.info_debug, 196, 196, 196, 255);
1129 rgba_char_args_set(btheme->tinfo.info_debug_text, 0, 0, 0, 255);
1131 /* space user preferences */
1132 btheme->tuserpref = btheme->tv3d;
1133 rgba_char_args_set_fl(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
1136 btheme->tconsole = btheme->tv3d;
1137 rgba_char_args_set(btheme->tconsole.back, 0, 0, 0, 255);
1138 rgba_char_args_set(btheme->tconsole.console_output, 96, 128, 255, 255);
1139 rgba_char_args_set(btheme->tconsole.console_input, 255, 255, 255, 255);
1140 rgba_char_args_set(btheme->tconsole.console_info, 0, 170, 0, 255);
1141 rgba_char_args_set(btheme->tconsole.console_error, 220, 96, 96, 255);
1142 rgba_char_args_set(btheme->tconsole.console_cursor, 220, 96, 96, 255);
1143 rgba_char_args_set(btheme->tconsole.console_select, 255, 255, 255, 48);
1146 btheme->ttime = btheme->tv3d;
1147 rgba_char_args_set_fl(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
1148 rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
1149 rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); /* sliders */
1151 rgba_char_args_set(btheme->ttime.time_keyframe, 0xDD, 0xD7, 0x00, 1.0);
1152 rgba_char_args_set(btheme->ttime.time_gp_keyframe, 0xB5, 0xE6, 0x1D, 1.0);
1154 /* space node, re-uses syntax and console color storage */
1155 btheme->tnode = btheme->tv3d;
1156 rgba_char_args_set(btheme->tnode.syntaxr, 115, 115, 115, 255); /* wire inner color */
1157 rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255); /* wire selected */
1158 rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */
1159 rgba_char_args_set(btheme->tnode.syntaxn, 100, 100, 100, 255); /* in */
1160 rgba_char_args_set(btheme->tnode.nodeclass_output, 100, 100, 100, 255); /* output */
1161 rgba_char_args_set(btheme->tnode.syntaxb, 108, 105, 111, 255); /* operator */
1162 rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
1163 rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
1164 rgba_char_args_set(btheme->tnode.nodeclass_texture, 108, 105, 111, 255); /* operator */
1165 rgba_char_args_set(btheme->tnode.nodeclass_shader, 108, 105, 111, 255); /* operator */
1166 rgba_char_args_set(btheme->tnode.nodeclass_filter, 108, 105, 111, 255); /* operator */
1167 rgba_char_args_set(btheme->tnode.nodeclass_script, 108, 105, 111, 255); /* operator */
1168 rgba_char_args_set(btheme->tnode.nodeclass_pattern, 108, 105, 111, 255); /* operator */
1169 rgba_char_args_set(btheme->tnode.nodeclass_vector, 108, 105, 111, 255); /* operator */
1170 rgba_char_args_set(btheme->tnode.nodeclass_layout, 108, 105, 111, 255); /* operator */
1171 rgba_char_args_set(btheme->tnode.movie, 155, 155, 155, 160); /* frame */
1172 rgba_char_args_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */
1173 rgba_char_args_set(btheme->tnode.syntaxd, 116, 151, 151, 255); /* distort nodes */
1174 rgba_char_args_set(btheme->tnode.console_output, 223, 202, 53, 255); /* interface nodes */
1175 btheme->tnode.noodle_curving = 5;
1178 btheme->tlogic = btheme->tv3d;
1179 rgba_char_args_set(btheme->tlogic.back, 100, 100, 100, 255);
1182 btheme->tclip = btheme->tv3d;
1184 rgba_char_args_set(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
1185 rgba_char_args_set(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
1186 rgba_char_args_set(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
1187 rgba_char_args_set(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
1188 rgba_char_args_set(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
1189 rgba_char_args_set(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
1190 rgba_char_args_set(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
1191 rgba_char_args_set(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
1192 rgba_char_args_set(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
1193 rgba_char_args_set(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
1194 rgba_char_args_set(btheme->tclip.list, 0x66, 0x66, 0x66, 0xff);
1195 rgba_char_args_set(btheme->tclip.strip, 0x0c, 0x0a, 0x0a, 0x80);
1196 rgba_char_args_set(btheme->tclip.strip_select, 0xff, 0x8c, 0x00, 0xff);
1197 btheme->tclip.handle_vertex_size = 5;
1198 ui_theme_space_init_handles_color(&btheme->tclip);
1201 void ui_style_init_default(void)
1203 BLI_freelistN(&U.uistyles);
1204 /* gets automatically re-allocated */
1209 void UI_SetTheme(int spacetype, int regionid)
1212 /* later on, a local theme can be found too */
1213 theme_active = U.themes.first;
1214 theme_spacetype = spacetype;
1215 theme_regionid = regionid;
1217 else if (regionid) {
1219 theme_active = U.themes.first;
1220 theme_spacetype = SPACE_BUTS;
1221 theme_regionid = regionid;
1224 /* for safety, when theme was deleted */
1225 theme_active = U.themes.first;
1226 theme_spacetype = SPACE_VIEW3D;
1227 theme_regionid = RGN_TYPE_WINDOW;
1231 bTheme *UI_GetTheme(void)
1233 return U.themes.first;
1237 * for the rare case we need to temp swap in a different theme (offscreen render)
1239 void UI_Theme_Store(struct bThemeState *theme_state)
1241 *theme_state = g_theme_state;
1243 void UI_Theme_Restore(struct bThemeState *theme_state)
1245 g_theme_state = *theme_state;
1248 /* for space windows only */
1249 void UI_ThemeColor(int colorid)
1251 const unsigned char *cp;
1253 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1259 void UI_ThemeColor4(int colorid)
1261 const unsigned char *cp;
1263 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1268 /* set the color with offset for shades */
1269 void UI_ThemeColorShade(int colorid, int offset)
1272 const unsigned char *cp;
1274 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1275 r = offset + (int) cp[0];
1277 g = offset + (int) cp[1];
1279 b = offset + (int) cp[2];
1281 glColor4ub(r, g, b, cp[3]);
1283 void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset)
1286 const unsigned char *cp;
1288 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1289 r = coloffset + (int) cp[0];
1291 g = coloffset + (int) cp[1];
1293 b = coloffset + (int) cp[2];
1295 a = alphaoffset + (int) cp[3];
1297 glColor4ub(r, g, b, a);
1300 void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, unsigned char col[3])
1302 const unsigned char *cp1, *cp2;
1304 cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
1305 cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
1307 CLAMP(fac, 0.0f, 1.0f);
1308 col[0] = floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
1309 col[1] = floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
1310 col[2] = floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
1313 /* blend between to theme colors, and set it */
1314 void UI_ThemeColorBlend(int colorid1, int colorid2, float fac)
1316 unsigned char col[3];
1317 UI_GetThemeColorBlend3ubv(colorid1, colorid2, fac, col);
1321 /* blend between to theme colors, shade it, and set it */
1322 void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset)
1325 const unsigned char *cp1, *cp2;
1327 cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
1328 cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
1330 CLAMP(fac, 0.0f, 1.0f);
1331 r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
1332 g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
1333 b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
1339 glColor3ub(r, g, b);
1342 /* blend between to theme colors, shade it, and set it */
1343 void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset)
1346 const unsigned char *cp1, *cp2;
1348 cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1);
1349 cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2);
1351 CLAMP(fac, 0.0f, 1.0f);
1352 r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
1353 g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
1354 b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
1355 a = alphaoffset + floorf((1.0f - fac) * cp1[3] + fac * cp2[3]);
1362 glColor4ub(r, g, b, a);
1366 /* get individual values, not scaled */
1367 float UI_GetThemeValuef(int colorid)
1369 const unsigned char *cp;
1371 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1372 return ((float)cp[0]);
1375 /* get individual values, not scaled */
1376 int UI_GetThemeValue(int colorid)
1378 const unsigned char *cp;
1380 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1381 return ((int) cp[0]);
1384 /* versions of the function above, which take a space-type */
1385 float UI_GetThemeValueTypef(int colorid, int spacetype)
1387 const unsigned char *cp;
1389 cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
1390 return ((float)cp[0]);
1393 int UI_GetThemeValueType(int colorid, int spacetype)
1395 const unsigned char *cp;
1397 cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
1398 return ((int)cp[0]);
1402 /* get the color, range 0.0-1.0 */
1403 void UI_GetThemeColor3fv(int colorid, float col[3])
1405 const unsigned char *cp;
1407 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1408 col[0] = ((float)cp[0]) / 255.0f;
1409 col[1] = ((float)cp[1]) / 255.0f;
1410 col[2] = ((float)cp[2]) / 255.0f;
1413 void UI_GetThemeColor4fv(int colorid, float col[4])
1415 const unsigned char *cp;
1417 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1418 col[0] = ((float)cp[0]) / 255.0f;
1419 col[1] = ((float)cp[1]) / 255.0f;
1420 col[2] = ((float)cp[2]) / 255.0f;
1421 col[3] = ((float)cp[3]) / 255.0f;
1424 /* get the color, range 0.0-1.0, complete with shading offset */
1425 void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
1428 const unsigned char *cp;
1430 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1432 r = offset + (int) cp[0];
1434 g = offset + (int) cp[1];
1436 b = offset + (int) cp[2];
1439 col[0] = ((float)r) / 255.0f;
1440 col[1] = ((float)g) / 255.0f;
1441 col[2] = ((float)b) / 255.0f;
1444 void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3])
1447 const unsigned char *cp;
1449 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1451 r = offset + (int) cp[0];
1453 g = offset + (int) cp[1];
1455 b = offset + (int) cp[2];
1463 /* get the color, in char pointer */
1464 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
1466 const unsigned char *cp;
1468 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1474 /* get the color, in char pointer */
1475 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
1477 const unsigned char *cp;
1479 cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid);
1486 void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4])
1488 const unsigned char *cp;
1490 cp = UI_ThemeGetColorPtr(theme_active, spacetype, colorid);
1497 /* blends and shades between two char color pointers */
1498 void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset)
1501 CLAMP(fac, 0.0f, 1.0f);
1502 r = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]);
1503 g = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]);
1504 b = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]);
1506 r = r < 0 ? 0 : (r > 255 ? 255 : r);
1507 g = g < 0 ? 0 : (g > 255 ? 255 : g);
1508 b = b < 0 ? 0 : (b > 255 ? 255 : b);
1510 glColor3ub(r, g, b);
1513 void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], int offset)
1517 r = offset + (int)cp[0];
1518 g = offset + (int)cp[1];
1519 b = offset + (int)cp[2];
1530 /* get a 3 byte color, blended and shaded between two other char color pointers */
1531 void UI_GetColorPtrBlendShade3ubv(
1532 const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3],
1533 float fac, int offset)
1537 CLAMP(fac, 0.0f, 1.0f);
1538 r = offset + floor((1.0f - fac) * cp1[0] + fac * cp2[0]);
1539 g = offset + floor((1.0f - fac) * cp1[1] + fac * cp2[1]);
1540 b = offset + floor((1.0f - fac) * cp1[2] + fac * cp2[2]);
1551 void UI_ThemeClearColor(int colorid)
1555 UI_GetThemeColor3fv(colorid, col);
1556 glClearColor(col[0], col[1], col[2], 0.0f);
1559 void UI_ThemeClearColorAlpha(int colorid, float alpha)
1562 UI_GetThemeColor3fv(colorid, col);
1563 glClearColor(col[0], col[1], col[2], alpha);
1567 int UI_ThemeMenuShadowWidth(void)
1569 bTheme *btheme = UI_GetTheme();
1570 return (int)(btheme->tui.menu_shadow_width * UI_DPI_FAC);
1573 void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3], const char axis)
1575 unsigned char col[3];
1579 UI_GetThemeColor3ubv(TH_AXIS_X, col);
1580 UI_GetColorPtrBlendShade3ubv(src_col, col, dst_col, 0.5f, -10);
1583 UI_GetThemeColor3ubv(TH_AXIS_Y, col);
1584 UI_GetColorPtrBlendShade3ubv(src_col, col, dst_col, 0.5f, -10);
1587 UI_GetThemeColor3ubv(TH_AXIS_Z, col);
1588 UI_GetColorPtrBlendShade3ubv(src_col, col, dst_col, 0.5f, -10);
1596 /* ************************************************************* */
1598 /* patching UserDef struct and Themes */
1599 void init_userdef_do_versions(void)
1601 Main *bmain = G.main;
1603 #define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(bmain, ver, subver)
1605 /* the UserDef struct is not corrected with do_versions() .... ugh! */
1606 if (U.wheellinescroll == 0) U.wheellinescroll = 3;
1607 if (U.menuthreshold1 == 0) {
1608 U.menuthreshold1 = 5;
1609 U.menuthreshold2 = 2;
1611 if (U.tb_leftmouse == 0) {
1613 U.tb_rightmouse = 5;
1615 if (U.mixbufsize == 0) U.mixbufsize = 2048;
1616 if (STREQ(U.tempdir, "/")) {
1617 BKE_tempdir_system_init(U.tempdir);
1619 if (U.autokey_mode == 0) {
1620 /* 'add/replace' but not on */
1623 if (U.savetime <= 0) {
1625 // XXX error(STRINGIFY(BLENDER_STARTUP_FILE)" is buggy, please consider removing it.\n");
1627 /* transform widget settings */
1628 if (U.tw_hotspot == 0) {
1630 U.tw_size = 25; /* percentage of window size */
1631 U.tw_handlesize = 16; /* percentage of widget radius */
1633 if (U.pad_rot_angle == 0.0f)
1634 U.pad_rot_angle = 15.0f;
1636 /* graph editor - unselected F-Curve visibility */
1637 if (U.fcu_inactive_alpha == 0) {
1638 U.fcu_inactive_alpha = 0.25f;
1641 /* signal for derivedmesh to use colorband */
1642 /* run in case this was on and is now off in the user prefs [#28096] */
1643 vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL, UI_GetTheme()->tv3d.vertex_unreferenced);
1645 if (!USER_VERSION_ATLEAST(192, 0)) {
1646 strcpy(U.sounddir, "/");
1649 /* patch to set Dupli Armature */
1650 if (!USER_VERSION_ATLEAST(220, 0)) {
1651 U.dupflag |= USER_DUP_ARM;
1654 /* added seam, normal color, undo */
1655 if (!USER_VERSION_ATLEAST(235, 0)) {
1658 U.uiflag |= USER_GLOBALUNDO;
1659 if (U.undosteps == 0) U.undosteps = 32;
1661 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1662 /* check for (alpha == 0) is safe, then color was never set */
1663 if (btheme->tv3d.edge_seam[3] == 0) {
1664 rgba_char_args_set(btheme->tv3d.edge_seam, 230, 150, 50, 255);
1666 if (btheme->tv3d.normal[3] == 0) {
1667 rgba_char_args_set(btheme->tv3d.normal, 0x22, 0xDD, 0xDD, 255);
1669 if (btheme->tv3d.vertex_normal[3] == 0) {
1670 rgba_char_args_set(btheme->tv3d.vertex_normal, 0x23, 0x61, 0xDD, 255);
1672 if (btheme->tv3d.face_dot[3] == 0) {
1673 rgba_char_args_set(btheme->tv3d.face_dot, 255, 138, 48, 255);
1674 btheme->tv3d.facedot_size = 4;
1678 if (!USER_VERSION_ATLEAST(236, 0)) {
1679 /* illegal combo... */
1680 if (U.flag & USER_LMOUSESELECT)
1681 U.flag &= ~USER_TWOBUTTONMOUSE;
1683 if (!USER_VERSION_ATLEAST(237, 0)) {
1685 /* new space type */
1686 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1687 /* check for (alpha == 0) is safe, then color was never set */
1688 if (btheme->ttime.back[3] == 0) {
1689 /* copied from ui_theme_init_default */
1690 btheme->ttime = btheme->tv3d;
1691 rgba_char_args_set_fl(btheme->ttime.back, 0.45, 0.45, 0.45, 1.0);
1692 rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
1693 rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); /* sliders */
1695 if (btheme->text.syntaxn[3] == 0) {
1696 rgba_char_args_set(btheme->text.syntaxn, 0, 0, 200, 255); /* Numbers Blue*/
1697 rgba_char_args_set(btheme->text.syntaxl, 100, 0, 0, 255); /* Strings red */
1698 rgba_char_args_set(btheme->text.syntaxc, 0, 100, 50, 255); /* Comments greenish */
1699 rgba_char_args_set(btheme->text.syntaxv, 95, 95, 0, 255); /* Special */
1700 rgba_char_args_set(btheme->text.syntaxb, 128, 0, 80, 255); /* Builtin, red-purple */
1704 if (!USER_VERSION_ATLEAST(238, 0)) {
1707 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1708 /* check for alpha==0 is safe, then color was never set */
1709 if (btheme->tv3d.bone_solid[3] == 0) {
1710 rgba_char_args_set(btheme->tv3d.bone_solid, 200, 200, 200, 255);
1711 rgba_char_args_set(btheme->tv3d.bone_pose, 80, 200, 255, 80);
1715 if (!USER_VERSION_ATLEAST(239, 0)) {
1718 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1719 /* check for alpha==0 is safe, then color was never set */
1720 if (btheme->tnla.strip[3] == 0) {
1721 rgba_char_args_set(btheme->tnla.strip_select, 0xff, 0xff, 0xaa, 255);
1722 rgba_char_args_set(btheme->tnla.strip, 0xe4, 0x9c, 0xc6, 255);
1726 if (!USER_VERSION_ATLEAST(240, 0)) {
1729 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1730 /* Lamp theme, check for alpha==0 is safe, then color was never set */
1731 if (btheme->tv3d.lamp[3] == 0) {
1732 rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
1733 /* TEMPORAL, remove me! (ton) */
1734 U.uiflag |= USER_PLAINMENUS;
1738 if (U.obcenter_dia == 0) U.obcenter_dia = 6;
1740 if (!USER_VERSION_ATLEAST(242, 0)) {
1742 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1743 /* Node editor theme, check for alpha==0 is safe, then color was never set */
1744 if (btheme->tnode.syntaxn[3] == 0) {
1745 /* re-uses syntax color storage */
1746 btheme->tnode = btheme->tv3d;
1747 rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255);
1748 rgba_char_args_set(btheme->tnode.syntaxl, 150, 150, 150, 255); /* TH_NODE, backdrop */
1749 rgba_char_args_set(btheme->tnode.syntaxn, 129, 131, 144, 255); /* in/output */
1750 rgba_char_args_set(btheme->tnode.syntaxb, 127, 127, 127, 255); /* operator */
1751 rgba_char_args_set(btheme->tnode.syntaxv, 142, 138, 145, 255); /* generator */
1752 rgba_char_args_set(btheme->tnode.syntaxc, 120, 145, 120, 255); /* group */
1754 /* Group theme colors */
1755 if (btheme->tv3d.group[3] == 0) {
1756 rgba_char_args_set(btheme->tv3d.group, 0x0C, 0x30, 0x0C, 255);
1757 rgba_char_args_set(btheme->tv3d.group_active, 0x66, 0xFF, 0x66, 255);
1759 /* Sequence editor theme*/
1760 if (btheme->tseq.movie[3] == 0) {
1761 rgba_char_args_set(btheme->tseq.movie, 81, 105, 135, 255);
1762 rgba_char_args_set(btheme->tseq.image, 109, 88, 129, 255);
1763 rgba_char_args_set(btheme->tseq.scene, 78, 152, 62, 255);
1764 rgba_char_args_set(btheme->tseq.audio, 46, 143, 143, 255);
1765 rgba_char_args_set(btheme->tseq.effect, 169, 84, 124, 255);
1766 rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
1767 rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
1771 /* set defaults for 3D View rotating axis indicator */
1772 /* since size can't be set to 0, this indicates it's not saved in startup.blend */
1773 if (U.rvisize == 0) {
1776 U.uiflag |= USER_SHOW_ROTVIEWICON;
1780 if (!USER_VERSION_ATLEAST(243, 0)) {
1783 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1784 /* long keyframe color */
1785 /* check for alpha==0 is safe, then color was never set */
1786 if (btheme->tact.strip[3] == 0) {
1787 rgba_char_args_set(btheme->tv3d.edge_sharp, 255, 32, 32, 255);
1788 rgba_char_args_set(btheme->tact.strip_select, 0xff, 0xff, 0xaa, 204);
1789 rgba_char_args_set(btheme->tact.strip, 0xe4, 0x9c, 0xc6, 204);
1792 /* IPO-Editor - Vertex Size*/
1793 if (btheme->tipo.vertex_size == 0) {
1794 btheme->tipo.vertex_size = 3;
1798 if (!USER_VERSION_ATLEAST(244, 0)) {
1799 /* set default number of recently-used files (if not set) */
1800 if (U.recent_files == 0) U.recent_files = 10;
1802 if (!USER_VERSION_ATLEAST(245, 3)) {
1804 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1805 rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
1807 if (U.coba_weight.tot == 0)
1808 init_colorband(&U.coba_weight, true);
1810 if (!USER_VERSION_ATLEAST(245, 3)) {
1812 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1813 /* these should all use the same color */
1814 rgba_char_args_set(btheme->tv3d.cframe, 0x60, 0xc0, 0x40, 255);
1815 rgba_char_args_set(btheme->tipo.cframe, 0x60, 0xc0, 0x40, 255);
1816 rgba_char_args_set(btheme->tact.cframe, 0x60, 0xc0, 0x40, 255);
1817 rgba_char_args_set(btheme->tnla.cframe, 0x60, 0xc0, 0x40, 255);
1818 rgba_char_args_set(btheme->tseq.cframe, 0x60, 0xc0, 0x40, 255);
1819 //rgba_char_args_set(btheme->tsnd.cframe, 0x60, 0xc0, 0x40, 255); Not needed anymore
1820 rgba_char_args_set(btheme->ttime.cframe, 0x60, 0xc0, 0x40, 255);
1823 if (!USER_VERSION_ATLEAST(245, 3)) {
1825 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1826 /* action channel groups (recolor anyway) */
1827 rgba_char_args_set(btheme->tact.group, 0x39, 0x7d, 0x1b, 255);
1828 rgba_char_args_set(btheme->tact.group_active, 0x7d, 0xe9, 0x60, 255);
1830 /* bone custom-color sets */
1831 if (btheme->tarm[0].solid[3] == 0)
1832 ui_theme_init_boneColorSets(btheme);
1835 if (!USER_VERSION_ATLEAST(245, 3)) {
1836 U.flag |= USER_ADD_VIEWALIGNED | USER_ADD_EDITMODE;
1838 if (!USER_VERSION_ATLEAST(245, 3)) {
1842 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1845 /* IPO Editor: Handles/Vertices */
1846 col = btheme->tipo.vertex;
1847 rgba_char_args_set(btheme->tipo.handle_vertex, col[0], col[1], col[2], 255);
1848 col = btheme->tipo.vertex_select;
1849 rgba_char_args_set(btheme->tipo.handle_vertex_select, col[0], col[1], col[2], 255);
1850 btheme->tipo.handle_vertex_size = btheme->tipo.vertex_size;
1852 /* Sequence/Image Editor: colors for GPencil text */
1853 col = btheme->tv3d.bone_pose;
1854 rgba_char_args_set(btheme->tseq.bone_pose, col[0], col[1], col[2], 255);
1855 rgba_char_args_set(btheme->tima.bone_pose, col[0], col[1], col[2], 255);
1856 col = btheme->tv3d.vertex_select;
1857 rgba_char_args_set(btheme->tseq.vertex_select, col[0], col[1], col[2], 255);
1860 if (!USER_VERSION_ATLEAST(250, 0)) {
1863 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1864 /* this was not properly initialized in 2.45 */
1865 if (btheme->tima.face_dot[3] == 0) {
1866 rgba_char_args_set(btheme->tima.editmesh_active, 255, 255, 255, 128);
1867 rgba_char_args_set(btheme->tima.face_dot, 255, 133, 0, 255);
1868 btheme->tima.facedot_size = 2;
1871 /* DopeSheet - (Object) Channel color */
1872 rgba_char_args_set(btheme->tact.ds_channel, 82, 96, 110, 255);
1873 rgba_char_args_set(btheme->tact.ds_subchannel, 124, 137, 150, 255);
1874 /* DopeSheet - Group Channel color (saner version) */
1875 rgba_char_args_set(btheme->tact.group, 79, 101, 73, 255);
1876 rgba_char_args_set(btheme->tact.group_active, 135, 177, 125, 255);
1878 /* Graph Editor - (Object) Channel color */
1879 rgba_char_args_set(btheme->tipo.ds_channel, 82, 96, 110, 255);
1880 rgba_char_args_set(btheme->tipo.ds_subchannel, 124, 137, 150, 255);
1881 /* Graph Editor - Group Channel color */
1882 rgba_char_args_set(btheme->tipo.group, 79, 101, 73, 255);
1883 rgba_char_args_set(btheme->tipo.group_active, 135, 177, 125, 255);
1885 /* Nla Editor - (Object) Channel color */
1886 rgba_char_args_set(btheme->tnla.ds_channel, 82, 96, 110, 255);
1887 rgba_char_args_set(btheme->tnla.ds_subchannel, 124, 137, 150, 255);
1888 /* NLA Editor - New Strip colors */
1889 rgba_char_args_set(btheme->tnla.strip, 12, 10, 10, 128);
1890 rgba_char_args_set(btheme->tnla.strip_select, 255, 140, 0, 255);
1893 /* adjust grease-pencil distances */
1894 U.gp_manhattendist = 1;
1895 U.gp_euclideandist = 2;
1897 /* adjust default interpolation for new IPO-curves */
1898 U.ipo_new = BEZT_IPO_BEZ;
1901 if (!USER_VERSION_ATLEAST(250, 1)) {
1904 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1906 /* common (new) variables, it checks for alpha==0 */
1907 ui_theme_init_new(btheme);
1909 if (btheme->tui.wcol_num.outline[3] == 0)
1910 ui_widget_color_init(&btheme->tui);
1912 /* Logic editor theme, check for alpha==0 is safe, then color was never set */
1913 if (btheme->tlogic.syntaxn[3] == 0) {
1914 /* re-uses syntax color storage */
1915 btheme->tlogic = btheme->tv3d;
1916 rgba_char_args_set(btheme->tlogic.back, 100, 100, 100, 255);
1919 rgba_char_args_set_fl(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0);
1920 rgba_char_args_set_fl(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0);
1924 if (!USER_VERSION_ATLEAST(250, 3)) {
1925 /* new audio system */
1926 if (U.audiochannels == 0)
1927 U.audiochannels = 2;
1928 if (U.audiodevice == 0) {
1936 if (U.audioformat == 0)
1937 U.audioformat = 0x24;
1938 if (U.audiorate == 0)
1939 U.audiorate = 48000;
1942 if (!USER_VERSION_ATLEAST(250, 8)) {
1945 for (km = U.user_keymaps.first; km; km = km->next) {
1946 if (STREQ(km->idname, "Armature_Sketch"))
1947 strcpy(km->idname, "Armature Sketch");
1948 else if (STREQ(km->idname, "View3D"))
1949 strcpy(km->idname, "3D View");
1950 else if (STREQ(km->idname, "View3D Generic"))
1951 strcpy(km->idname, "3D View Generic");
1952 else if (STREQ(km->idname, "EditMesh"))
1953 strcpy(km->idname, "Mesh");
1954 else if (STREQ(km->idname, "TimeLine"))
1955 strcpy(km->idname, "Timeline");
1956 else if (STREQ(km->idname, "UVEdit"))
1957 strcpy(km->idname, "UV Editor");
1958 else if (STREQ(km->idname, "Animation_Channels"))
1959 strcpy(km->idname, "Animation Channels");
1960 else if (STREQ(km->idname, "GraphEdit Keys"))
1961 strcpy(km->idname, "Graph Editor");
1962 else if (STREQ(km->idname, "GraphEdit Generic"))
1963 strcpy(km->idname, "Graph Editor Generic");
1964 else if (STREQ(km->idname, "Action_Keys"))
1965 strcpy(km->idname, "Dopesheet");
1966 else if (STREQ(km->idname, "NLA Data"))
1967 strcpy(km->idname, "NLA Editor");
1968 else if (STREQ(km->idname, "Node Generic"))
1969 strcpy(km->idname, "Node Editor");
1970 else if (STREQ(km->idname, "Logic Generic"))
1971 strcpy(km->idname, "Logic Editor");
1972 else if (STREQ(km->idname, "File"))
1973 strcpy(km->idname, "File Browser");
1974 else if (STREQ(km->idname, "FileMain"))
1975 strcpy(km->idname, "File Browser Main");
1976 else if (STREQ(km->idname, "FileButtons"))
1977 strcpy(km->idname, "File Browser Buttons");
1978 else if (STREQ(km->idname, "Buttons Generic"))
1979 strcpy(km->idname, "Property Editor");
1982 if (!USER_VERSION_ATLEAST(250, 16)) {
1983 if (U.wmdrawmethod == USER_DRAW_TRIPLE)
1984 U.wmdrawmethod = USER_DRAW_AUTOMATIC;
1987 if (!USER_VERSION_ATLEAST(252, 3)) {
1988 if (U.flag & USER_LMOUSESELECT)
1989 U.flag &= ~USER_TWOBUTTONMOUSE;
1991 if (!USER_VERSION_ATLEAST(252, 4)) {
1994 /* default new handle type is auto handles */
1995 U.keyhandles_new = HD_AUTO;
1997 /* init new curve colors */
1998 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
1999 ui_theme_space_init_handles_color(&btheme->tv3d);
2000 ui_theme_space_init_handles_color(&btheme->tipo);
2003 rgba_char_args_set_fl(btheme->tv3d.edge_crease, 0.8, 0, 0.6, 1.0);
2006 if (!USER_VERSION_ATLEAST(253, 0)) {
2009 /* init new curve colors */
2010 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2011 if (btheme->tv3d.lastsel_point[3] == 0)
2012 rgba_char_args_set(btheme->tv3d.lastsel_point, 0xff, 0xff, 0xff, 255);
2015 if (!USER_VERSION_ATLEAST(252, 5)) {
2018 /* interface_widgets.c */
2019 struct uiWidgetColors wcol_progress = {
2021 {190, 190, 190, 255},
2022 {100, 100, 100, 180},
2023 {128, 128, 128, 255},
2026 {255, 255, 255, 255},
2032 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2033 /* init progress bar theme */
2034 btheme->tui.wcol_progress = wcol_progress;
2038 if (!USER_VERSION_ATLEAST(255, 2)) {
2040 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2041 rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
2042 rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 32, 0, 255);
2043 rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 0, 128, 255);
2047 if (!USER_VERSION_ATLEAST(256, 4)) {
2049 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2050 if ((btheme->tv3d.outline_width) == 0) btheme->tv3d.outline_width = 1;
2054 if (!USER_VERSION_ATLEAST(257, 0)) {
2055 /* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs,
2056 * so that it doesn't linger around from old configs like a ghost */
2057 U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
2060 if (!USER_VERSION_ATLEAST(258, 2)) {
2062 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2063 btheme->tnode.noodle_curving = 5;
2067 if (!USER_VERSION_ATLEAST(259, 1)) {
2070 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2071 btheme->tv3d.speaker[3] = 255;
2075 if (!USER_VERSION_ATLEAST(260, 3)) {
2078 /* if new keyframes handle default is stuff "auto", make it "auto-clamped" instead
2079 * was changed in 260 as part of GSoC11, but version patch was wrong
2081 if (U.keyhandles_new == HD_AUTO)
2082 U.keyhandles_new = HD_AUTO_ANIM;
2084 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2085 if (btheme->tv3d.bundle_solid[3] == 0)
2086 rgba_char_args_set(btheme->tv3d.bundle_solid, 200, 200, 200, 255);
2088 if (btheme->tv3d.camera_path[3] == 0)
2089 rgba_char_args_set(btheme->tv3d.camera_path, 0x00, 0x00, 0x00, 255);
2091 if ((btheme->tclip.back[3]) == 0) {
2092 btheme->tclip = btheme->tv3d;
2094 rgba_char_args_set(btheme->tclip.marker_outline, 0x00, 0x00, 0x00, 255);
2095 rgba_char_args_set(btheme->tclip.marker, 0x7f, 0x7f, 0x00, 255);
2096 rgba_char_args_set(btheme->tclip.act_marker, 0xff, 0xff, 0xff, 255);
2097 rgba_char_args_set(btheme->tclip.sel_marker, 0xff, 0xff, 0x00, 255);
2098 rgba_char_args_set(btheme->tclip.dis_marker, 0x7f, 0x00, 0x00, 255);
2099 rgba_char_args_set(btheme->tclip.lock_marker, 0x7f, 0x7f, 0x7f, 255);
2100 rgba_char_args_set(btheme->tclip.path_before, 0xff, 0x00, 0x00, 255);
2101 rgba_char_args_set(btheme->tclip.path_after, 0x00, 0x00, 0xff, 255);
2102 rgba_char_args_set(btheme->tclip.grid, 0x5e, 0x5e, 0x5e, 255);
2103 rgba_char_args_set(btheme->tclip.cframe, 0x60, 0xc0, 0x40, 255);
2104 rgba_char_args_set(btheme->tclip.handle_vertex, 0x00, 0x00, 0x00, 0xff);
2105 rgba_char_args_set(btheme->tclip.handle_vertex_select, 0xff, 0xff, 0, 0xff);
2106 btheme->tclip.handle_vertex_size = 5;
2109 /* auto-clamped handles -> based on auto */
2110 if (btheme->tipo.handle_auto_clamped[3] == 0)
2111 rgba_char_args_set(btheme->tipo.handle_auto_clamped, 0x99, 0x40, 0x30, 255);
2112 if (btheme->tipo.handle_sel_auto_clamped[3] == 0)
2113 rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
2116 /* enable (Cycles) addon by default */
2117 if (!BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module))) {
2118 bAddon *baddon = MEM_callocN(sizeof(bAddon), "bAddon");
2119 BLI_strncpy(baddon->module, "cycles", sizeof(baddon->module));
2120 BLI_addtail(&U.addons, baddon);
2124 if (!USER_VERSION_ATLEAST(260, 5)) {
2127 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2128 rgba_char_args_set(btheme->tui.panel.header, 0, 0, 0, 25);
2129 btheme->tui.icon_alpha = 1.0;
2133 if (!USER_VERSION_ATLEAST(261, 4)) {
2135 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2136 rgba_char_args_set_fl(btheme->tima.preview_stitch_face, 0.071, 0.259, 0.694, 0.150);
2137 rgba_char_args_set_fl(btheme->tima.preview_stitch_edge, 1.0, 0.522, 0.0, 0.7);
2138 rgba_char_args_set_fl(btheme->tima.preview_stitch_vert, 1.0, 0.522, 0.0, 0.5);
2139 rgba_char_args_set_fl(btheme->tima.preview_stitch_stitchable, 0.0, 1.0, 0.0, 1.0);
2140 rgba_char_args_set_fl(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
2141 rgba_char_args_set_fl(btheme->tima.preview_stitch_active, 0.886, 0.824, 0.765, 0.140);
2143 rgba_char_args_set_fl(btheme->toops.match, 0.2, 0.5, 0.2, 0.3);
2144 rgba_char_args_set_fl(btheme->toops.selected_highlight, 0.51, 0.53, 0.55, 0.3);
2147 U.use_16bit_textures = true;
2150 if (!USER_VERSION_ATLEAST(262, 2)) {
2152 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2153 if (btheme->tui.wcol_menu_item.item[3] == 255)
2154 rgba_char_args_set(btheme->tui.wcol_menu_item.item, 172, 172, 172, 128);
2158 if (!USER_VERSION_ATLEAST(262, 3)) {
2160 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2161 if (btheme->tui.wcol_tooltip.inner[3] == 0) {
2162 btheme->tui.wcol_tooltip = btheme->tui.wcol_menu_back;
2164 if (btheme->tui.wcol_tooltip.text[0] == 160) { /* hrmf */
2165 rgba_char_args_set(btheme->tui.wcol_tooltip.text, 255, 255, 255, 255);
2170 if (!USER_VERSION_ATLEAST(262, 4)) {
2172 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2173 if (btheme->tseq.movieclip[3] == 0) {
2174 rgba_char_args_set(btheme->tseq.movieclip, 32, 32, 143, 255);
2179 if (!USER_VERSION_ATLEAST(263, 2)) {
2181 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2182 if (btheme->tclip.strip[0] == 0) {
2183 rgba_char_args_set(btheme->tclip.list, 0x66, 0x66, 0x66, 0xff);
2184 rgba_char_args_set(btheme->tclip.strip, 0x0c, 0x0a, 0x0a, 0x80);
2185 rgba_char_args_set(btheme->tclip.strip_select, 0xff, 0x8c, 0x00, 0xff);
2190 if (!USER_VERSION_ATLEAST(263, 6)) {
2192 for (btheme = U.themes.first; btheme; btheme = btheme->next)
2193 rgba_char_args_set(btheme->tv3d.skin_root, 180, 77, 77, 255);
2196 if (!USER_VERSION_ATLEAST(263, 7)) {
2199 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2200 /* DopeSheet Summary */
2201 rgba_char_args_set(btheme->tact.anim_active, 204, 112, 26, 102);
2204 rgba_char_args_set(btheme->tnla.anim_active, 204, 112, 26, 102); /* same as dopesheet above */
2205 rgba_char_args_set(btheme->tnla.anim_non_active, 153, 135, 97, 77);
2207 rgba_char_args_set(btheme->tnla.nla_tweaking, 77, 243, 26, 77);
2208 rgba_char_args_set(btheme->tnla.nla_tweakdupli, 217, 0, 0, 255);
2210 rgba_char_args_set(btheme->tnla.nla_transition, 28, 38, 48, 255);
2211 rgba_char_args_set(btheme->tnla.nla_transition_sel, 46, 117, 219, 255);
2212 rgba_char_args_set(btheme->tnla.nla_meta, 51, 38, 66, 255);
2213 rgba_char_args_set(btheme->tnla.nla_meta_sel, 105, 33, 150, 255);
2214 rgba_char_args_set(btheme->tnla.nla_sound, 43, 61, 61, 255);
2215 rgba_char_args_set(btheme->tnla.nla_sound_sel, 31, 122, 122, 255);
2219 if (!USER_VERSION_ATLEAST(263, 11)) {
2221 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2222 if (btheme->tseq.mask[3] == 0) {
2223 rgba_char_args_set(btheme->tseq.mask, 152, 78, 62, 255);
2228 if (!USER_VERSION_ATLEAST(263, 15)) {
2230 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2231 rgba_char_args_set(btheme->tv3d.bone_pose_active, 140, 255, 255, 80);
2235 if (!USER_VERSION_ATLEAST(263, 16)) {
2238 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2239 if (btheme->tact.anim_active[3] == 0)
2240 rgba_char_args_set(btheme->tact.anim_active, 204, 112, 26, 102);
2242 if (btheme->tnla.anim_active[3] == 0)
2243 rgba_char_args_set(btheme->tnla.anim_active, 204, 112, 26, 102);
2247 if (!USER_VERSION_ATLEAST(263, 22)) {
2250 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2251 if (btheme->tipo.lastsel_point[3] == 0)
2252 rgba_char_args_set(btheme->tipo.lastsel_point, 0xff, 0xff, 0xff, 255);
2254 if (btheme->tv3d.skin_root[3] == 0)
2255 rgba_char_args_set(btheme->tv3d.skin_root, 180, 77, 77, 255);
2259 if (!USER_VERSION_ATLEAST(264, 9)) {
2262 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2263 rgba_char_args_set(btheme->tui.xaxis, 220, 0, 0, 255);
2264 rgba_char_args_set(btheme->tui.yaxis, 0, 220, 0, 255);
2265 rgba_char_args_set(btheme->tui.zaxis, 0, 0, 220, 255);
2269 if (!USER_VERSION_ATLEAST(267, 0)) {
2270 /* Freestyle color settings */
2273 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2274 /* check for alpha == 0 is safe, then color was never set */
2275 if (btheme->tv3d.freestyle_edge_mark[3] == 0) {
2276 rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
2277 rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
2280 if (btheme->tv3d.wire_edit[3] == 0) {
2281 rgba_char_args_set(btheme->tv3d.wire_edit, 0x0, 0x0, 0x0, 255);
2285 /* GL Texture Garbage Collection */
2286 if (U.textimeout == 0) {
2287 U.texcollectrate = 60;
2290 if (U.memcachelimit <= 0) {
2291 U.memcachelimit = 32;
2293 if (U.frameserverport == 0) {
2294 U.frameserverport = 8080;
2296 if (U.dbl_click_time == 0) {
2297 U.dbl_click_time = 350;
2299 if (U.scrcastfps == 0) {
2303 if (U.v2d_min_gridsize == 0) {
2304 U.v2d_min_gridsize = 35;
2306 if (U.dragthreshold == 0)
2307 U.dragthreshold = 5;
2308 if (U.widget_unit == 0)
2310 if (U.anisotropic_filter <= 0)
2311 U.anisotropic_filter = 1;
2313 if (U.ndof_sensitivity == 0.0f) {
2314 U.ndof_sensitivity = 1.0f;
2315 U.ndof_flag = (NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE);
2318 if (U.ndof_orbit_sensitivity == 0.0f) {
2319 U.ndof_orbit_sensitivity = U.ndof_sensitivity;
2321 if (!(U.flag & USER_TRACKBALL))
2322 U.ndof_flag |= NDOF_TURNTABLE;
2324 if (U.tweak_threshold == 0)
2325 U.tweak_threshold = 10;
2328 if (!USER_VERSION_ATLEAST(265, 1)) {
2331 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2332 /* note: the toggle operator for transparent backdrops limits to these spacetypes */
2333 if (btheme->tnode.button[3] == 255) {
2334 btheme->tv3d.button[3] = 128;
2335 btheme->tnode.button[3] = 128;
2336 btheme->tima.button[3] = 128;
2337 btheme->tseq.button[3] = 128;
2338 btheme->tclip.button[3] = 128;
2343 /* panel header/backdrop supported locally per editor now */
2344 if (!USER_VERSION_ATLEAST(265, 2)) {
2347 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2350 /* new color, panel backdrop. Not used anywhere yet, until you enable it */
2351 copy_v3_v3_char(btheme->tui.panel.back, btheme->tbuts.button);
2352 btheme->tui.panel.back[3] = 128;
2354 for (ts = UI_THEMESPACE_START(btheme); ts != UI_THEMESPACE_END(btheme); ts++) {
2355 ts->panelcolors = btheme->tui.panel;
2360 /* NOTE!! from now on use U.versionfile and U.subversionfile */
2361 #undef USER_VERSION_ATLEAST
2362 #define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST((&(U)), ver, subver)
2364 if (!USER_VERSION_ATLEAST(266, 0)) {
2367 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2368 /* rna definition limits fac to 0.01 */
2369 if (btheme->tui.menu_shadow_fac == 0.0f) {
2370 btheme->tui.menu_shadow_fac = 0.5f;
2371 btheme->tui.menu_shadow_width = 12;
2376 if (!USER_VERSION_ATLEAST(265, 4)) {
2378 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2379 rgba_char_args_set(btheme->text.syntaxd, 50, 0, 140, 255); /* Decorator/Preprocessor Dir. Blue-purple */
2380 rgba_char_args_set(btheme->text.syntaxr, 140, 60, 0, 255); /* Reserved Orange */
2381 rgba_char_args_set(btheme->text.syntaxs, 76, 76, 76, 255); /* Gray (mix between fg/bg) */
2385 if (!USER_VERSION_ATLEAST(265, 6)) {
2387 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2388 copy_v4_v4_char(btheme->tv3d.gradients.high_gradient, btheme->tv3d.back);
2392 if (!USER_VERSION_ATLEAST(265, 9)) {
2394 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2395 rgba_char_args_test_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */
2396 rgba_char_args_test_set(btheme->tnode.syntaxd, 116, 151, 151, 255); /* distort nodes */
2400 if (!USER_VERSION_ATLEAST(265, 11)) {
2402 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2403 rgba_char_args_test_set(btheme->tconsole.console_select, 255, 255, 255, 48);
2407 if (!USER_VERSION_ATLEAST(266, 2)) {
2409 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2410 rgba_char_args_test_set(btheme->tnode.console_output, 223, 202, 53, 255); /* interface nodes */
2414 if (!USER_VERSION_ATLEAST(268, 3)) {
2416 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2417 rgba_char_args_test_set(btheme->tima.uv_others, 96, 96, 96, 255);
2418 rgba_char_args_test_set(btheme->tima.uv_shadow, 112, 112, 112, 255);
2422 if (!USER_VERSION_ATLEAST(269, 5)) {
2424 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2425 rgba_char_args_set(btheme->tima.wire_edit, 192, 192, 192, 255);
2426 rgba_char_args_set(btheme->tima.edge_select, 255, 133, 0, 255);
2430 if (!USER_VERSION_ATLEAST(269, 6)) {
2432 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2434 r = btheme->tnode.syntaxn[0];
2435 g = btheme->tnode.syntaxn[1];
2436 b = btheme->tnode.syntaxn[2];
2437 rgba_char_args_test_set(btheme->tnode.nodeclass_output, r, g, b, 255);
2438 r = btheme->tnode.syntaxb[0];
2439 g = btheme->tnode.syntaxb[1];
2440 b = btheme->tnode.syntaxb[2];
2441 rgba_char_args_test_set(btheme->tnode.nodeclass_filter, r, g, b, 255);
2442 rgba_char_args_test_set(btheme->tnode.nodeclass_vector, r, g, b, 255);
2443 rgba_char_args_test_set(btheme->tnode.nodeclass_texture, r, g, b, 255);
2444 rgba_char_args_test_set(btheme->tnode.nodeclass_shader, r, g, b, 255);
2445 rgba_char_args_test_set(btheme->tnode.nodeclass_script, r, g, b, 255);
2446 rgba_char_args_test_set(btheme->tnode.nodeclass_pattern, r, g, b, 255);
2447 rgba_char_args_test_set(btheme->tnode.nodeclass_layout, r, g, b, 255);
2451 if (!USER_VERSION_ATLEAST(269, 8)) {
2453 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2454 rgba_char_args_test_set(btheme->tinfo.info_selected, 96, 128, 255, 255);
2455 rgba_char_args_test_set(btheme->tinfo.info_selected_text, 255, 255, 255, 255);
2456 rgba_char_args_test_set(btheme->tinfo.info_error, 220, 0, 0, 255);
2457 rgba_char_args_test_set(btheme->tinfo.info_error_text, 0, 0, 0, 255);
2458 rgba_char_args_test_set(btheme->tinfo.info_warning, 220, 128, 96, 255);
2459 rgba_char_args_test_set(btheme->tinfo.info_warning_text, 0, 0, 0, 255);
2460 rgba_char_args_test_set(btheme->tinfo.info_info, 0, 170, 0, 255);
2461 rgba_char_args_test_set(btheme->tinfo.info_info_text, 0, 0, 0, 255);
2462 rgba_char_args_test_set(btheme->tinfo.info_debug, 196, 196, 196, 255);
2463 rgba_char_args_test_set(btheme->tinfo.info_debug_text, 0, 0, 0, 255);
2467 if (!USER_VERSION_ATLEAST(269, 9)) {
2470 U.tw_size = U.tw_size * 5.0f;
2472 /* Action Editor (and NLA Editor) - Keyframe Colors */
2473 /* Graph Editor - larger vertex size defaults */
2474 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2475 /* Action Editor ................. */
2477 rgba_char_args_set(btheme->tact.keytype_keyframe, 232, 232, 232, 255);
2478 rgba_char_args_set(btheme->tact.keytype_keyframe_select, 255, 190, 50, 255);
2479 rgba_char_args_set(btheme->tact.keytype_extreme, 232, 179, 204, 255);
2480 rgba_char_args_set(btheme->tact.keytype_extreme_select, 242, 128, 128, 255);
2481 rgba_char_args_set(btheme->tact.keytype_breakdown, 179, 219, 232, 255);
2482 rgba_char_args_set(btheme->tact.keytype_breakdown_select, 84, 191, 237, 255);
2483 rgba_char_args_set(btheme->tact.keytype_jitter, 148, 229, 117, 255);
2484 rgba_char_args_set(btheme->tact.keytype_jitter_select, 97, 192, 66, 255);
2487 rgba_char_args_set(btheme->tact.keyborder, 0, 0, 0, 255);
2488 rgba_char_args_set(btheme->tact.keyborder_select, 0, 0, 0, 255);
2490 /* NLA ............................ */
2492 rgba_char_args_set(btheme->tnla.keyborder, 0, 0, 0, 255);
2493 rgba_char_args_set(btheme->tnla.keyborder_select, 0, 0, 0, 255);
2495 /* Graph Editor ................... */
2496 btheme->tipo.vertex_size = 6;
2497 btheme->tipo.handle_vertex_size = 5;
2500 /* grease pencil - new layer color */
2501 if (U.gpencil_new_layer_col[3] < 0.1f) {
2502 /* defaults to black, but must at least be visible! */
2503 U.gpencil_new_layer_col[3] = 0.9f;
2507 if (!USER_VERSION_ATLEAST(269, 10)) {
2509 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2512 for (ts = UI_THEMESPACE_START(btheme); ts != UI_THEMESPACE_END(btheme); ts++) {
2513 rgba_char_args_set(ts->tab_active, 114, 114, 114, 255);
2514 rgba_char_args_set(ts->tab_inactive, 83, 83, 83, 255);
2515 rgba_char_args_set(ts->tab_back, 64, 64, 64, 255);
2516 rgba_char_args_set(ts->tab_outline, 60, 60, 60, 255);
2521 if (!USER_VERSION_ATLEAST(271, 0)) {
2523 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2524 rgba_char_args_set(btheme->tui.wcol_tooltip.text, 255, 255, 255, 255);
2528 if (!USER_VERSION_ATLEAST(272, 2)) {
2530 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2531 rgba_char_args_set_fl(btheme->tv3d.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f);
2532 rgba_char_args_set_fl(btheme->tv3d.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f);
2533 rgba_char_args_set_fl(btheme->tima.paint_curve_handle, 0.5f, 1.0f, 0.5f, 0.5f);
2534 rgba_char_args_set_fl(btheme->tima.paint_curve_pivot, 1.0f, 0.5f, 0.5f, 0.5f);
2535 rgba_char_args_set(btheme->tnode.syntaxr, 115, 115, 115, 255);
2539 if (!USER_VERSION_ATLEAST(271, 5)) {
2542 struct uiWidgetColors wcol_pie_menu = {
2545 {140, 140, 140, 255},
2548 {160, 160, 160, 255},
2549 {255, 255, 255, 255},
2555 U.pie_menu_radius = 100;
2556 U.pie_menu_threshold = 12;
2557 U.pie_animation_timeout = 6;
2559 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2560 btheme->tui.wcol_pie_menu = wcol_pie_menu;
2562 ui_theme_space_init_handles_color(&btheme->tclip);
2563 ui_theme_space_init_handles_color(&btheme->tima);
2564 btheme->tima.handle_vertex_size = 5;
2565 btheme->tclip.handle_vertex_size = 5;
2569 if (!USER_VERSION_ATLEAST(271, 6)) {
2571 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2572 /* check for (alpha == 0) is safe, then color was never set */
2573 if (btheme->tv3d.loop_normal[3] == 0) {
2574 rgba_char_args_set(btheme->tv3d.loop_normal, 0xDD, 0x23, 0xDD, 255);
2579 if (!USER_VERSION_ATLEAST(272, 3)) {
2581 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2582 rgba_char_args_set_fl(btheme->tui.widget_emboss, 1.0f, 1.0f, 1.0f, 0.02f);
2586 if (!USER_VERSION_ATLEAST(273, 1)) {
2588 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2589 /* Grease Pencil vertex settings */
2590 rgba_char_args_set(btheme->tv3d.gp_vertex, 0, 0, 0, 255);
2591 rgba_char_args_set(btheme->tv3d.gp_vertex_select, 255, 133, 0, 255);
2592 btheme->tv3d.gp_vertex_size = 3;
2594 rgba_char_args_set(btheme->tseq.gp_vertex, 0, 0, 0, 255);
2595 rgba_char_args_set(btheme->tseq.gp_vertex_select, 255, 133, 0, 255);
2596 btheme->tseq.gp_vertex_size = 3;
2598 rgba_char_args_set(btheme->tima.gp_vertex, 0, 0, 0, 255);
2599 rgba_char_args_set(btheme->tima.gp_vertex_select, 255, 133, 0, 255);
2600 btheme->tima.gp_vertex_size = 3;
2602 rgba_char_args_set(btheme->tnode.gp_vertex, 0, 0, 0, 255);
2603 rgba_char_args_set(btheme->tnode.gp_vertex_select, 255, 133, 0, 255);
2604 btheme->tnode.gp_vertex_size = 3;
2606 /* Timeline Keyframe Indicators */
2607 rgba_char_args_set(btheme->ttime.time_keyframe, 0xDD, 0xD7, 0x00, 1.0);
2608 rgba_char_args_set(btheme->ttime.time_gp_keyframe, 0xB5, 0xE6, 0x1D, 1.0);
2612 if (!USER_VERSION_ATLEAST(273, 5)) {
2614 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2615 unsigned char *cp = (unsigned char *)btheme->tv3d.clipping_border_3d;
2617 copy_v4_v4_char((char *)cp, btheme->tv3d.back);
2631 if (!USER_VERSION_ATLEAST(274, 5)) {
2633 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2634 copy_v4_v4_char(btheme->tima.metadatatext, btheme->tima.text_hi);
2635 copy_v4_v4_char(btheme->tseq.metadatatext, btheme->tseq.text_hi);
2639 if (!USER_VERSION_ATLEAST(275, 1)) {
2641 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2642 copy_v4_v4_char(btheme->tclip.metadatatext, btheme->tseq.text_hi);
2646 if (!USER_VERSION_ATLEAST(275, 2)) {
2647 U.ndof_deadzone = 0.1;
2650 if (!USER_VERSION_ATLEAST(275, 4)) {
2654 if (!USER_VERSION_ATLEAST(276, 1)) {
2656 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2657 rgba_char_args_set_fl(btheme->tima.preview_back, 0.0f, 0.0f, 0.0f, 0.3f);
2661 if (!USER_VERSION_ATLEAST(276, 2)) {
2663 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2664 rgba_char_args_set(btheme->tclip.gp_vertex, 0, 0, 0, 255);
2665 rgba_char_args_set(btheme->tclip.gp_vertex_select, 255, 133, 0, 255);
2666 btheme->tclip.gp_vertex_size = 3;
2670 if (!USER_VERSION_ATLEAST(276, 3)) {
2672 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2673 rgba_char_args_set(btheme->tseq.text_strip, 162, 151, 0, 255);
2677 if (!USER_VERSION_ATLEAST(276, 8)) {
2679 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2680 rgba_char_args_set(btheme->tui.wcol_progress.item, 128, 128, 128, 255);
2684 if (!USER_VERSION_ATLEAST(276, 10)) {
2686 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2687 /* 3dView Keyframe Indicators */
2688 rgba_char_args_set(btheme->tv3d.time_keyframe, 0xDD, 0xD7, 0x00, 1.0);
2689 rgba_char_args_set(btheme->tv3d.time_gp_keyframe, 0xB5, 0xE6, 0x1D, 1.0);
2693 if (!USER_VERSION_ATLEAST(277, 0)) {
2695 for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2696 if (memcmp(btheme->tui.wcol_list_item.item, btheme->tui.wcol_list_item.text_sel, sizeof(char) * 3) == 0) {
2697 copy_v4_v4_char(btheme->tui.wcol_list_item.item, btheme->tui.wcol_text.item);
2698 copy_v4_v4_char(btheme->tui.wcol_list_item.text_sel, btheme->tui.wcol_text.text_sel);
2704 * Include next version bump.
2706 * (keep this block even if it becomes empty).
2711 if (U.pixelsize == 0.0f)
2714 if (U.image_draw_method == 0)
2715 U.image_draw_method = IMAGE_DRAW_METHOD_2DTEXTURE;
2717 // keep the following until the new audaspace is default to be built with
2718 #ifdef WITH_SYSTEM_AUDASPACE
2719 // we default to the first audio device
2723 /* funny name, but it is GE stuff, moves userdef stuff to engine */
2724 // XXX space_set_commmandline_options();
2725 /* this timer uses U */
2726 // XXX reset_autosave();