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 * Contributor(s): Blender Foundation (2008).
20 * ***** END GPL LICENSE BLOCK *****
23 /** \file blender/makesrna/intern/rna_userdef.c
30 #include "RNA_define.h"
31 #include "RNA_enum_types.h"
33 #include "rna_internal.h"
35 #include "DNA_curve_types.h"
36 #include "DNA_space_types.h"
37 #include "DNA_userdef_types.h"
38 #include "DNA_brush_types.h"
39 #include "DNA_view3d_types.h"
44 #include "BLI_utildefines.h"
45 #include "BLF_translation.h"
47 #include "BKE_sound.h"
51 #include "DNA_object_types.h"
52 #include "DNA_screen_types.h"
54 #include "BKE_DerivedMesh.h"
55 #include "BKE_depsgraph.h"
56 #include "BKE_global.h"
63 #include "MEM_guardedalloc.h"
64 #include "MEM_CacheLimiterC-Api.h"
66 #include "UI_interface.h"
68 static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
70 WM_main_add_notifier(NC_WINDOW, NULL);
73 static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
75 U.widget_unit = (U.dpi * 20 + 36)/72;
76 WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */
77 WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); /* refresh region sizes */
80 static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
87 static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr)
89 UserDef *userdef = (UserDef *)ptr->data;
91 /* lame, loop over all views and set */
96 /* from scene copy to the other views */
97 for(sc=bmain->screen.first; sc; sc=sc->id.next) {
98 for(sa=sc->areabase.first; sa; sa=sa->next) {
99 for(sl=sa->spacedata.first; sl; sl=sl->next) {
100 if(sl->spacetype==SPACE_VIEW3D) {
101 View3D *v3d= (View3D *)sl;
102 if(userdef->tw_flag & V3D_USE_MANIPULATOR)
103 v3d->twflag |= V3D_USE_MANIPULATOR;
105 v3d->twflag &= ~V3D_USE_MANIPULATOR;
111 rna_userdef_update(bmain, scene, ptr);
115 static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
117 UserDef *userdef = (UserDef*)ptr->data;
118 if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
119 else G.f |= G_SCRIPT_AUTOEXEC;
122 static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
124 GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
125 rna_userdef_update(bmain, scene, ptr);
128 static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr)
130 GPU_set_anisotropic(U.anisotropic_filter);
131 rna_userdef_update(bmain, scene, ptr);
134 static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
137 rna_userdef_update(bmain, scene, ptr);
140 static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
142 UserDef *userdef = (UserDef*)ptr->data;
145 userdef->flag |= USER_LMOUSESELECT;
146 userdef->flag &= ~USER_TWOBUTTONMOUSE;
149 userdef->flag &= ~USER_LMOUSESELECT;
152 static int rna_userdef_autokeymode_get(PointerRNA *ptr)
154 UserDef *userdef = (UserDef*)ptr->data;
155 short retval = userdef->autokey_mode;
157 if(!(userdef->autokey_mode & AUTOKEY_ON))
158 retval |= AUTOKEY_ON;
163 static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
165 UserDef *userdef = (UserDef*)ptr->data;
167 if(value == AUTOKEY_MODE_NORMAL) {
168 userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
169 userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
171 else if(value == AUTOKEY_MODE_EDITKEYS) {
172 userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
173 userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
177 static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
179 UserDef *userdef = (UserDef*)ptr->data;
180 int required_size = userdef->v2d_min_gridsize;
182 /* set the timecode style */
183 userdef->timecode_style= value;
185 /* adjust the v2d gridsize if needed so that timecodes don't overlap
186 * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
187 * things from getting too blown out
190 case USER_TIMECODE_MINIMAL:
191 case USER_TIMECODE_SECONDS_ONLY:
192 /* 35 is great most of the time, but not that great for full-blown */
195 case USER_TIMECODE_SMPTE_MSF:
198 case USER_TIMECODE_SMPTE_FULL:
199 /* the granddaddy! */
202 case USER_TIMECODE_MILLISECONDS:
207 if (U.v2d_min_gridsize < required_size)
208 U.v2d_min_gridsize= required_size;
211 static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
213 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesView, ptr->data);
216 static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
218 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
221 static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
223 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data);
226 static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
228 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
231 static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
233 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
236 static void rna_UserDef_audio_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
241 static void rna_Userdef_memcache_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
243 MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
246 static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
250 vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
252 for(ob= bmain->object.first; ob; ob= ob->id.next) {
253 if(ob->mode & OB_MODE_WEIGHT_PAINT)
254 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
257 rna_userdef_update(bmain, scene, ptr);
260 static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
262 /* if all lights are off gpu_draw resets them all, [#27627]
263 * so disallow them all to be disabled */
264 if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
265 SolidLight *light= ptr->data;
269 WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
270 rna_userdef_update(bmain, scene, ptr);
273 static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
275 wmWindowManager *wm= bmain->wm.first;
278 WM_autosave_init(wm);
279 rna_userdef_update(bmain, scene, ptr);
282 static bAddon *rna_userdef_addon_new(void)
284 bAddon *bext= MEM_callocN(sizeof(bAddon), "bAddon");
285 BLI_addtail(&U.addons, bext);
289 static void rna_userdef_addon_remove(bAddon *bext)
291 BLI_freelinkN(&U.addons, bext);
294 static void rna_userdef_temp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
296 BLI_init_temporary_dir(U.tempdir);
299 static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
302 WM_main_add_notifier(NC_WINDOW, NULL);
307 static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
312 static EnumPropertyItem font_kerning_style[] = {
313 {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"},
314 {1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
315 {0, NULL, 0, NULL, NULL}};
317 srna= RNA_def_struct(brna, "ThemeFontStyle", NULL);
318 RNA_def_struct_sdna(srna, "uiFontStyle");
319 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
320 RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
322 prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE);
323 RNA_def_property_range(prop, 6, 48);
324 RNA_def_property_ui_text(prop, "Points", "");
325 RNA_def_property_update(prop, 0, "rna_userdef_update");
327 prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE);
328 RNA_def_property_enum_sdna(prop, NULL, "kerning");
329 RNA_def_property_enum_items(prop, font_kerning_style);
330 RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning");
331 RNA_def_property_update(prop, 0, "rna_userdef_update");
333 prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
334 RNA_def_property_range(prop, 0, 5);
335 RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)");
336 RNA_def_property_update(prop, 0, "rna_userdef_update");
338 prop= RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_NONE);
339 RNA_def_property_int_sdna(prop, NULL, "shadx");
340 RNA_def_property_range(prop, -10, 10);
341 RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
342 RNA_def_property_update(prop, 0, "rna_userdef_update");
344 prop= RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
345 RNA_def_property_int_sdna(prop, NULL, "shady");
346 RNA_def_property_range(prop, -10, 10);
347 RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
348 RNA_def_property_update(prop, 0, "rna_userdef_update");
350 prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
351 RNA_def_property_range(prop, 0.0f, 1.0f);
352 RNA_def_property_ui_text(prop, "Shadow Alpha", "");
353 RNA_def_property_update(prop, 0, "rna_userdef_update");
355 prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
356 RNA_def_property_range(prop, 0.0f, 1.0f);
357 RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
358 RNA_def_property_update(prop, 0, "rna_userdef_update");
361 static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
366 rna_def_userdef_theme_ui_font_style(brna);
368 srna= RNA_def_struct(brna, "ThemeStyle", NULL);
369 RNA_def_struct_sdna(srna, "uiStyle");
370 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
371 RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
374 prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
375 RNA_def_property_range(prop, 0.5, 2.0);
376 RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
378 prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
379 RNA_def_property_flag(prop, PROP_NEVER_NULL);
380 RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
381 RNA_def_property_struct_type(prop, "ThemeFontStyle");
382 RNA_def_property_ui_text(prop, "Panel Style", "");
383 RNA_def_property_update(prop, 0, "rna_userdef_update");
385 prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
386 RNA_def_property_flag(prop, PROP_NEVER_NULL);
387 RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
388 RNA_def_property_struct_type(prop, "ThemeFontStyle");
389 RNA_def_property_ui_text(prop, "Group Label Font", "");
390 RNA_def_property_update(prop, 0, "rna_userdef_update");
392 prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
393 RNA_def_property_flag(prop, PROP_NEVER_NULL);
394 RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
395 RNA_def_property_struct_type(prop, "ThemeFontStyle");
396 RNA_def_property_ui_text(prop, "Widget Label Style", "");
397 RNA_def_property_update(prop, 0, "rna_userdef_update");
399 prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
400 RNA_def_property_flag(prop, PROP_NEVER_NULL);
401 RNA_def_property_pointer_sdna(prop, NULL, "widget");
402 RNA_def_property_struct_type(prop, "ThemeFontStyle");
403 RNA_def_property_ui_text(prop, "Widget Style", "");
404 RNA_def_property_update(prop, 0, "rna_userdef_update");
408 static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
413 srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL);
414 RNA_def_struct_sdna(srna, "uiWidgetColors");
415 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
416 RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
418 prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
419 RNA_def_property_array(prop, 3);
420 RNA_def_property_ui_text(prop, "Outline", "");
421 RNA_def_property_update(prop, 0, "rna_userdef_update");
423 prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
424 RNA_def_property_array(prop, 4);
425 RNA_def_property_ui_text(prop, "Inner", "");
426 RNA_def_property_update(prop, 0, "rna_userdef_update");
428 prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
429 RNA_def_property_array(prop, 4);
430 RNA_def_property_ui_text(prop, "Inner Selected", "");
431 RNA_def_property_update(prop, 0, "rna_userdef_update");
433 prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
434 RNA_def_property_array(prop, 4);
435 RNA_def_property_ui_text(prop, "Item", "");
436 RNA_def_property_update(prop, 0, "rna_userdef_update");
438 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
439 RNA_def_property_array(prop, 3);
440 RNA_def_property_ui_text(prop, "Text", "");
441 RNA_def_property_update(prop, 0, "rna_userdef_update");
443 prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
444 RNA_def_property_array(prop, 3);
445 RNA_def_property_ui_text(prop, "Text Selected", "");
446 RNA_def_property_update(prop, 0, "rna_userdef_update");
448 prop= RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
449 RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
450 RNA_def_property_ui_text(prop, "Shaded", "");
451 RNA_def_property_update(prop, 0, "rna_userdef_update");
453 prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
454 RNA_def_property_range(prop, -100, 100);
455 RNA_def_property_ui_text(prop, "Shade Top", "");
456 RNA_def_property_update(prop, 0, "rna_userdef_update");
458 prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
459 RNA_def_property_range(prop, -100, 100);
460 RNA_def_property_ui_text(prop, "Shade Down", "");
461 RNA_def_property_update(prop, 0, "rna_userdef_update");
464 static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
469 srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
470 RNA_def_struct_sdna(srna, "uiWidgetStateColors");
471 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
472 RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors");
474 prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
475 RNA_def_property_array(prop, 3);
476 RNA_def_property_ui_text(prop, "Animated", "");
477 RNA_def_property_update(prop, 0, "rna_userdef_update");
479 prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
480 RNA_def_property_array(prop, 3);
481 RNA_def_property_ui_text(prop, "Animated Selected", "");
482 RNA_def_property_update(prop, 0, "rna_userdef_update");
484 prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
485 RNA_def_property_array(prop, 3);
486 RNA_def_property_ui_text(prop, "Keyframe", "");
487 RNA_def_property_update(prop, 0, "rna_userdef_update");
489 prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
490 RNA_def_property_array(prop, 3);
491 RNA_def_property_ui_text(prop, "Keyframe Selected", "");
492 RNA_def_property_update(prop, 0, "rna_userdef_update");
494 prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
495 RNA_def_property_array(prop, 3);
496 RNA_def_property_ui_text(prop, "Driven", "");
497 RNA_def_property_update(prop, 0, "rna_userdef_update");
499 prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
500 RNA_def_property_array(prop, 3);
501 RNA_def_property_ui_text(prop, "Driven Selected", "");
502 RNA_def_property_update(prop, 0, "rna_userdef_update");
504 prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
505 RNA_def_property_ui_text(prop, "Blend", "");
506 RNA_def_property_update(prop, 0, "rna_userdef_update");
509 static void rna_def_userdef_theme_ui(BlenderRNA *brna)
514 rna_def_userdef_theme_ui_wcol(brna);
515 rna_def_userdef_theme_ui_wcol_state(brna);
517 srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
518 RNA_def_struct_sdna(srna, "ThemeUI");
519 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
520 RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements");
522 prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
523 RNA_def_property_flag(prop, PROP_NEVER_NULL);
524 RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
525 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
526 RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
527 RNA_def_property_update(prop, 0, "rna_userdef_update");
529 prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
530 RNA_def_property_flag(prop, PROP_NEVER_NULL);
531 RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
532 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
533 RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
534 RNA_def_property_update(prop, 0, "rna_userdef_update");
536 prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
537 RNA_def_property_flag(prop, PROP_NEVER_NULL);
538 RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
539 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
540 RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
541 RNA_def_property_update(prop, 0, "rna_userdef_update");
543 prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
544 RNA_def_property_flag(prop, PROP_NEVER_NULL);
545 RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
546 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
547 RNA_def_property_ui_text(prop, "Text Widget Colors", "");
548 RNA_def_property_update(prop, 0, "rna_userdef_update");
550 prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
551 RNA_def_property_flag(prop, PROP_NEVER_NULL);
552 RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
553 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
554 RNA_def_property_ui_text(prop, "Option Widget Colors", "");
555 RNA_def_property_update(prop, 0, "rna_userdef_update");
557 prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
558 RNA_def_property_flag(prop, PROP_NEVER_NULL);
559 RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
560 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
561 RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
562 RNA_def_property_update(prop, 0, "rna_userdef_update");
564 prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
565 RNA_def_property_flag(prop, PROP_NEVER_NULL);
566 RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
567 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
568 RNA_def_property_ui_text(prop, "Number Widget Colors", "");
569 RNA_def_property_update(prop, 0, "rna_userdef_update");
571 prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
572 RNA_def_property_flag(prop, PROP_NEVER_NULL);
573 RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
574 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
575 RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
576 RNA_def_property_update(prop, 0, "rna_userdef_update");
578 prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
579 RNA_def_property_flag(prop, PROP_NEVER_NULL);
580 RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
581 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
582 RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
583 RNA_def_property_update(prop, 0, "rna_userdef_update");
585 prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
586 RNA_def_property_flag(prop, PROP_NEVER_NULL);
587 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
588 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
589 RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
590 RNA_def_property_update(prop, 0, "rna_userdef_update");
592 prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
593 RNA_def_property_flag(prop, PROP_NEVER_NULL);
594 RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
595 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
596 RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
597 RNA_def_property_update(prop, 0, "rna_userdef_update");
599 prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
600 RNA_def_property_flag(prop, PROP_NEVER_NULL);
601 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
602 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
603 RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
604 RNA_def_property_update(prop, 0, "rna_userdef_update");
606 prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
607 RNA_def_property_flag(prop, PROP_NEVER_NULL);
608 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
609 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
610 RNA_def_property_ui_text(prop, "Menu Item Colors", "");
611 RNA_def_property_update(prop, 0, "rna_userdef_update");
613 prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
614 RNA_def_property_flag(prop, PROP_NEVER_NULL);
615 RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
616 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
617 RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
618 RNA_def_property_update(prop, 0, "rna_userdef_update");
620 prop= RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
621 RNA_def_property_flag(prop, PROP_NEVER_NULL);
622 RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress");
623 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
624 RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
625 RNA_def_property_update(prop, 0, "rna_userdef_update");
627 prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
628 RNA_def_property_flag(prop, PROP_NEVER_NULL);
629 RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
630 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
631 RNA_def_property_ui_text(prop, "List Item Colors", "");
632 RNA_def_property_update(prop, 0, "rna_userdef_update");
634 prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
635 RNA_def_property_flag(prop, PROP_NEVER_NULL);
636 RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
637 RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
638 RNA_def_property_ui_text(prop, "State Colors", "");
639 RNA_def_property_update(prop, 0, "rna_userdef_update");
641 prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
642 RNA_def_property_string_sdna(prop, NULL, "iconfile");
643 RNA_def_property_ui_text(prop, "Icon File", "");
644 RNA_def_property_update(prop, 0, "rna_userdef_update");
647 static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype)
652 prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
653 RNA_def_property_array(prop, 3);
654 RNA_def_property_ui_text(prop, "Window Background", "");
655 RNA_def_property_update(prop, 0, "rna_userdef_update");
657 prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
658 RNA_def_property_array(prop, 3);
659 RNA_def_property_ui_text(prop, "Title", "");
660 RNA_def_property_update(prop, 0, "rna_userdef_update");
662 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
663 RNA_def_property_array(prop, 3);
664 RNA_def_property_ui_text(prop, "Text", "");
665 RNA_def_property_update(prop, 0, "rna_userdef_update");
667 prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
668 RNA_def_property_array(prop, 3);
669 RNA_def_property_ui_text(prop, "Text Highlight", "");
670 RNA_def_property_update(prop, 0, "rna_userdef_update");
673 prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
674 RNA_def_property_array(prop, 3);
675 RNA_def_property_ui_text(prop, "Header", "");
676 RNA_def_property_update(prop, 0, "rna_userdef_update");
678 prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
679 RNA_def_property_array(prop, 3);
680 RNA_def_property_ui_text(prop, "Header Text", "");
681 RNA_def_property_update(prop, 0, "rna_userdef_update");
683 prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
684 RNA_def_property_array(prop, 3);
685 RNA_def_property_ui_text(prop, "Header Text Highlight", "");
686 RNA_def_property_update(prop, 0, "rna_userdef_update");
689 // if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) {
690 prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
691 RNA_def_property_array(prop, 3);
692 RNA_def_property_ui_text(prop, "Region Background", "");
693 RNA_def_property_update(prop, 0, "rna_userdef_update");
695 prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA);
696 RNA_def_property_array(prop, 3);
697 RNA_def_property_ui_text(prop, "Region Text Titles", "");
698 RNA_def_property_update(prop, 0, "rna_userdef_update");
700 prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA);
701 RNA_def_property_array(prop, 3);
702 RNA_def_property_ui_text(prop, "Region Text", "");
703 RNA_def_property_update(prop, 0, "rna_userdef_update");
705 prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
706 RNA_def_property_array(prop, 3);
707 RNA_def_property_ui_text(prop, "Region Text Highlight", "");
708 RNA_def_property_update(prop, 0, "rna_userdef_update");
712 if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) {
713 prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA);
714 RNA_def_property_array(prop, 3);
715 RNA_def_property_ui_text(prop, "Source List", "");
716 RNA_def_property_update(prop, 0, "rna_userdef_update");
718 prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA);
719 RNA_def_property_array(prop, 3);
720 RNA_def_property_ui_text(prop, "Source List Title", "");
721 RNA_def_property_update(prop, 0, "rna_userdef_update");
723 prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA);
724 RNA_def_property_array(prop, 3);
725 RNA_def_property_ui_text(prop, "Source List Text", "");
726 RNA_def_property_update(prop, 0, "rna_userdef_update");
728 prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
729 RNA_def_property_array(prop, 3);
730 RNA_def_property_ui_text(prop, "Source List Text Highlight", "");
731 RNA_def_property_update(prop, 0, "rna_userdef_update");
735 static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna)
739 prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
740 RNA_def_property_array(prop, 3);
741 RNA_def_property_ui_text(prop, "Vertex", "");
742 RNA_def_property_update(prop, 0, "rna_userdef_update");
744 prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
745 RNA_def_property_array(prop, 3);
746 RNA_def_property_ui_text(prop, "Vertex Select", "");
747 RNA_def_property_update(prop, 0, "rna_userdef_update");
749 prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
750 RNA_def_property_range(prop, 1, 10);
751 RNA_def_property_ui_text(prop, "Vertex Size", "");
752 RNA_def_property_update(prop, 0, "rna_userdef_update");
755 static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
759 prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
760 RNA_def_property_array(prop, 3);
761 RNA_def_property_ui_text(prop, "Edge Select", "");
762 RNA_def_property_update(prop, 0, "rna_userdef_update");
764 prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR_GAMMA);
765 RNA_def_property_array(prop, 3);
766 RNA_def_property_ui_text(prop, "Edge Seam", "");
767 RNA_def_property_update(prop, 0, "rna_userdef_update");
769 prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
770 RNA_def_property_array(prop, 3);
771 RNA_def_property_ui_text(prop, "Edge Sharp", "");
772 RNA_def_property_update(prop, 0, "rna_userdef_update");
774 prop= RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR_GAMMA);
775 RNA_def_property_array(prop, 3);
776 RNA_def_property_ui_text(prop, "Edge Crease", "");
777 RNA_def_property_update(prop, 0, "rna_userdef_update");
779 prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR_GAMMA);
780 RNA_def_property_array(prop, 3);
781 RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
782 RNA_def_property_update(prop, 0, "rna_userdef_update");
784 prop= RNA_def_property(srna, "freestyle_edge_mark", PROP_FLOAT, PROP_COLOR_GAMMA);
785 RNA_def_property_array(prop, 3);
786 RNA_def_property_ui_text(prop, "Freestyle Edge Mark", "");
787 RNA_def_property_update(prop, 0, "rna_userdef_update");
790 static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
794 prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
795 RNA_def_property_array(prop, 4);
796 RNA_def_property_ui_text(prop, "Face", "");
797 RNA_def_property_update(prop, 0, "rna_userdef_update");
799 prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
800 RNA_def_property_array(prop, 4);
801 RNA_def_property_ui_text(prop, "Face Selected", "");
802 RNA_def_property_update(prop, 0, "rna_userdef_update");
804 prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR_GAMMA);
805 RNA_def_property_array(prop, 3);
806 RNA_def_property_ui_text(prop, "Face Dot Selected", "");
807 RNA_def_property_update(prop, 0, "rna_userdef_update");
809 prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
810 RNA_def_property_range(prop, 1, 10);
811 RNA_def_property_ui_text(prop, "Face Dot Size", "");
812 RNA_def_property_update(prop, 0, "rna_userdef_update");
814 prop= RNA_def_property(srna, "freestyle_face_mark", PROP_FLOAT, PROP_COLOR_GAMMA);
815 RNA_def_property_array(prop, 4);
816 RNA_def_property_ui_text(prop, "Freestyle Face Mark", "");
817 RNA_def_property_update(prop, 0, "rna_userdef_update");
820 static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurbs)
825 prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
826 RNA_def_property_float_sdna(prop, NULL, "nurb_uline");
827 RNA_def_property_array(prop, 3);
828 RNA_def_property_ui_text(prop, "NURBS U-lines", "");
829 RNA_def_property_update(prop, 0, "rna_userdef_update");
831 prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
832 RNA_def_property_float_sdna(prop, NULL, "nurb_vline");
833 RNA_def_property_array(prop, 3);
834 RNA_def_property_ui_text(prop, "NURBS V-lines", "");
835 RNA_def_property_update(prop, 0, "rna_userdef_update");
837 prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
838 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline");
839 RNA_def_property_array(prop, 3);
840 RNA_def_property_ui_text(prop, "NURBS active U-lines", "");
841 RNA_def_property_update(prop, 0, "rna_userdef_update");
843 prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
844 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline");
845 RNA_def_property_array(prop, 3);
846 RNA_def_property_ui_text(prop, "NURBS active V-lines", "");
847 RNA_def_property_update(prop, 0, "rna_userdef_update");
849 prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR_GAMMA);
850 RNA_def_property_float_sdna(prop, NULL, "act_spline");
851 RNA_def_property_array(prop, 3);
852 RNA_def_property_ui_text(prop, "Active spline", "");
853 RNA_def_property_update(prop, 0, "rna_userdef_update");
856 prop= RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
857 RNA_def_property_float_sdna(prop, NULL, "handle_free");
858 RNA_def_property_array(prop, 3);
859 RNA_def_property_ui_text(prop, "Free handle color", "");
860 RNA_def_property_update(prop, 0, "rna_userdef_update");
862 prop= RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
863 RNA_def_property_float_sdna(prop, NULL, "handle_auto");
864 RNA_def_property_array(prop, 3);
865 RNA_def_property_ui_text(prop, "Auto handle color", "");
866 RNA_def_property_update(prop, 0, "rna_userdef_update");
868 prop= RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
869 RNA_def_property_float_sdna(prop, NULL, "handle_vect");
870 RNA_def_property_array(prop, 3);
871 RNA_def_property_ui_text(prop, "Vector handle color", "");
872 RNA_def_property_update(prop, 0, "rna_userdef_update");
874 prop= RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
875 RNA_def_property_float_sdna(prop, NULL, "handle_align");
876 RNA_def_property_array(prop, 3);
877 RNA_def_property_ui_text(prop, "Align handle color", "");
878 RNA_def_property_update(prop, 0, "rna_userdef_update");
880 prop= RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
881 RNA_def_property_float_sdna(prop, NULL, "handle_sel_free");
882 RNA_def_property_array(prop, 3);
883 RNA_def_property_ui_text(prop, "Free handle selected color", "");
884 RNA_def_property_update(prop, 0, "rna_userdef_update");
886 prop= RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
887 RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto");
888 RNA_def_property_array(prop, 3);
889 RNA_def_property_ui_text(prop, "Auto handle selected color", "");
890 RNA_def_property_update(prop, 0, "rna_userdef_update");
892 prop= RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
893 RNA_def_property_float_sdna(prop, NULL, "handle_sel_vect");
894 RNA_def_property_array(prop, 3);
895 RNA_def_property_ui_text(prop, "Vector handle selected color", "");
896 RNA_def_property_update(prop, 0, "rna_userdef_update");
898 prop= RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
899 RNA_def_property_float_sdna(prop, NULL, "handle_sel_align");
900 RNA_def_property_array(prop, 3);
901 RNA_def_property_ui_text(prop, "Align handle selected color", "");
902 RNA_def_property_update(prop, 0, "rna_userdef_update");
904 if (incl_nurbs == 0) {
905 /* assume that when nurbs are off, this is for 2D (i.e. anim) editors */
906 prop= RNA_def_property(srna, "handle_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
907 RNA_def_property_float_sdna(prop, NULL, "handle_auto_clamped");
908 RNA_def_property_array(prop, 3);
909 RNA_def_property_ui_text(prop, "Auto-Clamped handle color", "");
910 RNA_def_property_update(prop, 0, "rna_userdef_update");
912 prop= RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
913 RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto_clamped");
914 RNA_def_property_array(prop, 3);
915 RNA_def_property_ui_text(prop, "Auto-Clamped handle selected color", "");
916 RNA_def_property_update(prop, 0, "rna_userdef_update");
919 prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR_GAMMA);
920 RNA_def_property_float_sdna(prop, NULL, "lastsel_point");
921 RNA_def_property_array(prop, 3);
922 RNA_def_property_ui_text(prop, "Last selected point", "");
923 RNA_def_property_update(prop, 0, "rna_userdef_update");
926 static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
933 srna= RNA_def_struct(brna, "ThemeView3D", NULL);
934 RNA_def_struct_sdna(srna, "ThemeSpace");
935 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
936 RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
938 rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D);
940 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
941 RNA_def_property_array(prop, 3);
942 RNA_def_property_ui_text(prop, "Grid", "");
943 RNA_def_property_update(prop, 0, "rna_userdef_update");
945 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
946 RNA_def_property_array(prop, 4);
947 RNA_def_property_ui_text(prop, "Panel", "");
948 RNA_def_property_update(prop, 0, "rna_userdef_update");
950 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
951 RNA_def_property_array(prop, 3);
952 RNA_def_property_ui_text(prop, "Wire", "");
953 RNA_def_property_update(prop, 0, "rna_userdef_update");
955 prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA);
956 RNA_def_property_array(prop, 4);
957 RNA_def_property_ui_text(prop, "Lamp", "");
958 RNA_def_property_update(prop, 0, "rna_userdef_update");
960 prop= RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
961 RNA_def_property_array(prop, 3);
962 RNA_def_property_ui_text(prop, "Speaker", "");
963 RNA_def_property_update(prop, 0, "rna_userdef_update");
965 prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
966 RNA_def_property_float_sdna(prop, NULL, "select");
967 RNA_def_property_array(prop, 3);
968 RNA_def_property_ui_text(prop, "Object Selected", "");
969 RNA_def_property_update(prop, 0, "rna_userdef_update");
971 prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
972 RNA_def_property_float_sdna(prop, NULL, "active");
973 RNA_def_property_array(prop, 3);
974 RNA_def_property_ui_text(prop, "Active Object", "");
975 RNA_def_property_update(prop, 0, "rna_userdef_update");
977 prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR_GAMMA);
978 RNA_def_property_float_sdna(prop, NULL, "group");
979 RNA_def_property_array(prop, 3);
980 RNA_def_property_ui_text(prop, "Object Grouped", "");
981 RNA_def_property_update(prop, 0, "rna_userdef_update");
983 prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR_GAMMA);
984 RNA_def_property_float_sdna(prop, NULL, "group_active");
985 RNA_def_property_array(prop, 3);
986 RNA_def_property_ui_text(prop, "Object Grouped Active", "");
987 RNA_def_property_update(prop, 0, "rna_userdef_update");
989 prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
990 RNA_def_property_array(prop, 3);
991 RNA_def_property_ui_text(prop, "Transform", "");
992 RNA_def_property_update(prop, 0, "rna_userdef_update");
994 rna_def_userdef_theme_spaces_vertex(srna);
995 rna_def_userdef_theme_spaces_edge(srna);
996 rna_def_userdef_theme_spaces_face(srna);
997 rna_def_userdef_theme_spaces_curves(srna, 1);
999 prop= RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
1000 RNA_def_property_array(prop, 3);
1001 RNA_def_property_ui_text(prop, "Edge Length Text", "");
1002 RNA_def_property_update(prop, 0, "rna_userdef_update");
1004 prop= RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
1005 RNA_def_property_array(prop, 3);
1006 RNA_def_property_ui_text(prop, "Face Angle Text", "");
1007 RNA_def_property_update(prop, 0, "rna_userdef_update");
1009 prop= RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
1010 RNA_def_property_array(prop, 3);
1011 RNA_def_property_ui_text(prop, "Face Area Text", "");
1012 RNA_def_property_update(prop, 0, "rna_userdef_update");
1014 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
1015 RNA_def_property_array(prop, 4);
1016 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
1017 RNA_def_property_update(prop, 0, "rna_userdef_update");
1019 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
1020 RNA_def_property_array(prop, 3);
1021 RNA_def_property_ui_text(prop, "Face Normal", "");
1022 RNA_def_property_update(prop, 0, "rna_userdef_update");
1024 prop= RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
1025 RNA_def_property_array(prop, 3);
1026 RNA_def_property_ui_text(prop, "Vertex Normal", "");
1027 RNA_def_property_update(prop, 0, "rna_userdef_update");
1029 prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
1030 RNA_def_property_array(prop, 3);
1031 RNA_def_property_ui_text(prop, "Bone Solid", "");
1032 RNA_def_property_update(prop, 0, "rna_userdef_update");
1034 prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
1035 RNA_def_property_array(prop, 3);
1036 RNA_def_property_ui_text(prop, "Bone Pose", "");
1037 RNA_def_property_update(prop, 0, "rna_userdef_update");
1039 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1040 RNA_def_property_float_sdna(prop, NULL, "cframe");
1041 RNA_def_property_array(prop, 3);
1042 RNA_def_property_ui_text(prop, "Current Frame", "");
1043 RNA_def_property_update(prop, 0, "rna_userdef_update");
1045 prop= RNA_def_property(srna, "outline_width", PROP_INT, PROP_NONE);
1046 RNA_def_property_range(prop, 1, 5);
1047 RNA_def_property_ui_text(prop, "Outline Width", "");
1048 RNA_def_property_update(prop, 0, "rna_userdef_update");
1050 prop= RNA_def_property(srna, "bundle_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
1051 RNA_def_property_float_sdna(prop, NULL, "bundle_solid");
1052 RNA_def_property_array(prop, 3);
1053 RNA_def_property_ui_text(prop, "Bundle Solid", "");
1054 RNA_def_property_update(prop, 0, "rna_userdef_update");
1056 prop= RNA_def_property(srna, "camera_path", PROP_FLOAT, PROP_COLOR_GAMMA);
1057 RNA_def_property_float_sdna(prop, NULL, "camera_path");
1058 RNA_def_property_array(prop, 3);
1059 RNA_def_property_ui_text(prop, "Camera Path", "");
1060 RNA_def_property_update(prop, 0, "rna_userdef_update");
1064 static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
1071 srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
1072 RNA_def_struct_sdna(srna, "ThemeSpace");
1073 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1074 RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
1076 rna_def_userdef_theme_spaces_main(srna, SPACE_IPO);
1078 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1079 RNA_def_property_array(prop, 3);
1080 RNA_def_property_ui_text(prop, "Grid", "");
1081 RNA_def_property_update(prop, 0, "rna_userdef_update");
1083 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1084 RNA_def_property_array(prop, 3);
1085 RNA_def_property_ui_text(prop, "Panel", "");
1086 RNA_def_property_update(prop, 0, "rna_userdef_update");
1088 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1089 RNA_def_property_float_sdna(prop, NULL, "shade1");
1090 RNA_def_property_array(prop, 3);
1091 RNA_def_property_ui_text(prop, "Window Sliders", "");
1092 RNA_def_property_update(prop, 0, "rna_userdef_update");
1094 prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR_GAMMA);
1095 RNA_def_property_float_sdna(prop, NULL, "shade2");
1096 RNA_def_property_array(prop, 3);
1097 RNA_def_property_ui_text(prop, "Channels Region", "");
1098 RNA_def_property_update(prop, 0, "rna_userdef_update");
1100 rna_def_userdef_theme_spaces_vertex(srna);
1101 rna_def_userdef_theme_spaces_curves(srna, 0);
1103 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1104 RNA_def_property_float_sdna(prop, NULL, "cframe");
1105 RNA_def_property_array(prop, 3);
1106 RNA_def_property_ui_text(prop, "Current Frame", "");
1107 RNA_def_property_update(prop, 0, "rna_userdef_update");
1109 prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
1110 RNA_def_property_array(prop, 3);
1111 RNA_def_property_ui_text(prop, "Handle Vertex", "");
1112 RNA_def_property_update(prop, 0, "rna_userdef_update");
1114 prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
1115 RNA_def_property_array(prop, 3);
1116 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
1117 RNA_def_property_update(prop, 0, "rna_userdef_update");
1119 prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
1120 RNA_def_property_range(prop, 0, 255);
1121 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
1122 RNA_def_property_update(prop, 0, "rna_userdef_update");
1124 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1125 RNA_def_property_float_sdna(prop, NULL, "group");
1126 RNA_def_property_array(prop, 3);
1127 RNA_def_property_ui_text(prop, "Channel Group", "");
1128 RNA_def_property_update(prop, 0, "rna_userdef_update");
1130 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1131 RNA_def_property_float_sdna(prop, NULL, "group_active");
1132 RNA_def_property_array(prop, 3);
1133 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1134 RNA_def_property_update(prop, 0, "rna_userdef_update");
1136 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
1137 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1138 RNA_def_property_array(prop, 3);
1139 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1140 RNA_def_property_update(prop, 0, "rna_userdef_update");
1142 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
1143 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1144 RNA_def_property_array(prop, 3);
1145 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1146 RNA_def_property_update(prop, 0, "rna_userdef_update");
1149 static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
1156 srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL);
1157 RNA_def_struct_sdna(srna, "ThemeSpace");
1158 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1159 RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
1161 rna_def_userdef_theme_spaces_main(srna, SPACE_FILE);
1163 prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA);
1164 RNA_def_property_float_sdna(prop, NULL, "hilite");
1165 RNA_def_property_array(prop, 3);
1166 RNA_def_property_ui_text(prop, "Selected File", "");
1167 RNA_def_property_update(prop, 0, "rna_userdef_update");
1169 prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR_GAMMA);
1170 RNA_def_property_float_sdna(prop, NULL, "panel");
1171 RNA_def_property_array(prop, 3);
1172 RNA_def_property_ui_text(prop, "Tiles", "");
1173 RNA_def_property_update(prop, 0, "rna_userdef_update");
1175 prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR_GAMMA);
1176 RNA_def_property_float_sdna(prop, NULL, "shade1");
1177 RNA_def_property_array(prop, 3);
1178 RNA_def_property_ui_text(prop, "Scrollbar", "");
1179 RNA_def_property_update(prop, 0, "rna_userdef_update");
1181 prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR_GAMMA);
1182 RNA_def_property_float_sdna(prop, NULL, "shade2");
1183 RNA_def_property_array(prop, 3);
1184 RNA_def_property_ui_text(prop, "Scroll Handle", "");
1185 RNA_def_property_update(prop, 0, "rna_userdef_update");
1187 prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR_GAMMA);
1188 RNA_def_property_float_sdna(prop, NULL, "active");
1189 RNA_def_property_array(prop, 3);
1190 RNA_def_property_ui_text(prop, "Active File", "");
1191 RNA_def_property_update(prop, 0, "rna_userdef_update");
1193 prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1194 RNA_def_property_float_sdna(prop, NULL, "grid");
1195 RNA_def_property_array(prop, 3);
1196 RNA_def_property_ui_text(prop, "Active File Text", "");
1197 RNA_def_property_update(prop, 0, "rna_userdef_update");
1200 static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
1204 /* space_outliner */
1206 srna= RNA_def_struct(brna, "ThemeOutliner", NULL);
1207 RNA_def_struct_sdna(srna, "ThemeSpace");
1208 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1209 RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
1211 rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER);
1214 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
1218 /* space_userpref */
1220 srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
1221 RNA_def_struct_sdna(srna, "ThemeSpace");
1222 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1223 RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
1225 rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
1228 static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
1235 srna= RNA_def_struct(brna, "ThemeConsole", NULL);
1236 RNA_def_struct_sdna(srna, "ThemeSpace");
1237 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1238 RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
1240 rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE);
1242 prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
1243 RNA_def_property_float_sdna(prop, NULL, "console_output");
1244 RNA_def_property_array(prop, 3);
1245 RNA_def_property_ui_text(prop, "Line Output", "");
1246 RNA_def_property_update(prop, 0, "rna_userdef_update");
1248 prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
1249 RNA_def_property_float_sdna(prop, NULL, "console_input");
1250 RNA_def_property_array(prop, 3);
1251 RNA_def_property_ui_text(prop, "Line Input", "");
1252 RNA_def_property_update(prop, 0, "rna_userdef_update");
1254 prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
1255 RNA_def_property_float_sdna(prop, NULL, "console_info");
1256 RNA_def_property_array(prop, 3);
1257 RNA_def_property_ui_text(prop, "Line Info", "");
1258 RNA_def_property_update(prop, 0, "rna_userdef_update");
1260 prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
1261 RNA_def_property_float_sdna(prop, NULL, "console_error");
1262 RNA_def_property_array(prop, 3);
1263 RNA_def_property_ui_text(prop, "Line Error", "");
1264 RNA_def_property_update(prop, 0, "rna_userdef_update");
1266 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
1267 RNA_def_property_float_sdna(prop, NULL, "console_cursor");
1268 RNA_def_property_array(prop, 3);
1269 RNA_def_property_ui_text(prop, "Cursor", "");
1270 RNA_def_property_update(prop, 0, "rna_userdef_update");
1273 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
1279 srna= RNA_def_struct(brna, "ThemeInfo", NULL);
1280 RNA_def_struct_sdna(srna, "ThemeSpace");
1281 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1282 RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
1284 rna_def_userdef_theme_spaces_main(srna, SPACE_INFO);
1288 static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
1295 srna= RNA_def_struct(brna, "ThemeTextEditor", NULL);
1296 RNA_def_struct_sdna(srna, "ThemeSpace");
1297 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1298 RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
1300 rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT);
1302 prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
1303 RNA_def_property_float_sdna(prop, NULL, "grid");
1304 RNA_def_property_array(prop, 3);
1305 RNA_def_property_ui_text(prop, "Line Numbers Background", "");
1306 RNA_def_property_update(prop, 0, "rna_userdef_update");
1308 prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
1309 RNA_def_property_float_sdna(prop, NULL, "shade1");
1310 RNA_def_property_array(prop, 3);
1311 RNA_def_property_ui_text(prop, "Scroll Bar", "");
1312 RNA_def_property_update(prop, 0, "rna_userdef_update");
1314 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1315 RNA_def_property_float_sdna(prop, NULL, "shade2");
1316 RNA_def_property_array(prop, 3);
1317 RNA_def_property_ui_text(prop, "Selected Text", "");
1318 RNA_def_property_update(prop, 0, "rna_userdef_update");
1320 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
1321 RNA_def_property_float_sdna(prop, NULL, "hilite");
1322 RNA_def_property_array(prop, 3);
1323 RNA_def_property_ui_text(prop, "Cursor", "");
1324 RNA_def_property_update(prop, 0, "rna_userdef_update");
1326 prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
1327 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1328 RNA_def_property_array(prop, 3);
1329 RNA_def_property_ui_text(prop, "Syntax Built-in", "");
1330 RNA_def_property_update(prop, 0, "rna_userdef_update");
1332 prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
1333 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1334 RNA_def_property_array(prop, 3);
1335 RNA_def_property_ui_text(prop, "Syntax Special", "");
1336 RNA_def_property_update(prop, 0, "rna_userdef_update");
1338 prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
1339 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1340 RNA_def_property_array(prop, 3);
1341 RNA_def_property_ui_text(prop, "Syntax Comment", "");
1342 RNA_def_property_update(prop, 0, "rna_userdef_update");
1344 prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
1345 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1346 RNA_def_property_array(prop, 3);
1347 RNA_def_property_ui_text(prop, "Syntax String", "");
1348 RNA_def_property_update(prop, 0, "rna_userdef_update");
1350 prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
1351 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1352 RNA_def_property_array(prop, 3);
1353 RNA_def_property_ui_text(prop, "Syntax Numbers", "");
1354 RNA_def_property_update(prop, 0, "rna_userdef_update");
1357 static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
1364 srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL);
1365 RNA_def_struct_sdna(srna, "ThemeSpace");
1366 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1367 RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
1369 rna_def_userdef_theme_spaces_main(srna, SPACE_NODE);
1371 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
1372 RNA_def_property_float_sdna(prop, NULL, "wire");
1373 RNA_def_property_array(prop, 3);
1374 RNA_def_property_ui_text(prop, "Wires", "");
1375 RNA_def_property_update(prop, 0, "rna_userdef_update");
1377 prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
1378 RNA_def_property_float_sdna(prop, NULL, "edge_select");
1379 RNA_def_property_array(prop, 3);
1380 RNA_def_property_ui_text(prop, "Wire Select", "");
1381 RNA_def_property_update(prop, 0, "rna_userdef_update");
1383 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1384 RNA_def_property_float_sdna(prop, NULL, "shade2");
1385 RNA_def_property_array(prop, 3);
1386 RNA_def_property_ui_text(prop, "Selected Text", "");
1387 RNA_def_property_update(prop, 0, "rna_userdef_update");
1389 prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
1390 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1391 RNA_def_property_array(prop, 4);
1392 RNA_def_property_ui_text(prop, "Node Backdrop", "");
1393 RNA_def_property_update(prop, 0, "rna_userdef_update");
1395 prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1396 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1397 RNA_def_property_array(prop, 3);
1398 RNA_def_property_ui_text(prop, "In/Out Node", "");
1399 RNA_def_property_update(prop, 0, "rna_userdef_update");
1401 prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1402 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1403 RNA_def_property_array(prop, 3);
1404 RNA_def_property_ui_text(prop, "Converter Node", "");
1405 RNA_def_property_update(prop, 0, "rna_userdef_update");
1407 prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1408 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1409 RNA_def_property_array(prop, 3);
1410 RNA_def_property_ui_text(prop, "Operator Node", "");
1411 RNA_def_property_update(prop, 0, "rna_userdef_update");
1413 prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1414 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1415 RNA_def_property_array(prop, 3);
1416 RNA_def_property_ui_text(prop, "Group Node", "");
1417 RNA_def_property_update(prop, 0, "rna_userdef_update");
1419 prop= RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
1420 RNA_def_property_int_sdna(prop, NULL, "noodle_curving");
1421 RNA_def_property_int_default(prop, 5);
1422 RNA_def_property_range(prop, 0, 10);
1423 RNA_def_property_ui_text(prop, "Noodle curving", "Curving of the noodle");
1424 RNA_def_property_update(prop, 0, "rna_userdef_update");
1427 static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
1434 srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL);
1435 RNA_def_struct_sdna(srna, "ThemeSpace");
1436 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1437 RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor");
1439 rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC);
1441 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1442 RNA_def_property_array(prop, 3);
1443 RNA_def_property_ui_text(prop, "Panel", "");
1444 RNA_def_property_update(prop, 0, "rna_userdef_update");
1448 static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
1455 srna= RNA_def_struct(brna, "ThemeProperties", NULL);
1456 RNA_def_struct_sdna(srna, "ThemeSpace");
1457 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1458 RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
1460 rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS);
1462 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1463 RNA_def_property_array(prop, 3);
1464 RNA_def_property_ui_text(prop, "Panel", "");
1465 RNA_def_property_update(prop, 0, "rna_userdef_update");
1468 static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
1475 srna= RNA_def_struct(brna, "ThemeTimeline", NULL);
1476 RNA_def_struct_sdna(srna, "ThemeSpace");
1477 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1478 RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline");
1480 rna_def_userdef_theme_spaces_main(srna, SPACE_TIME);
1482 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1483 RNA_def_property_array(prop, 3);
1484 RNA_def_property_ui_text(prop, "Grid", "");
1485 RNA_def_property_update(prop, 0, "rna_userdef_update");
1487 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1488 RNA_def_property_float_sdna(prop, NULL, "cframe");
1489 RNA_def_property_array(prop, 3);
1490 RNA_def_property_ui_text(prop, "Current Frame", "");
1491 RNA_def_property_update(prop, 0, "rna_userdef_update");
1494 static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
1501 srna= RNA_def_struct(brna, "ThemeImageEditor", NULL);
1502 RNA_def_struct_sdna(srna, "ThemeSpace");
1503 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1504 RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
1506 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1507 rna_def_userdef_theme_spaces_vertex(srna);
1508 rna_def_userdef_theme_spaces_face(srna);
1510 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
1511 RNA_def_property_array(prop, 4);
1512 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
1513 RNA_def_property_update(prop, 0, "rna_userdef_update");
1515 prop= RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
1516 RNA_def_property_float_sdna(prop, NULL, "preview_back");
1517 RNA_def_property_array(prop, 4);
1518 RNA_def_property_ui_text(prop, "Scope region background color", "");
1519 RNA_def_property_update(prop, 0, "rna_userdef_update");
1522 static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
1529 srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
1530 RNA_def_struct_sdna(srna, "ThemeSpace");
1531 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1532 RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
1534 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1536 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1537 RNA_def_property_array(prop, 3);
1538 RNA_def_property_ui_text(prop, "Grid", "");
1539 RNA_def_property_update(prop, 0, "rna_userdef_update");
1541 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1542 RNA_def_property_float_sdna(prop, NULL, "shade1");
1543 RNA_def_property_array(prop, 3);
1544 RNA_def_property_ui_text(prop, "Window Sliders", "");
1545 RNA_def_property_update(prop, 0, "rna_userdef_update");
1547 prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1548 RNA_def_property_float_sdna(prop, NULL, "movie");
1549 RNA_def_property_array(prop, 3);
1550 RNA_def_property_ui_text(prop, "Movie Strip", "");
1551 RNA_def_property_update(prop, 0, "rna_userdef_update");
1553 prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1554 RNA_def_property_float_sdna(prop, NULL, "image");
1555 RNA_def_property_array(prop, 3);
1556 RNA_def_property_ui_text(prop, "Image Strip", "");
1557 RNA_def_property_update(prop, 0, "rna_userdef_update");
1559 prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1560 RNA_def_property_float_sdna(prop, NULL, "scene");
1561 RNA_def_property_array(prop, 3);
1562 RNA_def_property_ui_text(prop, "Scene Strip", "");
1563 RNA_def_property_update(prop, 0, "rna_userdef_update");
1565 prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1566 RNA_def_property_float_sdna(prop, NULL, "audio");
1567 RNA_def_property_array(prop, 3);
1568 RNA_def_property_ui_text(prop, "Audio Strip", "");
1569 RNA_def_property_update(prop, 0, "rna_userdef_update");
1571 prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1572 RNA_def_property_float_sdna(prop, NULL, "effect");
1573 RNA_def_property_array(prop, 3);
1574 RNA_def_property_ui_text(prop, "Effect Strip", "");
1575 RNA_def_property_update(prop, 0, "rna_userdef_update");
1577 prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1578 RNA_def_property_float_sdna(prop, NULL, "plugin");
1579 RNA_def_property_array(prop, 3);
1580 RNA_def_property_ui_text(prop, "Plugin Strip", "");
1581 RNA_def_property_update(prop, 0, "rna_userdef_update");
1583 prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1584 RNA_def_property_float_sdna(prop, NULL, "transition");
1585 RNA_def_property_array(prop, 3);
1586 RNA_def_property_ui_text(prop, "Transition Strip", "");
1587 RNA_def_property_update(prop, 0, "rna_userdef_update");
1589 prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1590 RNA_def_property_float_sdna(prop, NULL, "meta");
1591 RNA_def_property_array(prop, 3);
1592 RNA_def_property_ui_text(prop, "Meta Strip", "");
1593 RNA_def_property_update(prop, 0, "rna_userdef_update");
1595 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1596 RNA_def_property_float_sdna(prop, NULL, "cframe");
1597 RNA_def_property_array(prop, 3);
1598 RNA_def_property_ui_text(prop, "Current Frame", "");
1599 RNA_def_property_update(prop, 0, "rna_userdef_update");
1601 prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
1602 RNA_def_property_float_sdna(prop, NULL, "vertex_select");
1603 RNA_def_property_array(prop, 3);
1604 RNA_def_property_ui_text(prop, "Keyframe", "");
1605 RNA_def_property_update(prop, 0, "rna_userdef_update");
1607 prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR_GAMMA);
1608 RNA_def_property_float_sdna(prop, NULL, "bone_pose");
1609 RNA_def_property_array(prop, 3);
1610 RNA_def_property_ui_text(prop, "Draw Action", "");
1611 RNA_def_property_update(prop, 0, "rna_userdef_update");
1614 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
1621 srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL);
1622 RNA_def_struct_sdna(srna, "ThemeSpace");
1623 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1624 RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet");
1626 rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION);
1628 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1629 RNA_def_property_array(prop, 3);
1630 RNA_def_property_ui_text(prop, "Grid", "");
1631 RNA_def_property_update(prop, 0, "rna_userdef_update");
1633 prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1634 RNA_def_property_float_sdna(prop, NULL, "face");
1635 RNA_def_property_array(prop, 3);
1636 RNA_def_property_ui_text(prop, "Value Sliders", "");
1637 RNA_def_property_update(prop, 0, "rna_userdef_update");
1639 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1640 RNA_def_property_float_sdna(prop, NULL, "shade1");
1641 RNA_def_property_array(prop, 3);
1642 RNA_def_property_ui_text(prop, "View Sliders", "");
1643 RNA_def_property_update(prop, 0, "rna_userdef_update");
1645 prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
1646 RNA_def_property_float_sdna(prop, NULL, "shade2");
1647 RNA_def_property_array(prop, 3);
1648 RNA_def_property_ui_text(prop, "Channels", "");
1649 RNA_def_property_update(prop, 0, "rna_userdef_update");
1651 prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1652 RNA_def_property_float_sdna(prop, NULL, "hilite");
1653 RNA_def_property_array(prop, 3);
1654 RNA_def_property_ui_text(prop, "Channels Selected", "");
1655 RNA_def_property_update(prop, 0, "rna_userdef_update");
1657 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1658 RNA_def_property_float_sdna(prop, NULL, "group");
1659 RNA_def_property_array(prop, 3);
1660 RNA_def_property_ui_text(prop, "Channel Group", "");
1661 RNA_def_property_update(prop, 0, "rna_userdef_update");
1663 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1664 RNA_def_property_float_sdna(prop, NULL, "group_active");
1665 RNA_def_property_array(prop, 3);
1666 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1667 RNA_def_property_update(prop, 0, "rna_userdef_update");
1669 prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
1670 RNA_def_property_float_sdna(prop, NULL, "strip");
1671 RNA_def_property_array(prop, 3);
1672 RNA_def_property_ui_text(prop, "Long Key", "");
1673 RNA_def_property_update(prop, 0, "rna_userdef_update");
1675 prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1676 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1677 RNA_def_property_array(prop, 3);
1678 RNA_def_property_ui_text(prop, "Long Key Selected", "");
1679 RNA_def_property_update(prop, 0, "rna_userdef_update");
1681 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1682 RNA_def_property_float_sdna(prop, NULL, "cframe");
1683 RNA_def_property_array(prop, 3);
1684 RNA_def_property_ui_text(prop, "Current Frame", "");
1685 RNA_def_property_update(prop, 0, "rna_userdef_update");
1687 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
1688 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1689 RNA_def_property_array(prop, 3);
1690 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1691 RNA_def_property_update(prop, 0, "rna_userdef_update");
1693 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
1694 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1695 RNA_def_property_array(prop, 3);
1696 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1697 RNA_def_property_update(prop, 0, "rna_userdef_update");
1700 static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
1707 srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL);
1708 RNA_def_struct_sdna(srna, "ThemeSpace");
1709 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1710 RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor");
1712 rna_def_userdef_theme_spaces_main(srna, SPACE_NLA);
1714 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1715 RNA_def_property_array(prop, 3);
1716 RNA_def_property_ui_text(prop, "Grid", "");
1717 RNA_def_property_update(prop, 0, "rna_userdef_update");
1719 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1720 RNA_def_property_float_sdna(prop, NULL, "shade1");
1721 RNA_def_property_array(prop, 3);
1722 RNA_def_property_ui_text(prop, "View Sliders", "");
1723 RNA_def_property_update(prop, 0, "rna_userdef_update");
1725 prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR_GAMMA);
1726 RNA_def_property_float_sdna(prop, NULL, "shade2");
1727 RNA_def_property_array(prop, 3);
1728 RNA_def_property_ui_text(prop, "Bars", "");
1729 RNA_def_property_update(prop, 0, "rna_userdef_update");
1731 prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1732 RNA_def_property_float_sdna(prop, NULL, "hilite");
1733 RNA_def_property_array(prop, 3);
1734 RNA_def_property_ui_text(prop, "Bars Selected", "");
1735 RNA_def_property_update(prop, 0, "rna_userdef_update");
1737 prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
1738 RNA_def_property_float_sdna(prop, NULL, "strip");
1739 RNA_def_property_array(prop, 3);
1740 RNA_def_property_ui_text(prop, "Strips", "");
1741 RNA_def_property_update(prop, 0, "rna_userdef_update");
1743 prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1744 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1745 RNA_def_property_array(prop, 3);
1746 RNA_def_property_ui_text(prop, "Strips Selected", "");
1747 RNA_def_property_update(prop, 0, "rna_userdef_update");
1749 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1750 RNA_def_property_float_sdna(prop, NULL, "cframe");
1751 RNA_def_property_array(prop, 3);
1752 RNA_def_property_ui_text(prop, "Current Frame", "");
1753 RNA_def_property_update(prop, 0, "rna_userdef_update");
1756 static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
1761 srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
1762 RNA_def_struct_sdna(srna, "ThemeWireColor");
1763 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1764 RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
1766 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
1767 RNA_def_property_float_sdna(prop, NULL, "solid");
1768 RNA_def_property_array(prop, 3);
1769 RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
1770 RNA_def_property_update(prop, 0, "rna_userdef_update");
1772 prop= RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
1773 RNA_def_property_float_sdna(prop, NULL, "select");
1774 RNA_def_property_array(prop, 3);
1775 RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
1776 RNA_def_property_update(prop, 0, "rna_userdef_update");
1778 prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
1779 RNA_def_property_array(prop, 3);
1780 RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
1781 RNA_def_property_update(prop, 0, "rna_userdef_update");
1783 prop= RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
1784 RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
1785 RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
1786 RNA_def_property_update(prop, 0, "rna_userdef_update");
1789 static void rna_def_userdef_theme_space_clip(BlenderRNA *brna)
1796 srna= RNA_def_struct(brna, "ThemeClipEditor", NULL);
1797 RNA_def_struct_sdna(srna, "ThemeSpace");
1798 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1799 RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor");
1801 rna_def_userdef_theme_spaces_main(srna, SPACE_CLIP);
1803 prop= RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
1804 RNA_def_property_float_sdna(prop, NULL, "marker_outline");
1805 RNA_def_property_array(prop, 3);
1806 RNA_def_property_ui_text(prop, "Marker Outline Color", "Color of marker's outile");
1807 RNA_def_property_update(prop, 0, "rna_userdef_update");
1809 prop= RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
1810 RNA_def_property_float_sdna(prop, NULL, "marker");
1811 RNA_def_property_array(prop, 3);
1812 RNA_def_property_ui_text(prop, "Marker Color", "Color of marker");
1813 RNA_def_property_update(prop, 0, "rna_userdef_update");
1815 prop= RNA_def_property(srna, "active_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
1816 RNA_def_property_float_sdna(prop, NULL, "act_marker");
1817 RNA_def_property_array(prop, 3);
1818 RNA_def_property_ui_text(prop, "Active Marker", "Color of active marker");
1819 RNA_def_property_update(prop, 0, "rna_userdef_update");
1821 prop= RNA_def_property(srna, "selected_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
1822 RNA_def_property_float_sdna(prop, NULL, "sel_marker");
1823 RNA_def_property_array(prop, 3);
1824 RNA_def_property_ui_text(prop, "Selected Marker", "Color of sleected marker");
1825 RNA_def_property_update(prop, 0, "rna_userdef_update");
1827 prop= RNA_def_property(srna, "disabled_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
1828 RNA_def_property_float_sdna(prop, NULL, "dis_marker");
1829 RNA_def_property_array(prop, 3);
1830 RNA_def_property_ui_text(prop, "Disabled Marker", "Color of disabled marker");
1831 RNA_def_property_update(prop, 0, "rna_userdef_update");
1833 prop= RNA_def_property(srna, "locked_marker", PROP_FLOAT, PROP_COLOR_GAMMA);
1834 RNA_def_property_float_sdna(prop, NULL, "lock_marker");
1835 RNA_def_property_array(prop, 3);
1836 RNA_def_property_ui_text(prop, "Locked Marker", "Color of locked marker");
1837 RNA_def_property_update(prop, 0, "rna_userdef_update");
1839 prop= RNA_def_property(srna, "path_before", PROP_FLOAT, PROP_COLOR_GAMMA);
1840 RNA_def_property_float_sdna(prop, NULL, "path_before");
1841 RNA_def_property_array(prop, 3);
1842 RNA_def_property_ui_text(prop, "Path Before", "Color of path before current frame");
1843 RNA_def_property_update(prop, 0, "rna_userdef_update");
1845 prop= RNA_def_property(srna, "path_after", PROP_FLOAT, PROP_COLOR_GAMMA);
1846 RNA_def_property_float_sdna(prop, NULL, "path_after");
1847 RNA_def_property_array(prop, 3);
1848 RNA_def_property_ui_text(prop, "Path After", "Color of path after current frame");
1849 RNA_def_property_update(prop, 0, "rna_userdef_update");
1851 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1852 RNA_def_property_array(prop, 3);
1853 RNA_def_property_ui_text(prop, "Grid", "");
1854 RNA_def_property_update(prop, 0, "rna_userdef_update");
1856 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1857 RNA_def_property_float_sdna(prop, NULL, "cframe");
1858 RNA_def_property_array(prop, 3);
1859 RNA_def_property_ui_text(prop, "Current Frame", "");
1860 RNA_def_property_update(prop, 0, "rna_userdef_update");
1862 prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
1863 RNA_def_property_array(prop, 3);
1864 RNA_def_property_ui_text(prop, "Handle Vertex", "");
1865 RNA_def_property_update(prop, 0, "rna_userdef_update");
1867 prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
1868 RNA_def_property_array(prop, 3);
1869 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
1870 RNA_def_property_update(prop, 0, "rna_userdef_update");
1872 prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
1873 RNA_def_property_range(prop, 0, 255);
1874 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
1875 RNA_def_property_update(prop, 0, "rna_userdef_update");
1878 static void rna_def_userdef_themes(BlenderRNA *brna)
1883 static EnumPropertyItem active_theme_area[] = {
1884 {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
1885 {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
1886 {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
1887 {2, "TIMELINE", ICON_TIME, "Timeline", ""},
1888 {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
1889 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
1890 {5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
1891 {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
1892 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
1893 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
1894 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
1895 {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
1896 {11, "PROPERTIES", ICON_BUTS, "Properties", ""},
1897 {12, "OUTLINER", ICON_OOPS, "Outliner", ""},
1898 {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
1899 {15, "INFO", ICON_INFO, "Info", ""},
1900 {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
1901 {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
1902 {20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
1903 {0, NULL, 0, NULL, NULL}};
1905 srna= RNA_def_struct(brna, "Theme", NULL);
1906 RNA_def_struct_sdna(srna, "bTheme");
1907 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1908 RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface");
1910 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1911 RNA_def_property_ui_text(prop, "Name", "Name of the theme");
1912 RNA_def_struct_name_property(srna, prop);
1914 prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
1915 RNA_def_property_enum_sdna(prop, NULL, "active_theme_area");
1916 RNA_def_property_enum_items(prop, active_theme_area);
1917 RNA_def_property_ui_text(prop, "Active Theme Area", "");
1919 prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
1920 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1921 RNA_def_property_pointer_sdna(prop, NULL, "tui");
1922 RNA_def_property_struct_type(prop, "ThemeUserInterface");
1923 RNA_def_property_ui_text(prop, "User Interface", "");
1925 prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
1926 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1927 RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
1928 RNA_def_property_struct_type(prop, "ThemeView3D");
1929 RNA_def_property_ui_text(prop, "3D View", "");
1931 prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
1932 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1933 RNA_def_property_pointer_sdna(prop, NULL, "tipo");
1934 RNA_def_property_struct_type(prop, "ThemeGraphEditor");
1935 RNA_def_property_ui_text(prop, "Graph Editor", "");
1937 prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
1938 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1939 RNA_def_property_pointer_sdna(prop, NULL, "tfile");
1940 RNA_def_property_struct_type(prop, "ThemeFileBrowser");
1941 RNA_def_property_ui_text(prop, "File Browser", "");
1943 prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
1944 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1945 RNA_def_property_pointer_sdna(prop, NULL, "tnla");
1946 RNA_def_property_struct_type(prop, "ThemeNLAEditor");
1947 RNA_def_property_ui_text(prop, "NLA Editor", "");
1949 prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
1950 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1951 RNA_def_property_pointer_sdna(prop, NULL, "tact");
1952 RNA_def_property_struct_type(prop, "ThemeDopeSheet");
1953 RNA_def_property_ui_text(prop, "DopeSheet", "");
1955 prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
1956 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1957 RNA_def_property_pointer_sdna(prop, NULL, "tima");
1958 RNA_def_property_struct_type(prop, "ThemeImageEditor");
1959 RNA_def_property_ui_text(prop, "Image Editor", "");
1961 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
1962 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1963 RNA_def_property_pointer_sdna(prop, NULL, "tseq");
1964 RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
1965 RNA_def_property_ui_text(prop, "Sequence Editor", "");
1967 prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
1968 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1969 RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
1970 RNA_def_property_struct_type(prop, "ThemeProperties");
1971 RNA_def_property_ui_text(prop, "Properties", "");
1973 prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
1974 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1975 RNA_def_property_pointer_sdna(prop, NULL, "text");
1976 RNA_def_property_struct_type(prop, "ThemeTextEditor");
1977 RNA_def_property_ui_text(prop, "Text Editor", "");
1979 prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
1980 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1981 RNA_def_property_pointer_sdna(prop, NULL, "ttime");
1982 RNA_def_property_struct_type(prop, "ThemeTimeline");
1983 RNA_def_property_ui_text(prop, "Timeline", "");
1985 prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
1986 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1987 RNA_def_property_pointer_sdna(prop, NULL, "tnode");
1988 RNA_def_property_struct_type(prop, "ThemeNodeEditor");
1989 RNA_def_property_ui_text(prop, "Node Editor", "");
1991 prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
1992 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1993 RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
1994 RNA_def_property_struct_type(prop, "ThemeLogicEditor");
1995 RNA_def_property_ui_text(prop, "Logic Editor", "");
1997 prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
1998 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1999 RNA_def_property_pointer_sdna(prop, NULL, "toops");
2000 RNA_def_property_struct_type(prop, "ThemeOutliner");
2001 RNA_def_property_ui_text(prop, "Outliner", "");
2003 prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
2004 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2005 RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
2006 RNA_def_property_struct_type(prop, "ThemeInfo");
2007 RNA_def_property_ui_text(prop, "Info", "");
2009 prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
2010 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2011 RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
2012 RNA_def_property_struct_type(prop, "ThemeUserPreferences");
2013 RNA_def_property_ui_text(prop, "User Preferences", "");
2015 prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
2016 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2017 RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
2018 RNA_def_property_struct_type(prop, "ThemeConsole");
2019 RNA_def_property_ui_text(prop, "Console", "");
2021 prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
2022 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2023 RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
2024 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
2025 RNA_def_property_ui_text(prop, "Bone Color Sets", "");
2027 prop= RNA_def_property(srna, "clip_editor", PROP_POINTER, PROP_NONE);
2028 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2029 RNA_def_property_pointer_sdna(prop, NULL, "tclip");
2030 RNA_def_property_struct_type(prop, "ThemeClipEditor");
2031 RNA_def_property_ui_text(prop, "Clip Editor", "");
2034 static void rna_def_userdef_addon(BlenderRNA *brna)
2039 srna= RNA_def_struct(brna, "Addon", NULL);
2040 RNA_def_struct_sdna(srna, "bAddon");
2041 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
2042 RNA_def_struct_ui_text(srna, "Addon", "Python addons to be loaded automatically");
2044 prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
2045 RNA_def_property_ui_text(prop, "Module", "Module name");
2046 RNA_def_struct_name_property(srna, prop);
2050 static void rna_def_userdef_dothemes(BlenderRNA *brna)
2053 rna_def_userdef_theme_ui_style(brna);
2054 rna_def_userdef_theme_ui(brna);
2056 rna_def_userdef_theme_space_view3d(brna);
2057 rna_def_userdef_theme_space_graph(brna);
2058 rna_def_userdef_theme_space_file(brna);
2059 rna_def_userdef_theme_space_nla(brna);
2060 rna_def_userdef_theme_space_action(brna);
2061 rna_def_userdef_theme_space_image(brna);
2062 rna_def_userdef_theme_space_seq(brna);
2063 rna_def_userdef_theme_space_buts(brna);
2064 rna_def_userdef_theme_space_text(brna);
2065 rna_def_userdef_theme_space_time(brna);
2066 rna_def_userdef_theme_space_node(brna);
2067 rna_def_userdef_theme_space_outliner(brna);
2068 rna_def_userdef_theme_space_info(brna);
2069 rna_def_userdef_theme_space_userpref(brna);
2070 rna_def_userdef_theme_space_console(brna);
2071 rna_def_userdef_theme_space_logic(brna);
2072 rna_def_userdef_theme_space_clip(brna);
2073 rna_def_userdef_theme_colorset(brna);
2074 rna_def_userdef_themes(brna);
2077 static void rna_def_userdef_solidlight(BlenderRNA *brna)
2081 static float default_dir[3] = {0.f, 1.f, 0.f};
2083 srna= RNA_def_struct(brna, "UserSolidLight", NULL);
2084 RNA_def_struct_sdna(srna, "SolidLight");
2085 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
2086 RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
2088 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
2089 RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
2090 RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
2091 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
2093 prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
2094 RNA_def_property_float_sdna(prop, NULL, "vec");
2095 RNA_def_property_array(prop, 3);
2096 RNA_def_property_float_array_default(prop, default_dir);
2097 RNA_def_property_ui_text(prop, "Direction", "Direction that the OpenGL light is shining");
2098 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
2100 prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
2101 RNA_def_property_float_sdna(prop, NULL, "col");
2102 RNA_def_property_array(prop, 3);
2103 RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the OpenGL light");
2104 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
2106 prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
2107 RNA_def_property_float_sdna(prop, NULL, "spec");
2108 RNA_def_property_array(prop, 3);
2109 RNA_def_property_ui_text(prop, "Specular Color", "Color of the light's specular highlight");
2110 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
2113 static void rna_def_userdef_view(BlenderRNA *brna)
2115 static EnumPropertyItem timecode_styles[] = {
2116 {USER_TIMECODE_MINIMAL, "MINIMAL", 0, "Minimal Info",
2117 "Most compact representation, uses '+' as separator for sub-second frame numbers, "
2118 "with left and right truncation of the timecode as necessary"},
2119 {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode (format is HH:MM:SS:FF)"},
2120 {USER_TIMECODE_SMPTE_MSF, "SMPTE_COMPACT", 0, "SMPTE (Compact)",
2121 "SMPTE timecode showing minutes, seconds, and frames only - "
2122 "hours are also shown if necessary, but not by default"},
2123 {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds",
2124 "Similar to SMPTE (Compact), except that instead of frames, "
2125 "milliseconds are shown instead"},
2126 {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
2127 {0, NULL, 0, NULL, NULL}};
2132 srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
2133 RNA_def_struct_sdna(srna, "UserDef");
2134 RNA_def_struct_nested(brna, srna, "UserPreferences");
2135 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
2136 RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
2141 prop= RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
2142 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
2143 RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
2145 prop= RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
2146 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
2147 RNA_def_property_ui_text(prop, "Show Python Tooltips", "Show Python references in tooltips");
2149 prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
2150 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
2151 RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
2152 RNA_def_property_update(prop, 0, "rna_userdef_update");
2154 prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
2155 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
2156 RNA_def_property_ui_text(prop, "Global Scene", "Force the current Scene to be displayed in all Screens");
2157 RNA_def_property_update(prop, 0, "rna_userdef_update");
2159 prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
2160 RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
2161 RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
2162 RNA_def_property_update(prop, 0, "rna_userdef_update");
2164 prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
2165 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME);
2166 RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
2167 RNA_def_property_update(prop, 0, "rna_userdef_update");
2169 prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
2170 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
2171 RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
2173 prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
2174 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
2175 RNA_def_property_ui_text(prop, "Show Playback FPS",
2176 "Show the frames per second screen refresh rate, while animation is played back");
2177 RNA_def_property_update(prop, 0, "rna_userdef_update");
2180 prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
2181 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
2182 RNA_def_property_ui_text(prop, "Open On Mouse Over",
2183 "Open menu buttons and pulldowns automatically when the mouse is hovering");
2185 prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
2186 RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
2187 RNA_def_property_range(prop, 1, 40);
2188 RNA_def_property_ui_text(prop, "Top Level Menu Open Delay",
2189 "Time delay in 1/10 seconds before automatically opening top level menus");
2191 prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
2192 RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
2193 RNA_def_property_range(prop, 1, 40);
2194 RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay",
2195 "Time delay in 1/10 seconds before automatically opening sub level menus");
2197 /* Toolbox click-hold delay */
2198 prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
2199 RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
2200 RNA_def_property_range(prop, 1, 40);
2201 RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay",
2202 "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
2204 prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
2205 RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
2206 RNA_def_property_range(prop, 1, 40);
2207 RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay",
2208 "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
2210 prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
2211 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
2212 RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
2214 prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
2215 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
2216 RNA_def_property_ui_text(prop, "Contents Follow Opening Direction",
2217 "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction");
2219 prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
2220 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
2221 RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
2223 prop= RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
2224 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
2225 RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
2227 prop= RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
2228 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
2229 RNA_def_property_ui_text(prop, "Camera Parent Lock",
2230 "When the camera is locked to the view and in fly mode, "
2231 "transform the parent rather than the camera");
2234 prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
2235 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
2236 RNA_def_property_ui_text(prop, "Zoom To Mouse Position",
2237 "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
2240 prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
2241 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
2242 RNA_def_property_ui_text(prop, "Auto Perspective",
2243 "Automatically switch between orthographic and perspective when changing "
2244 "from top/front/side views");
2246 prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
2247 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
2248 RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
2251 prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
2252 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
2253 RNA_def_property_ui_text(prop, "Show Mini Axes", "Show a small rotating 3D axes in the bottom left corner of the 3D View");
2254 RNA_def_property_update(prop, 0, "rna_userdef_update");
2256 prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
2257 RNA_def_property_int_sdna(prop, NULL, "rvisize");
2258 RNA_def_property_range(prop, 10, 64);
2259 RNA_def_property_ui_text(prop, "Mini Axes Size", "The axes icon's size");
2260 RNA_def_property_update(prop, 0, "rna_userdef_update");
2262 prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
2263 RNA_def_property_int_sdna(prop, NULL, "rvibright");
2264 RNA_def_property_range(prop, 0, 10);
2265 RNA_def_property_ui_text(prop, "Mini Axes Brightness", "Brightness of the icon");
2266 RNA_def_property_update(prop, 0, "rna_userdef_update");
2268 prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
2269 RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
2270 RNA_def_property_range(prop, 0, 1000);
2271 RNA_def_property_ui_text(prop, "Smooth View", "Time to animate the view in milliseconds, zero to disable");
2273 prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
2274 RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
2275 RNA_def_property_range(prop, 0, 90);
2276 RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation step for numerical pad keys (2 4 6 8)");
2278 /* 3D transform widget */
2279 prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
2280 RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", V3D_USE_MANIPULATOR);
2281 RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
2282 RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update");
2284 prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
2285 RNA_def_property_int_sdna(prop, NULL, "tw_size");
2286 RNA_def_property_range(prop, 2, 40);
2287 RNA_def_property_int_default(prop, 15);
2288 RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units");
2289 RNA_def_property_update(prop, 0, "rna_userdef_update");
2291 prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
2292 RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
2293 RNA_def_property_range(prop, 2, 40);
2294 RNA_def_property_int_default(prop, 25);
2295 RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius");
2296 RNA_def_property_update(prop, 0, "rna_userdef_update");
2298 prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
2299 RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
2300 RNA_def_property_range(prop, 4, 40);
2301 RNA_def_property_int_default(prop, 14);
2302 RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Pixel distance around the handles to accept mouse clicks");
2304 prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
2305 RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
2306 RNA_def_property_range(prop, 4, 10);
2307 RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display");
2308 RNA_def_property_update(prop, 0, "rna_userdef_update");
2310 /* View2D Grid Displays */
2311 prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
2312 RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
2313 RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
2314 RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing",
2315 "Minimum number of pixels between each gridline in 2D Viewports");
2316 RNA_def_property_update(prop, 0, "rna_userdef_update");
2318 // TODO: add a setter for this, so that we can bump up the minimum size as necessary...
2319 prop= RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
2320 RNA_def_property_enum_items(prop, timecode_styles);
2321 RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
2322 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
2323 RNA_def_property_ui_text(prop, "TimeCode Style",
2324 "Format of Time Codes displayed when not displaying timing in terms of frames");
2325 RNA_def_property_update(prop, 0, "rna_userdef_update");
2328 static void rna_def_userdef_edit(BlenderRNA *brna)
2333 static EnumPropertyItem auto_key_modes[] = {
2334 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
2335 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
2336 {0, NULL, 0, NULL, NULL}};
2338 static const EnumPropertyItem material_link_items[]= {
2339 {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
2340 {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"},
2341 {0, NULL, 0, NULL, NULL}};
2343 static const EnumPropertyItem object_align_items[]= {
2344 {0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"},
2345 {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
2346 {0, NULL, 0, NULL, NULL}};
2348 srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
2349 RNA_def_struct_sdna(srna, "UserDef");
2350 RNA_def_struct_nested(brna, srna, "UserPreferences");
2351 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
2352 RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
2356 prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
2357 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2358 RNA_def_property_enum_items(prop, material_link_items);
2359 RNA_def_property_ui_text(prop, "Material Link To",
2360 "Toggle whether the material is linked to object data or the object block");
2362 prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
2363 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2364 RNA_def_property_enum_items(prop, object_align_items);
2365 RNA_def_property_ui_text(prop, "Align Object To",
2366 "When adding objects from a 3D View menu, either align them with that view or with the world");
2368 prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
2369 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
2370 RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object");
2372 prop= RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
2373 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM);
2374 RNA_def_property_ui_text(prop, "Release confirms", "Moving things with a mouse drag confirms when releasing the button");
2377 prop= RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
2378 RNA_def_property_int_sdna(prop, NULL, "undosteps");
2379 RNA_def_property_range(prop, 0, 64);
2380 RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
2382 prop= RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
2383 RNA_def_property_int_sdna(prop, NULL, "undomemory");
2384 RNA_def_property_range(prop, 0, 32767);
2385 RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
2387 prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
2388 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
2389 RNA_def_property_ui_text(prop, "Global Undo",
2390 "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
2392 /* auto keyframing */
2393 prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
2394 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
2395 RNA_def_property_ui_text(prop, "Auto Keying Enable",
2396 "Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)");
2397 RNA_def_property_ui_icon(prop, ICON_REC, 0);
2399 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
2400 RNA_def_property_enum_items(prop, auto_key_modes);
2401 RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
2402 RNA_def_property_ui_text(prop, "Auto Keying Mode",
2403 "Mode of automatic keyframe insertion for Objects and Bones "
2404 "(default setting used for new Scenes)");
2406 prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
2407 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
2408 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available F-Curves");
2410 /* keyframing settings */
2411 prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
2412 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
2413 RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
2415 prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
2416 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
2417 RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
2419 prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
2420 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
2421 RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB",
2422 "Color for newly added transformation F-Curves (Location, Rotation, Scale) "
2423 "and also Color is based on the transform axis");
2425 prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
2426 RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
2427 RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
2428 RNA_def_property_ui_text(prop, "New Interpolation Type",
2429 "Interpolation mode used for first keyframe on newly added F-Curves "
2430 "(subsequent keyframes take interpolation from preceeding keyframe)");
2432 prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
2433 RNA_def_property_enum_items(prop, keyframe_handle_type_items);
2434 RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new");
2435 RNA_def_property_ui_text(prop, "New Handles Type", "Handle type for handles of new keyframes");
2438 prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
2439 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
2440 RNA_def_property_ui_text(prop, "Allow Negative Frames", "Current frame number can be manually set to a negative value");
2443 prop= RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
2444 RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist");
2445 RNA_def_property_range(prop, 0, 100);
2446 RNA_def_property_ui_text(prop, "Grease Pencil Manhattan Distance", "Pixels moved by mouse per axis when drawing stroke");
2448 prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
2449 RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
2450 RNA_def_property_range(prop, 0, 100);
2451 RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance",
2452 "Distance moved by mouse when drawing stroke (in pixels) to include");
2454 prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
2455 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
2456 RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
2458 prop= RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
2459 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
2460 RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
2462 prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
2463 RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
2464 RNA_def_property_range(prop, 0, 100);
2465 RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
2467 /* sculpt and paint */
2469 prop= RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2470 RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_overlay_col");
2471 RNA_def_property_array(prop, 3);
2472 RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
2474 /* duplication linking */
2475 prop= RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
2476 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
2477 RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
2479 prop= RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
2480 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
2481 RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
2483 prop= RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
2484 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
2485 RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
2487 prop= RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
2488 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
2489 RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
2491 prop= RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
2492 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
2493 RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
2495 prop= RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
2496 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
2497 RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
2499 prop= RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
2500 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
2501 RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
2503 prop= RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
2504 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
2505 RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
2507 prop= RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
2508 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
2509 RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
2512 prop= RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
2513 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
2514 RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
2516 prop= RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
2517 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
2518 RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
2520 prop= RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
2521 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
2522 RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
2525 static void rna_def_userdef_system(BlenderRNA *brna)
2530 static EnumPropertyItem gl_texture_clamp_items[] = {
2531 {0, "CLAMP_OFF", 0, "Off", ""},
2532 {8192, "CLAMP_8192", 0, "8192", ""},
2533 {4096, "CLAMP_4096", 0, "4096", ""},
2534 {2048, "CLAMP_2048", 0, "2048", ""},
2535 {1024, "CLAMP_1024", 0, "1024", ""},
2536 {512, "CLAMP_512", 0, "512", ""},
2537 {256, "CLAMP_256", 0, "256", ""},
2538 {128, "CLAMP_128", 0, "128", ""},
2539 {0, NULL, 0, NULL, NULL}};
2541 static EnumPropertyItem anisotropic_items[] ={
2542 {1, "FILTER_0", 0, "Off", ""},
2543 {2, "FILTER_2", 0, "2x", ""},
2544 {4, "FILTER_4", 0, "4x", ""},
2545 {8, "FILTER_8", 0, "8x", ""},
2546 {16, "FILTER_16", 0, "16x", ""},
2547 {0, NULL, 0, NULL, NULL}};
2549 static EnumPropertyItem audio_mixing_samples_items[] = {
2550 {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
2551 {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
2552 {1024, "SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
2553 {2048, "SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
2554 {4096, "SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
2555 {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
2556 {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
2557 {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
2558 {0, NULL, 0, NULL, NULL}};
2560 static EnumPropertyItem audio_device_items[] = {
2561 {0, "NONE", 0, "None", "Null device - there will be no audio output"},
2563 {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage"},
2566 {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"},
2569 {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"},
2571 {0, NULL, 0, NULL, NULL}};
2573 static EnumPropertyItem audio_rate_items[] = {
2574 // {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
2575 // {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
2576 // {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
2577 // {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
2578 // {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
2579 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
2580 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
2581 // {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
2582 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
2583 {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
2584 {0, NULL, 0, NULL, NULL}};
2586 static EnumPropertyItem audio_format_items[] = {
2587 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
2588 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer"},
2589 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer"},
2590 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
2591 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
2592 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
2593 {0, NULL, 0, NULL, NULL}};
2595 static EnumPropertyItem audio_channel_items[] = {
2596 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2597 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
2598 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2599 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2600 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2601 {0, NULL, 0, NULL, NULL}};
2603 static EnumPropertyItem draw_method_items[] = {
2604 {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
2605 {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer",
2606 "Use a third buffer for minimal redraws at the cost of more memory"},
2607 {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
2608 {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip",
2609 "Redraw all overlapping regions, minimal memory usage but more redraws "
2610 "(for graphics drivers that do flipping)"},
2611 {USER_DRAW_FULL, "FULL", 0, "Full",
2612 "Do a full redraw each time, slow, only use for reference or when everything else fails"},
2613 {0, NULL, 0, NULL, NULL}};
2615 static EnumPropertyItem color_picker_types[] = {
2616 {USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
2617 {USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
2618 {USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
2619 {USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
2620 {0, NULL, 0, NULL, NULL}};
2622 /* hardcoded here, could become dynamic somehow */
2623 /* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
2624 /* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
2625 static EnumPropertyItem language_items[] = {
2626 {0, "", 0, "Nearly done", ""},
2627 {0, "DEFAULT", 0, "Default (Default)", ""},
2628 {1, "ENGLISH", 0, "English (English)", "en_US"},
2629 {8, "FRENCH", 0, "French (Français)", "fr_FR"},
2630 {4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"},
2631 {15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"},
2632 {13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"},
2633 {9, "SPANISH", 0, "Spanish (Español)", "es_ES"},
2634 {0, "", 0, "In progress", ""},
2635 {2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
2636 {3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"},
2637 {5, "GERMAN", 0, "German (Deutsch)", "de_DE"},
2638 {6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"},
2639 {7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
2640 {10, "CATALAN", 0, "Catalan (Català)", "ca_AD"},
2641 {11, "CZECH", 0, "Czech (Český)", "cs_CZ"},
2642 {12, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese (Português do Brasil)", "pt_BR"},
2643 {14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"},
2644 {16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"},
2645 {17, "SERBIAN", 0, "Serbian (Српском језику)", "sr_RS"},
2646 {18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
2647 {19, "POLISH", 0, "Polish (Polski)", "pl_PL"},
2648 {20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"},
2649 /* using the utf8 flipped form of Arabic (العربية) */
2650 {21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"},
2651 {22, "BULGARIAN", 0, "Bulgarian (Български)", "bg_BG"},
2652 {23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
2653 {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"},
2654 /*{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},*/
2655 /* using the utf8 flipped form of Persian (فارسی) */
2656 {26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_PE"},
2657 {27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
2658 {0, NULL, 0, NULL, NULL}};
2660 srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
2661 RNA_def_struct_sdna(srna, "UserDef");
2662 RNA_def_struct_nested(brna, srna, "UserPreferences");
2663 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
2664 RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
2668 prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
2669 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
2670 RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
2671 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
2673 prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
2674 RNA_def_property_int_sdna(prop, NULL, "dpi");
2675 RNA_def_property_range(prop, 48, 128);
2676 RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
2677 RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
2679 prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
2680 RNA_def_property_int_sdna(prop, NULL, "scrollback");
2681 RNA_def_property_range(prop, 32, 32768);
2682 RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
2684 prop= RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
2685 RNA_def_property_string_sdna(prop, NULL, "author");
2686 RNA_def_property_string_maxlength(prop, 80);
2687 RNA_def_property_ui_text(prop, "Author", "Name that will be used in exported files when format supports such feature");
2689 /* Language Selection */
2691 prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
2692 RNA_def_property_enum_items(prop, language_items);
2693 RNA_def_property_ui_text(prop, "Language", "Language used for translation");
2694 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
2696 prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
2697 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
2698 RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
2699 RNA_def_property_update(prop, 0, "rna_userdef_update");
2701 prop= RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
2702 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_IFACE);
2703 RNA_def_property_ui_text(prop, "Translate Interface", "Translate Interface");
2704 RNA_def_property_update(prop, 0, "rna_userdef_update");
2706 prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
2707 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
2708 RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts");
2709 RNA_def_property_update(prop, 0, "rna_userdef_update");
2711 /* System & OpenGL */
2713 prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
2714 RNA_def_property_collection_sdna(prop, NULL, "light", "");
2715 RNA_def_property_struct_type(prop, "UserSolidLight");
2716 RNA_def_property_ui_text(prop, "Solid Lights", "Lights user to display objects in solid draw mode");
2718 prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
2719 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
2720 RNA_def_property_ui_text(prop, "Use Weight Color Range",
2721 "Enable color range used for weight visualization in weight painting mode");
2722 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2724 prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
2725 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2726 RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
2727 RNA_def_property_struct_type(prop, "ColorRamp");
2728 RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode");
2729 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2731 prop= RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
2732 RNA_def_property_enum_items(prop, color_picker_types);
2733 RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
2734 RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
2736 prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
2737 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
2738 RNA_def_property_ui_text(prop, "Enable All Codecs",
2739 "Allow user to choose any codec (Windows only, might generate instability)");
2741 prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
2742 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
2743 RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
2744 "Allow any .blend file to run scripts automatically "
2745 "(unsafe with blend files from an untrusted source)");
2746 RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
2748 prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
2749 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
2750 RNA_def_property_ui_text(prop, "Tabs as Spaces",
2751 "Automatically convert all new tabs into spaces for new and loaded text files");
2753 prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
2754 RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
2755 RNA_def_property_range(prop, 0, 500);
2756 RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
2758 prop= RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
2759 RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
2760 RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
2761 RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
2762 RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
2764 prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
2765 RNA_def_property_int_sdna(prop, NULL, "frameserverport");
2766 RNA_def_property_range(prop, 0, 32727);
2767 RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering");
2769 prop= RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
2770 RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
2771 RNA_def_property_range(prop, 0.0f, 1.0f);
2772 RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
2773 RNA_def_property_update(prop, 0, "rna_userdef_update");
2775 prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
2776 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
2777 RNA_def_property_ui_text(prop, "Mipmaps",
2778 "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
2779 RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
2781 prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
2782 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
2783 RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
2784 RNA_def_property_update(prop, NC_WINDOW, NULL); /* this isnt essential but nice to check if VBO draws any differently */
2786 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2787 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
2788 RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)");
2790 prop= RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
2791 RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
2792 RNA_def_property_enum_items(prop, anisotropic_items);
2793 RNA_def_property_enum_default(prop, 1);
2794 RNA_def_property_ui_text(prop, "Anisotropic Filter",
2795 "Quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
2796 RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update");
2798 prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
2799 RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
2800 RNA_def_property_enum_items(prop, gl_texture_clamp_items);
2801 RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
2802 RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update");
2804 prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
2805 RNA_def_property_int_sdna(prop, NULL, "textimeout");
2806 RNA_def_property_range(prop, 0, 3600);
2807 RNA_def_property_ui_text(prop, "Texture Time Out",
2808 "Time since last access of a GL texture in seconds after which it is freed "
2809 "(set to 0 to keep textures allocated)");
2811 prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
2812 RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
2813 RNA_def_property_range(prop, 1, 3600);
2814 RNA_def_property_ui_text(prop, "Texture Collection Rate",
2815 "Number of seconds between each run of the GL texture garbage collector");
2817 prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
2818 RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
2819 RNA_def_property_enum_items(prop, draw_method_items);
2820 RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
2821 RNA_def_property_update(prop, 0, "rna_userdef_update");
2823 prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
2824 RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
2825 RNA_def_property_enum_items(prop, audio_mixing_samples_items);
2826 RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Number of samples used by the audio mixing buffer");
2827 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2829 prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
2830 RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
2831 RNA_def_property_enum_items(prop, audio_device_items);
2832 RNA_def_property_ui_text(prop, "Audio Device", "Audio output device");
2833 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2835 prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
2836 RNA_def_property_enum_sdna(prop, NULL, "audiorate");
2837 RNA_def_property_enum_items(prop, audio_rate_items);
2838 RNA_def_property_ui_text(prop, "Audio Sample Rate", "Audio sample rate");
2839 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2841 prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
2842 RNA_def_property_enum_sdna(prop, NULL, "audioformat");
2843 RNA_def_property_enum_items(prop, audio_format_items);
2844 RNA_def_property_ui_text(prop, "Audio Sample Format", "Audio sample format");
2845 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2847 prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
2848 RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
2849 RNA_def_property_enum_items(prop, audio_channel_items);
2850 RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
2851 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2853 prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
2854 RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
2855 RNA_def_property_range(prop, 10, 50);
2856 RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back");
2858 prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
2859 RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
2860 RNA_def_property_range(prop, 50, 1000);
2861 RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast");
2863 prop= RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
2864 RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_AA);
2865 RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
2866 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
2869 prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
2870 RNA_def_property_string_sdna(prop, NULL, "versemaster");
2871 RNA_def_property_ui_text(prop, "Verse Master", "Verse Master-server IP");
2873 prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE);
2874 RNA_def_property_string_sdna(prop, NULL, "verseuser");
2875 RNA_def_property_ui_text(prop, "Verse Username", "Verse user name");
2879 static void rna_def_userdef_input(BlenderRNA *brna)
2884 static EnumPropertyItem select_mouse_items[] = {
2885 {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
2886 {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
2887 {0, NULL, 0, NULL, NULL}};
2889 static EnumPropertyItem view_rotation_items[] = {
2890 {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
2891 {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
2892 {0, NULL, 0, NULL, NULL}};
2894 static EnumPropertyItem view_zoom_styles[] = {
2895 {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
2896 {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"},
2897 {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zoom in and out like scaling the view, mouse movements relative to center"},
2898 {0, NULL, 0, NULL, NULL}};
2900 static EnumPropertyItem view_zoom_axes[] = {
2901 {0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"},
2902 {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zoom in and out based on horizontal mouse movement"},
2903 {0, NULL, 0, NULL, NULL}};
2905 srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
2906 RNA_def_struct_sdna(srna, "UserDef");
2907 RNA_def_struct_nested(brna, srna, "UserPreferences");
2908 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
2909 RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
2911 prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
2912 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2913 RNA_def_property_enum_items(prop, select_mouse_items);
2914 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
2915 RNA_def_property_ui_text(prop, "Select Mouse", "Mouse button used for selection");
2917 prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
2918 RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
2919 RNA_def_property_enum_items(prop, view_zoom_styles);
2920 RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
2922 prop= RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
2923 RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
2924 RNA_def_property_enum_items(prop, view_zoom_axes);
2925 RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
2927 prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
2928 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
2929 RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
2931 prop= RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
2932 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2933 RNA_def_property_enum_items(prop, view_rotation_items);
2934 RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
2936 prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
2937 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
2938 RNA_def_property_ui_text(prop, "Continuous Grab",
2939 "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
2941 /* tweak tablet & mouse preset */
2942 prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
2943 RNA_def_property_int_sdna(prop, NULL, "dragthreshold");
2944 RNA_def_property_range(prop, 3, 40);
2945 RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
2947 /* 3D mouse settings */
2948 /* global options */
2949 prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
2950 RNA_def_property_range(prop, 0.25f, 4.0f);
2951 RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
2953 prop= RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
2954 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
2955 RNA_def_property_ui_text(prop, "Zoom = Up/Down", "Zoom using up/down on the device (otherwise forward/backward)");
2957 prop= RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
2958 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT);
2959 RNA_def_property_ui_text(prop, "Invert Zoom", "Zoom using opposite direction");
2962 prop= RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
2963 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
2964 RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
2965 /* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/
2967 /* 3D view: orbit */
2968 prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
2969 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
2970 RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
2971 /* in 3Dx docs, this is called 'object mode' vs. 'target camera mode' */
2974 prop= RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE);
2975 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROLL_INVERT_AXIS);
2976 RNA_def_property_ui_text(prop, "Invert roll Axis", "Invert roll axis");
2979 prop= RNA_def_property(srna, "ndof_tilt_invert_axis", PROP_BOOLEAN, PROP_NONE);
2980 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_TILT_INVERT_AXIS);
2981 RNA_def_property_ui_text(prop, "Invert tilt Axis", "Invert tilt axis");
2983 /* 3D view: rotate */
2984 prop= RNA_def_property(srna, "ndof_rotate_invert_axis", PROP_BOOLEAN, PROP_NONE);
2985 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROTATE_INVERT_AXIS);
2986 RNA_def_property_ui_text(prop, "Invert rotation Axis", "Invert rotation axis");
2988 /* 3D view: pan x */
2989 prop= RNA_def_property(srna, "ndof_panx_invert_axis", PROP_BOOLEAN, PROP_NONE);
2990 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANX_INVERT_AXIS);
2991 RNA_def_property_ui_text(prop, "Invert x Axis", "Invert x axis");
2993 /* 3D view: pan y */
2994 prop= RNA_def_property(srna, "ndof_pany_invert_axis", PROP_BOOLEAN, PROP_NONE);
2995 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANY_INVERT_AXIS);
2996 RNA_def_property_ui_text(prop, "Invert y Axis", "Invert y axis");
2998 /* 3D view: pan z */
2999 prop= RNA_def_property(srna, "ndof_panz_invert_axis", PROP_BOOLEAN, PROP_NONE);
3000 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANZ_INVERT_AXIS);
3001 RNA_def_property_ui_text(prop, "Invert z Axis", "Invert z axis");
3004 prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
3005 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);
3006 RNA_def_property_ui_text(prop, "Lock Horizon", "Keep horizon level while flying with 3D Mouse");
3008 prop= RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
3009 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_FLY_HELICOPTER);
3010 RNA_def_property_ui_text(prop, "Helicopter Mode", "Device up/down directly controls your Z position");
3013 prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
3014 RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
3015 RNA_def_property_range(prop, 1, 1000);
3016 RNA_def_property_ui_text(prop, "Double Click Timeout", "Time/delay (in ms) for a double click");
3018 prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
3019 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
3020 RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse",
3021 "Emulate Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)");
3023 prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
3024 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
3025 RNA_def_property_ui_text(prop, "Emulate Numpad", "Main 1 to 0 keys act as the numpad ones (useful for laptops)");
3027 /* middle mouse button */
3028 prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
3029 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
3030 RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
3032 prop= RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
3033 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
3034 RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
3036 prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
3037 RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
3038 RNA_def_property_range(prop, 0, 32);
3039 RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel");
3041 prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
3042 RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
3043 RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
3046 static void rna_def_userdef_filepaths(BlenderRNA *brna)
3051 static EnumPropertyItem anim_player_presets[] = {
3052 //{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, // doesn't work yet!
3053 {1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
3054 {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
3055 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
3056 {4, "RV", 0, "rv", "Frame player from Tweak Software"},
3057 {5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"},
3058 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
3059 {0, NULL, 0, NULL, NULL}};
3061 srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
3062 RNA_def_struct_sdna(srna, "UserDef");
3063 RNA_def_struct_nested(brna, srna, "UserPreferences");
3064 RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
3065 RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
3067 prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
3068 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
3069 RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot (.*)");
3071 prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
3072 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
3073 RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
3075 prop= RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE);
3076 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
3077 RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector");
3079 prop= RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
3080 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_THUMBNAILS);
3081 RNA_def_property_ui_text(prop, "Show Thumbnails", "Open in thumbnail view for images and movies");
3083 prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
3084 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
3085 RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
3087 prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
3088 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
3089 RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
3091 prop= RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
3092 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
3093 RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
3095 prop= RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
3096 RNA_def_property_string_sdna(prop, NULL, "fontdir");
3097 RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search