307
311
cp = &ts->facedot_size; break;
308
312
case TH_DRAWEXTRA_EDGELEN:
309
313
cp = ts->extra_edge_len; break;
314
case TH_DRAWEXTRA_EDGEANG:
315
cp = ts->extra_edge_angle; break;
310
316
case TH_DRAWEXTRA_FACEAREA:
311
317
cp = ts->extra_face_area; break;
312
318
case TH_DRAWEXTRA_FACEANG:
359
365
cp = ts->handle_sel_vect; break;
360
366
case TH_HANDLE_SEL_ALIGN:
361
367
cp = ts->handle_sel_align; break;
368
case TH_FREESTYLE_EDGE_MARK:
369
cp = ts->freestyle_edge_mark; break;
370
case TH_FREESTYLE_FACE_MARK:
371
cp = ts->freestyle_face_mark; break;
363
373
case TH_SYNTAX_B:
364
374
cp = ts->syntaxb; break;
728
739
rgba_char_args_set_fl(btheme->tv3d.grid, 0.251, 0.251, 0.251, 1.0);
729
740
rgba_char_args_set(btheme->tv3d.wire, 0x0, 0x0, 0x0, 255);
741
rgba_char_args_set(btheme->tv3d.wire_edit, 0x0, 0x0, 0x0, 255);
730
742
rgba_char_args_set(btheme->tv3d.lamp, 0, 0, 0, 40);
731
743
rgba_char_args_set(btheme->tv3d.speaker, 0, 0, 0, 255);
732
744
rgba_char_args_set(btheme->tv3d.camera, 0, 0, 0, 255);
738
750
rgba_char_args_set(btheme->tv3d.transform, 0xff, 0xff, 0xff, 255);
739
751
rgba_char_args_set(btheme->tv3d.vertex, 0, 0, 0, 255);
740
752
rgba_char_args_set(btheme->tv3d.vertex_select, 255, 133, 0, 255);
753
rgba_char_args_set(btheme->tv3d.vertex_unreferenced, 0, 0, 0, 255);
741
754
btheme->tv3d.vertex_size = 3;
742
755
btheme->tv3d.outline_width = 1;
743
756
rgba_char_args_set(btheme->tv3d.edge, 0x0, 0x0, 0x0, 255);
758
771
rgba_char_args_set(btheme->tv3d.button_text_hi, 255, 255, 255, 255);
759
772
rgba_char_args_set(btheme->tv3d.button_title, 0, 0, 0, 255);
760
773
rgba_char_args_set(btheme->tv3d.title, 0, 0, 0, 255);
774
rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
775
rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
762
777
btheme->tv3d.facedot_size = 4;
764
779
rgba_char_args_set(btheme->tv3d.extra_edge_len, 32, 0, 0, 255);
780
rgba_char_args_set(btheme->tv3d.extra_edge_angle, 32, 32, 0, 255);
765
781
rgba_char_args_set(btheme->tv3d.extra_face_area, 0, 32, 0, 255);
766
782
rgba_char_args_set(btheme->tv3d.extra_face_angle, 0, 0, 128, 255);
882
898
rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
883
899
rgba_char_args_set(btheme->tseq.meta, 109, 145, 131, 255);
884
900
rgba_char_args_set(btheme->tseq.preview_back, 0, 0, 0, 255);
901
rgba_char_args_set(btheme->tseq.grid, 64, 64, 64, 255);
886
903
/* space image */
887
904
btheme->tima = btheme->tv3d;
949
966
rgba_char_args_set_fl(btheme->ttime.grid, 0.36, 0.36, 0.36, 1.0);
950
967
rgba_char_args_set(btheme->ttime.shade1, 173, 173, 173, 255); /* sliders */
952
/* space node, re-uses syntax color storage */
969
/* space node, re-uses syntax and console color storage */
953
970
btheme->tnode = btheme->tv3d;
954
971
rgba_char_args_set(btheme->tnode.edge_select, 255, 255, 255, 255); /* wire selected */
955
972
rgba_char_args_set(btheme->tnode.syntaxl, 155, 155, 155, 160); /* TH_NODE, backdrop */
958
975
rgba_char_args_set(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
959
976
rgba_char_args_set(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
960
977
rgba_char_args_set(btheme->tnode.movie, 155, 155, 155, 160); /* frame */
978
rgba_char_args_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */
979
rgba_char_args_set(btheme->tnode.syntaxd, 116, 151, 151, 255); /* distort nodes */
980
rgba_char_args_set(btheme->tnode.console_output, 223, 202, 53, 255); /* interface nodes */
961
981
btheme->tnode.noodle_curving = 5;
963
983
/* space logic */
985
1005
btheme->tclip.handle_vertex_size = 4;
1008
void ui_style_init_default(void)
1010
BLI_freelistN(&U.uistyles);
1011
/* gets automatically re-allocated */
989
1016
void UI_SetTheme(int spacetype, int regionid)
991
if (spacetype == 0) { /* called for safety, when delete themes */
1019
/* later on, a local theme can be found too */
1020
theme_active = U.themes.first;
1021
theme_spacetype = spacetype;
1022
theme_regionid = regionid;
1024
else if (regionid) {
1026
theme_active = U.themes.first;
1027
theme_spacetype = SPACE_BUTS;
1028
theme_regionid = regionid;
1031
/* for safety, when theme was deleted */
992
1032
theme_active = U.themes.first;
993
1033
theme_spacetype = SPACE_VIEW3D;
994
1034
theme_regionid = RGN_TYPE_WINDOW;
997
/* later on, a local theme can be found too */
998
theme_active = U.themes.first;
999
theme_spacetype = spacetype;
1000
theme_regionid = regionid;
1004
1038
bTheme *UI_GetTheme(void)
1533
1566
rgba_char_args_set(btheme->tv3d.editmesh_active, 255, 255, 255, 128);
1535
1568
if (U.coba_weight.tot == 0)
1536
init_colorband(&U.coba_weight, 1);
1569
init_colorband(&U.coba_weight, true);
1538
1571
if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 11)) {
1539
1572
bTheme *btheme;
2018
/* GL Texture Garbage Collection (variable abused above!) */
2019
if (U.textimeout == 0) {
2020
U.texcollectrate = 60;
2023
if (U.memcachelimit <= 0) {
2024
U.memcachelimit = 32;
2026
if (U.frameserverport == 0) {
2027
U.frameserverport = 8080;
2029
if (U.dbl_click_time == 0) {
2030
U.dbl_click_time = 350;
2032
if (U.scrcastfps == 0) {
2036
if (U.v2d_min_gridsize == 0) {
2037
U.v2d_min_gridsize = 35;
2039
if (U.dragthreshold == 0)
2040
U.dragthreshold = 5;
2041
if (U.widget_unit == 0)
2043
if (U.anisotropic_filter <= 0)
2044
U.anisotropic_filter = 1;
2046
if (U.ndof_sensitivity == 0.0f) {
2047
U.ndof_sensitivity = 1.0f;
2048
U.ndof_flag = NDOF_LOCK_HORIZON |
2049
NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE;
2052
if (U.ndof_orbit_sensitivity == 0.0f) {
2053
U.ndof_orbit_sensitivity = U.ndof_sensitivity;
2055
if (!(U.flag & USER_TRACKBALL))
2056
U.ndof_flag |= NDOF_TURNTABLE;
2058
if (U.tweak_threshold == 0)
2059
U.tweak_threshold = 10;
2051
if (U.versionfile < 267) {
2052
/* Freestyle color settings */
2055
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2056
/* check for alpha == 0 is safe, then color was never set */
2057
if (btheme->tv3d.freestyle_edge_mark[3] == 0) {
2058
rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
2059
rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
2062
if (btheme->tv3d.wire_edit[3] == 0) {
2063
rgba_char_args_set(btheme->tv3d.wire_edit, 0x0, 0x0, 0x0, 255);
2067
/* GL Texture Garbage Collection */
2068
if (U.textimeout == 0) {
2069
U.texcollectrate = 60;
2072
if (U.memcachelimit <= 0) {
2073
U.memcachelimit = 32;
2075
if (U.frameserverport == 0) {
2076
U.frameserverport = 8080;
2078
if (U.dbl_click_time == 0) {
2079
U.dbl_click_time = 350;
2081
if (U.scrcastfps == 0) {
2085
if (U.v2d_min_gridsize == 0) {
2086
U.v2d_min_gridsize = 35;
2088
if (U.dragthreshold == 0)
2089
U.dragthreshold = 5;
2090
if (U.widget_unit == 0)
2092
if (U.anisotropic_filter <= 0)
2093
U.anisotropic_filter = 1;
2095
if (U.ndof_sensitivity == 0.0f) {
2096
U.ndof_sensitivity = 1.0f;
2097
U.ndof_flag = (NDOF_LOCK_HORIZON | NDOF_SHOULD_PAN | NDOF_SHOULD_ZOOM | NDOF_SHOULD_ROTATE);
2100
if (U.ndof_orbit_sensitivity == 0.0f) {
2101
U.ndof_orbit_sensitivity = U.ndof_sensitivity;
2103
if (!(U.flag & USER_TRACKBALL))
2104
U.ndof_flag |= NDOF_TURNTABLE;
2106
if (U.tweak_threshold == 0)
2107
U.tweak_threshold = 10;
2061
2110
if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 1)) {
2062
2111
bTheme *btheme;
2199
if (U.versionfile < 266 || (U.versionfile == 266 && U.subversionfile < 2)) {
2201
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
2202
rgba_char_args_test_set(btheme->tnode.console_output, 223, 202, 53, 255); /* interface nodes */
2150
2206
/* NOTE!! from now on use U.versionfile and U.subversionfile */
2153
2209
if (U.pixelsize == 0.0f)
2154
2210
U.pixelsize = 1.0f;
2212
if (U.image_draw_method == 0)
2213
U.image_draw_method = IMAGE_DRAW_METHOD_2DTEXTURE;
2156
2215
/* funny name, but it is GE stuff, moves userdef stuff to engine */
2157
2216
// XXX space_set_commmandline_options();
2158
2217
/* this timer uses U */