4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
25 /** \file blender/makesrna/intern/rna_userdef.c
32 #include "RNA_define.h"
33 #include "RNA_enum_types.h"
35 #include "rna_internal.h"
37 #include "DNA_curve_types.h"
38 #include "DNA_space_types.h"
39 #include "DNA_userdef_types.h"
40 #include "DNA_brush_types.h"
41 #include "DNA_view3d_types.h"
46 #include "BLI_utildefines.h"
48 #include "BKE_sound.h"
52 #include "DNA_object_types.h"
53 #include "DNA_screen_types.h"
55 #include "BKE_DerivedMesh.h"
56 #include "BKE_depsgraph.h"
57 #include "BKE_global.h"
64 #include "MEM_guardedalloc.h"
65 #include "MEM_CacheLimiterC-Api.h"
67 static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
69 WM_main_add_notifier(NC_WINDOW, NULL);
72 static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr)
74 U.widget_unit = (U.dpi * 20 + 36)/72;
75 WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */
76 WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); /* refresh region sizes */
79 static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr)
81 UserDef *userdef = (UserDef *)ptr->data;
83 /* lame, loop over all views and set */
88 /* from scene copy to the other views */
89 for(sc=bmain->screen.first; sc; sc=sc->id.next) {
90 for(sa=sc->areabase.first; sa; sa=sa->next) {
91 for(sl=sa->spacedata.first; sl; sl=sl->next) {
92 if(sl->spacetype==SPACE_VIEW3D) {
93 View3D *v3d= (View3D *)sl;
94 if(userdef->tw_flag & V3D_USE_MANIPULATOR)
95 v3d->twflag |= V3D_USE_MANIPULATOR;
97 v3d->twflag &= ~V3D_USE_MANIPULATOR;
103 rna_userdef_update(bmain, scene, ptr);
107 static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
109 UserDef *userdef = (UserDef*)ptr->data;
110 if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
111 else G.f |= G_SCRIPT_AUTOEXEC;
114 static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
116 GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
117 rna_userdef_update(bmain, scene, ptr);
120 static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr)
122 GPU_set_anisotropic(U.anisotropic_filter);
123 rna_userdef_update(bmain, scene, ptr);
126 static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
129 rna_userdef_update(bmain, scene, ptr);
132 static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
134 UserDef *userdef = (UserDef*)ptr->data;
137 userdef->flag |= USER_LMOUSESELECT;
138 userdef->flag &= ~USER_TWOBUTTONMOUSE;
141 userdef->flag &= ~USER_LMOUSESELECT;
144 static int rna_userdef_autokeymode_get(PointerRNA *ptr)
146 UserDef *userdef = (UserDef*)ptr->data;
147 short retval = userdef->autokey_mode;
149 if(!(userdef->autokey_mode & AUTOKEY_ON))
150 retval |= AUTOKEY_ON;
155 static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
157 UserDef *userdef = (UserDef*)ptr->data;
159 if(value == AUTOKEY_MODE_NORMAL) {
160 userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
161 userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
163 else if(value == AUTOKEY_MODE_EDITKEYS) {
164 userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
165 userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
169 static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
171 UserDef *userdef = (UserDef*)ptr->data;
172 int required_size = userdef->v2d_min_gridsize;
174 /* set the timecode style */
175 userdef->timecode_style= value;
177 /* adjust the v2d gridsize if needed so that timecodes don't overlap
178 * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
179 * things from getting too blown out
182 case USER_TIMECODE_MINIMAL:
183 case USER_TIMECODE_SECONDS_ONLY:
184 /* 35 is great most of the time, but not that great for full-blown */
187 case USER_TIMECODE_SMPTE_MSF:
190 case USER_TIMECODE_SMPTE_FULL:
191 /* the granddaddy! */
194 case USER_TIMECODE_MILLISECONDS:
199 if (U.v2d_min_gridsize < required_size)
200 U.v2d_min_gridsize= required_size;
203 static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
205 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesView, ptr->data);
208 static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
210 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
213 static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
215 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data);
218 static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
220 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
223 static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
225 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
228 static void rna_UserDef_audio_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
233 static void rna_Userdef_memcache_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
235 MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
238 static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
242 vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
244 for(ob= bmain->object.first; ob; ob= ob->id.next) {
245 if(ob->mode & OB_MODE_WEIGHT_PAINT)
246 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
249 rna_userdef_update(bmain, scene, ptr);
252 static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
254 /* if all lights are off gpu_draw resets them all, [#27627]
255 * so disallow them all to be disabled */
256 if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
257 SolidLight *light= ptr->data;
261 WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
262 rna_userdef_update(bmain, scene, ptr);
265 static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
267 wmWindowManager *wm= bmain->wm.first;
270 WM_autosave_init(wm);
271 rna_userdef_update(bmain, scene, ptr);
274 static bAddon *rna_userdef_addon_new(void)
276 bAddon *bext= MEM_callocN(sizeof(bAddon), "bAddon");
277 BLI_addtail(&U.addons, bext);
281 static void rna_userdef_addon_remove(bAddon *bext)
283 BLI_freelinkN(&U.addons, bext);
286 static void rna_userdef_temp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
288 extern char btempdir[];
289 BLI_where_is_temp(btempdir, FILE_MAX, 1);
292 static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
295 WM_main_add_notifier(NC_WINDOW, NULL);
300 static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
305 static EnumPropertyItem font_kerning_style[] = {
306 {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"},
307 {1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
308 {0, NULL, 0, NULL, NULL}};
310 srna= RNA_def_struct(brna, "ThemeFontStyle", NULL);
311 RNA_def_struct_sdna(srna, "uiFontStyle");
312 RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
314 prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE);
315 RNA_def_property_range(prop, 6, 48);
316 RNA_def_property_ui_text(prop, "Points", "");
317 RNA_def_property_update(prop, 0, "rna_userdef_update");
319 prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE);
320 RNA_def_property_enum_sdna(prop, NULL, "kerning");
321 RNA_def_property_enum_items(prop, font_kerning_style);
322 RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning");
323 RNA_def_property_update(prop, 0, "rna_userdef_update");
325 prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
326 RNA_def_property_range(prop, 0, 5);
327 RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)");
328 RNA_def_property_update(prop, 0, "rna_userdef_update");
330 prop= RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_NONE);
331 RNA_def_property_int_sdna(prop, NULL, "shadx");
332 RNA_def_property_range(prop, -10, 10);
333 RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
334 RNA_def_property_update(prop, 0, "rna_userdef_update");
336 prop= RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
337 RNA_def_property_int_sdna(prop, NULL, "shady");
338 RNA_def_property_range(prop, -10, 10);
339 RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
340 RNA_def_property_update(prop, 0, "rna_userdef_update");
342 prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
343 RNA_def_property_range(prop, 0.0f, 1.0f);
344 RNA_def_property_ui_text(prop, "Shadow Alpha", "");
345 RNA_def_property_update(prop, 0, "rna_userdef_update");
347 prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
348 RNA_def_property_range(prop, 0.0f, 1.0f);
349 RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
350 RNA_def_property_update(prop, 0, "rna_userdef_update");
353 static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
358 rna_def_userdef_theme_ui_font_style(brna);
360 srna= RNA_def_struct(brna, "ThemeStyle", NULL);
361 RNA_def_struct_sdna(srna, "uiStyle");
362 RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
365 prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
366 RNA_def_property_range(prop, 0.5, 2.0);
367 RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
369 prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
370 RNA_def_property_flag(prop, PROP_NEVER_NULL);
371 RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
372 RNA_def_property_struct_type(prop, "ThemeFontStyle");
373 RNA_def_property_ui_text(prop, "Panel Style", "");
374 RNA_def_property_update(prop, 0, "rna_userdef_update");
376 prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
377 RNA_def_property_flag(prop, PROP_NEVER_NULL);
378 RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
379 RNA_def_property_struct_type(prop, "ThemeFontStyle");
380 RNA_def_property_ui_text(prop, "Group Label Font", "");
381 RNA_def_property_update(prop, 0, "rna_userdef_update");
383 prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
384 RNA_def_property_flag(prop, PROP_NEVER_NULL);
385 RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
386 RNA_def_property_struct_type(prop, "ThemeFontStyle");
387 RNA_def_property_ui_text(prop, "Widget Label Style", "");
388 RNA_def_property_update(prop, 0, "rna_userdef_update");
390 prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
391 RNA_def_property_flag(prop, PROP_NEVER_NULL);
392 RNA_def_property_pointer_sdna(prop, NULL, "widget");
393 RNA_def_property_struct_type(prop, "ThemeFontStyle");
394 RNA_def_property_ui_text(prop, "Widget Style", "");
395 RNA_def_property_update(prop, 0, "rna_userdef_update");
399 static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
404 srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL);
405 RNA_def_struct_sdna(srna, "uiWidgetColors");
406 RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
408 prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
409 RNA_def_property_array(prop, 3);
410 RNA_def_property_ui_text(prop, "Outline", "");
411 RNA_def_property_update(prop, 0, "rna_userdef_update");
413 prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
414 RNA_def_property_array(prop, 4);
415 RNA_def_property_ui_text(prop, "Inner", "");
416 RNA_def_property_update(prop, 0, "rna_userdef_update");
418 prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
419 RNA_def_property_array(prop, 4);
420 RNA_def_property_ui_text(prop, "Inner Selected", "");
421 RNA_def_property_update(prop, 0, "rna_userdef_update");
423 prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
424 RNA_def_property_array(prop, 4);
425 RNA_def_property_ui_text(prop, "Item", "");
426 RNA_def_property_update(prop, 0, "rna_userdef_update");
428 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
429 RNA_def_property_array(prop, 3);
430 RNA_def_property_ui_text(prop, "Text", "");
431 RNA_def_property_update(prop, 0, "rna_userdef_update");
433 prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
434 RNA_def_property_array(prop, 3);
435 RNA_def_property_ui_text(prop, "Text Selected", "");
436 RNA_def_property_update(prop, 0, "rna_userdef_update");
438 prop= RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
439 RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
440 RNA_def_property_ui_text(prop, "Shaded", "");
441 RNA_def_property_update(prop, 0, "rna_userdef_update");
443 prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
444 RNA_def_property_range(prop, -100, 100);
445 RNA_def_property_ui_text(prop, "Shade Top", "");
446 RNA_def_property_update(prop, 0, "rna_userdef_update");
448 prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
449 RNA_def_property_range(prop, -100, 100);
450 RNA_def_property_ui_text(prop, "Shade Down", "");
451 RNA_def_property_update(prop, 0, "rna_userdef_update");
454 static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
459 srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
460 RNA_def_struct_sdna(srna, "uiWidgetStateColors");
461 RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors");
463 prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
464 RNA_def_property_array(prop, 3);
465 RNA_def_property_ui_text(prop, "Animated", "");
466 RNA_def_property_update(prop, 0, "rna_userdef_update");
468 prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
469 RNA_def_property_array(prop, 3);
470 RNA_def_property_ui_text(prop, "Animated Selected", "");
471 RNA_def_property_update(prop, 0, "rna_userdef_update");
473 prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
474 RNA_def_property_array(prop, 3);
475 RNA_def_property_ui_text(prop, "Keyframe", "");
476 RNA_def_property_update(prop, 0, "rna_userdef_update");
478 prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
479 RNA_def_property_array(prop, 3);
480 RNA_def_property_ui_text(prop, "Keyframe Selected", "");
481 RNA_def_property_update(prop, 0, "rna_userdef_update");
483 prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
484 RNA_def_property_array(prop, 3);
485 RNA_def_property_ui_text(prop, "Driven", "");
486 RNA_def_property_update(prop, 0, "rna_userdef_update");
488 prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
489 RNA_def_property_array(prop, 3);
490 RNA_def_property_ui_text(prop, "Driven Selected", "");
491 RNA_def_property_update(prop, 0, "rna_userdef_update");
493 prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
494 RNA_def_property_ui_text(prop, "Blend", "");
495 RNA_def_property_update(prop, 0, "rna_userdef_update");
498 static void rna_def_userdef_theme_ui(BlenderRNA *brna)
503 rna_def_userdef_theme_ui_wcol(brna);
504 rna_def_userdef_theme_ui_wcol_state(brna);
506 srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
507 RNA_def_struct_sdna(srna, "ThemeUI");
508 RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements");
510 prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
511 RNA_def_property_flag(prop, PROP_NEVER_NULL);
512 RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
513 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
514 RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
515 RNA_def_property_update(prop, 0, "rna_userdef_update");
517 prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
518 RNA_def_property_flag(prop, PROP_NEVER_NULL);
519 RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
520 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
521 RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
522 RNA_def_property_update(prop, 0, "rna_userdef_update");
524 prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
525 RNA_def_property_flag(prop, PROP_NEVER_NULL);
526 RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
527 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
528 RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
529 RNA_def_property_update(prop, 0, "rna_userdef_update");
531 prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
532 RNA_def_property_flag(prop, PROP_NEVER_NULL);
533 RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
534 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
535 RNA_def_property_ui_text(prop, "Text Widget Colors", "");
536 RNA_def_property_update(prop, 0, "rna_userdef_update");
538 prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
539 RNA_def_property_flag(prop, PROP_NEVER_NULL);
540 RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
541 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
542 RNA_def_property_ui_text(prop, "Option Widget Colors", "");
543 RNA_def_property_update(prop, 0, "rna_userdef_update");
545 prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
546 RNA_def_property_flag(prop, PROP_NEVER_NULL);
547 RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
548 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
549 RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
550 RNA_def_property_update(prop, 0, "rna_userdef_update");
552 prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
553 RNA_def_property_flag(prop, PROP_NEVER_NULL);
554 RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
555 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
556 RNA_def_property_ui_text(prop, "Number Widget Colors", "");
557 RNA_def_property_update(prop, 0, "rna_userdef_update");
559 prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
560 RNA_def_property_flag(prop, PROP_NEVER_NULL);
561 RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
562 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
563 RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
564 RNA_def_property_update(prop, 0, "rna_userdef_update");
566 prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
567 RNA_def_property_flag(prop, PROP_NEVER_NULL);
568 RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
569 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
570 RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
571 RNA_def_property_update(prop, 0, "rna_userdef_update");
573 prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
574 RNA_def_property_flag(prop, PROP_NEVER_NULL);
575 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
576 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
577 RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
578 RNA_def_property_update(prop, 0, "rna_userdef_update");
580 prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
581 RNA_def_property_flag(prop, PROP_NEVER_NULL);
582 RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
583 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
584 RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
585 RNA_def_property_update(prop, 0, "rna_userdef_update");
587 prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
588 RNA_def_property_flag(prop, PROP_NEVER_NULL);
589 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
590 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
591 RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
592 RNA_def_property_update(prop, 0, "rna_userdef_update");
594 prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
595 RNA_def_property_flag(prop, PROP_NEVER_NULL);
596 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
597 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
598 RNA_def_property_ui_text(prop, "Menu Item Colors", "");
599 RNA_def_property_update(prop, 0, "rna_userdef_update");
601 prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
602 RNA_def_property_flag(prop, PROP_NEVER_NULL);
603 RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
604 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
605 RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
606 RNA_def_property_update(prop, 0, "rna_userdef_update");
608 prop= RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
609 RNA_def_property_flag(prop, PROP_NEVER_NULL);
610 RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress");
611 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
612 RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
613 RNA_def_property_update(prop, 0, "rna_userdef_update");
615 prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
616 RNA_def_property_flag(prop, PROP_NEVER_NULL);
617 RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
618 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
619 RNA_def_property_ui_text(prop, "List Item Colors", "");
620 RNA_def_property_update(prop, 0, "rna_userdef_update");
622 prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
623 RNA_def_property_flag(prop, PROP_NEVER_NULL);
624 RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
625 RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
626 RNA_def_property_ui_text(prop, "State Colors", "");
627 RNA_def_property_update(prop, 0, "rna_userdef_update");
629 prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
630 RNA_def_property_string_sdna(prop, NULL, "iconfile");
631 RNA_def_property_ui_text(prop, "Icon File", "");
632 RNA_def_property_update(prop, 0, "rna_userdef_update");
635 static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype)
640 prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
641 RNA_def_property_array(prop, 3);
642 RNA_def_property_ui_text(prop, "Window Background", "");
643 RNA_def_property_update(prop, 0, "rna_userdef_update");
645 prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
646 RNA_def_property_array(prop, 3);
647 RNA_def_property_ui_text(prop, "Title", "");
648 RNA_def_property_update(prop, 0, "rna_userdef_update");
650 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
651 RNA_def_property_array(prop, 3);
652 RNA_def_property_ui_text(prop, "Text", "");
653 RNA_def_property_update(prop, 0, "rna_userdef_update");
655 prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
656 RNA_def_property_array(prop, 3);
657 RNA_def_property_ui_text(prop, "Text Highlight", "");
658 RNA_def_property_update(prop, 0, "rna_userdef_update");
661 prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
662 RNA_def_property_array(prop, 3);
663 RNA_def_property_ui_text(prop, "Header", "");
664 RNA_def_property_update(prop, 0, "rna_userdef_update");
666 prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
667 RNA_def_property_array(prop, 3);
668 RNA_def_property_ui_text(prop, "Header Text", "");
669 RNA_def_property_update(prop, 0, "rna_userdef_update");
671 prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
672 RNA_def_property_array(prop, 3);
673 RNA_def_property_ui_text(prop, "Header Text Highlight", "");
674 RNA_def_property_update(prop, 0, "rna_userdef_update");
677 // if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) {
678 prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
679 RNA_def_property_array(prop, 3);
680 RNA_def_property_ui_text(prop, "Region Background", "");
681 RNA_def_property_update(prop, 0, "rna_userdef_update");
683 prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA);
684 RNA_def_property_array(prop, 3);
685 RNA_def_property_ui_text(prop, "Region Text Titles", "");
686 RNA_def_property_update(prop, 0, "rna_userdef_update");
688 prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA);
689 RNA_def_property_array(prop, 3);
690 RNA_def_property_ui_text(prop, "Region Text", "");
691 RNA_def_property_update(prop, 0, "rna_userdef_update");
693 prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
694 RNA_def_property_array(prop, 3);
695 RNA_def_property_ui_text(prop, "Region Text Highlight", "");
696 RNA_def_property_update(prop, 0, "rna_userdef_update");
700 if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) {
701 prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA);
702 RNA_def_property_array(prop, 3);
703 RNA_def_property_ui_text(prop, "Source List", "");
704 RNA_def_property_update(prop, 0, "rna_userdef_update");
706 prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA);
707 RNA_def_property_array(prop, 3);
708 RNA_def_property_ui_text(prop, "Source List Title", "");
709 RNA_def_property_update(prop, 0, "rna_userdef_update");
711 prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA);
712 RNA_def_property_array(prop, 3);
713 RNA_def_property_ui_text(prop, "Source List Text", "");
714 RNA_def_property_update(prop, 0, "rna_userdef_update");
716 prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
717 RNA_def_property_array(prop, 3);
718 RNA_def_property_ui_text(prop, "Source List Text Highlight", "");
719 RNA_def_property_update(prop, 0, "rna_userdef_update");
723 static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna)
727 prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
728 RNA_def_property_array(prop, 3);
729 RNA_def_property_ui_text(prop, "Vertex", "");
730 RNA_def_property_update(prop, 0, "rna_userdef_update");
732 prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
733 RNA_def_property_array(prop, 3);
734 RNA_def_property_ui_text(prop, "Vertex Select", "");
735 RNA_def_property_update(prop, 0, "rna_userdef_update");
737 prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
738 RNA_def_property_range(prop, 1, 10);
739 RNA_def_property_ui_text(prop, "Vertex Size", "");
740 RNA_def_property_update(prop, 0, "rna_userdef_update");
743 static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
747 prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
748 RNA_def_property_array(prop, 3);
749 RNA_def_property_ui_text(prop, "Edge Select", "");
750 RNA_def_property_update(prop, 0, "rna_userdef_update");
752 prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR_GAMMA);
753 RNA_def_property_array(prop, 3);
754 RNA_def_property_ui_text(prop, "Edge Seam", "");
755 RNA_def_property_update(prop, 0, "rna_userdef_update");
757 prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
758 RNA_def_property_array(prop, 3);
759 RNA_def_property_ui_text(prop, "Edge Sharp", "");
760 RNA_def_property_update(prop, 0, "rna_userdef_update");
762 prop= RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR_GAMMA);
763 RNA_def_property_array(prop, 3);
764 RNA_def_property_ui_text(prop, "Edge Crease", "");
765 RNA_def_property_update(prop, 0, "rna_userdef_update");
767 prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR_GAMMA);
768 RNA_def_property_array(prop, 3);
769 RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
770 RNA_def_property_update(prop, 0, "rna_userdef_update");
773 static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
777 prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
778 RNA_def_property_array(prop, 4);
779 RNA_def_property_ui_text(prop, "Face", "");
780 RNA_def_property_update(prop, 0, "rna_userdef_update");
782 prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
783 RNA_def_property_array(prop, 4);
784 RNA_def_property_ui_text(prop, "Face Selected", "");
785 RNA_def_property_update(prop, 0, "rna_userdef_update");
787 prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR_GAMMA);
788 RNA_def_property_array(prop, 3);
789 RNA_def_property_ui_text(prop, "Face Dot Selected", "");
790 RNA_def_property_update(prop, 0, "rna_userdef_update");
792 prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
793 RNA_def_property_range(prop, 1, 10);
794 RNA_def_property_ui_text(prop, "Face Dot Size", "");
795 RNA_def_property_update(prop, 0, "rna_userdef_update");
798 static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurbs)
803 prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
804 RNA_def_property_float_sdna(prop, NULL, "nurb_uline");
805 RNA_def_property_array(prop, 3);
806 RNA_def_property_ui_text(prop, "Nurb U-lines", "");
807 RNA_def_property_update(prop, 0, "rna_userdef_update");
809 prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
810 RNA_def_property_float_sdna(prop, NULL, "nurb_vline");
811 RNA_def_property_array(prop, 3);
812 RNA_def_property_ui_text(prop, "Nurb V-lines", "");
813 RNA_def_property_update(prop, 0, "rna_userdef_update");
815 prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
816 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline");
817 RNA_def_property_array(prop, 3);
818 RNA_def_property_ui_text(prop, "Nurb active U-lines", "");
819 RNA_def_property_update(prop, 0, "rna_userdef_update");
821 prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
822 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline");
823 RNA_def_property_array(prop, 3);
824 RNA_def_property_ui_text(prop, "Nurb active V-lines", "");
825 RNA_def_property_update(prop, 0, "rna_userdef_update");
827 prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR_GAMMA);
828 RNA_def_property_float_sdna(prop, NULL, "act_spline");
829 RNA_def_property_array(prop, 3);
830 RNA_def_property_ui_text(prop, "Active spline", "");
831 RNA_def_property_update(prop, 0, "rna_userdef_update");
834 prop= RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
835 RNA_def_property_float_sdna(prop, NULL, "handle_free");
836 RNA_def_property_array(prop, 3);
837 RNA_def_property_ui_text(prop, "Free handle color", "");
838 RNA_def_property_update(prop, 0, "rna_userdef_update");
840 prop= RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
841 RNA_def_property_float_sdna(prop, NULL, "handle_auto");
842 RNA_def_property_array(prop, 3);
843 RNA_def_property_ui_text(prop, "Auto handle color", "");
844 RNA_def_property_update(prop, 0, "rna_userdef_update");
846 prop= RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
847 RNA_def_property_float_sdna(prop, NULL, "handle_vect");
848 RNA_def_property_array(prop, 3);
849 RNA_def_property_ui_text(prop, "Vector handle color", "");
850 RNA_def_property_update(prop, 0, "rna_userdef_update");
852 prop= RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
853 RNA_def_property_float_sdna(prop, NULL, "handle_align");
854 RNA_def_property_array(prop, 3);
855 RNA_def_property_ui_text(prop, "Align handle color", "");
856 RNA_def_property_update(prop, 0, "rna_userdef_update");
858 prop= RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
859 RNA_def_property_float_sdna(prop, NULL, "handle_sel_free");
860 RNA_def_property_array(prop, 3);
861 RNA_def_property_ui_text(prop, "Free handle selected color", "");
862 RNA_def_property_update(prop, 0, "rna_userdef_update");
864 prop= RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
865 RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto");
866 RNA_def_property_array(prop, 3);
867 RNA_def_property_ui_text(prop, "Auto handle selected color", "");
868 RNA_def_property_update(prop, 0, "rna_userdef_update");
870 prop= RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
871 RNA_def_property_float_sdna(prop, NULL, "handle_sel_vect");
872 RNA_def_property_array(prop, 3);
873 RNA_def_property_ui_text(prop, "Vector handle selected color", "");
874 RNA_def_property_update(prop, 0, "rna_userdef_update");
876 prop= RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
877 RNA_def_property_float_sdna(prop, NULL, "handle_sel_align");
878 RNA_def_property_array(prop, 3);
879 RNA_def_property_ui_text(prop, "Align handle selected color", "");
880 RNA_def_property_update(prop, 0, "rna_userdef_update");
882 prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR_GAMMA);
883 RNA_def_property_float_sdna(prop, NULL, "lastsel_point");
884 RNA_def_property_array(prop, 3);
885 RNA_def_property_ui_text(prop, "Last selected point", "");
886 RNA_def_property_update(prop, 0, "rna_userdef_update");
889 static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
896 srna= RNA_def_struct(brna, "ThemeView3D", NULL);
897 RNA_def_struct_sdna(srna, "ThemeSpace");
898 RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
900 rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D);
902 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
903 RNA_def_property_array(prop, 3);
904 RNA_def_property_ui_text(prop, "Grid", "");
905 RNA_def_property_update(prop, 0, "rna_userdef_update");
907 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
908 RNA_def_property_array(prop, 4);
909 RNA_def_property_ui_text(prop, "Panel", "");
910 RNA_def_property_update(prop, 0, "rna_userdef_update");
912 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
913 RNA_def_property_array(prop, 3);
914 RNA_def_property_ui_text(prop, "Wire", "");
915 RNA_def_property_update(prop, 0, "rna_userdef_update");
917 prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA);
918 RNA_def_property_array(prop, 4);
919 RNA_def_property_ui_text(prop, "Lamp", "");
920 RNA_def_property_update(prop, 0, "rna_userdef_update");
922 prop= RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
923 RNA_def_property_array(prop, 3);
924 RNA_def_property_ui_text(prop, "Speaker", "");
925 RNA_def_property_update(prop, 0, "rna_userdef_update");
927 prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
928 RNA_def_property_float_sdna(prop, NULL, "select");
929 RNA_def_property_array(prop, 3);
930 RNA_def_property_ui_text(prop, "Object Selected", "");
931 RNA_def_property_update(prop, 0, "rna_userdef_update");
933 prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
934 RNA_def_property_float_sdna(prop, NULL, "active");
935 RNA_def_property_array(prop, 3);
936 RNA_def_property_ui_text(prop, "Active Object", "");
937 RNA_def_property_update(prop, 0, "rna_userdef_update");
939 prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR_GAMMA);
940 RNA_def_property_float_sdna(prop, NULL, "group");
941 RNA_def_property_array(prop, 3);
942 RNA_def_property_ui_text(prop, "Object Grouped", "");
943 RNA_def_property_update(prop, 0, "rna_userdef_update");
945 prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR_GAMMA);
946 RNA_def_property_float_sdna(prop, NULL, "group_active");
947 RNA_def_property_array(prop, 3);
948 RNA_def_property_ui_text(prop, "Object Grouped Active", "");
949 RNA_def_property_update(prop, 0, "rna_userdef_update");
951 prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
952 RNA_def_property_array(prop, 3);
953 RNA_def_property_ui_text(prop, "Transform", "");
954 RNA_def_property_update(prop, 0, "rna_userdef_update");
956 rna_def_userdef_theme_spaces_vertex(srna);
957 rna_def_userdef_theme_spaces_edge(srna);
958 rna_def_userdef_theme_spaces_face(srna);
959 rna_def_userdef_theme_spaces_curves(srna, 1);
961 prop= RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
962 RNA_def_property_array(prop, 3);
963 RNA_def_property_ui_text(prop, "Edge Length Text", "");
964 RNA_def_property_update(prop, 0, "rna_userdef_update");
966 prop= RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
967 RNA_def_property_array(prop, 3);
968 RNA_def_property_ui_text(prop, "Face Angle Text", "");
969 RNA_def_property_update(prop, 0, "rna_userdef_update");
971 prop= RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
972 RNA_def_property_array(prop, 3);
973 RNA_def_property_ui_text(prop, "Face Area Text", "");
974 RNA_def_property_update(prop, 0, "rna_userdef_update");
976 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
977 RNA_def_property_array(prop, 4);
978 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
979 RNA_def_property_update(prop, 0, "rna_userdef_update");
981 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
982 RNA_def_property_array(prop, 3);
983 RNA_def_property_ui_text(prop, "Face Normal", "");
984 RNA_def_property_update(prop, 0, "rna_userdef_update");
986 prop= RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
987 RNA_def_property_array(prop, 3);
988 RNA_def_property_ui_text(prop, "Vertex Normal", "");
989 RNA_def_property_update(prop, 0, "rna_userdef_update");
991 prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
992 RNA_def_property_array(prop, 3);
993 RNA_def_property_ui_text(prop, "Bone Solid", "");
994 RNA_def_property_update(prop, 0, "rna_userdef_update");
996 prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
997 RNA_def_property_array(prop, 3);
998 RNA_def_property_ui_text(prop, "Bone Pose", "");
999 RNA_def_property_update(prop, 0, "rna_userdef_update");
1001 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1002 RNA_def_property_float_sdna(prop, NULL, "cframe");
1003 RNA_def_property_array(prop, 3);
1004 RNA_def_property_ui_text(prop, "Current Frame", "");
1005 RNA_def_property_update(prop, 0, "rna_userdef_update");
1007 prop= RNA_def_property(srna, "outline_width", PROP_INT, PROP_NONE);
1008 RNA_def_property_range(prop, 1, 5);
1009 RNA_def_property_ui_text(prop, "Outline Width", "");
1010 RNA_def_property_update(prop, 0, "rna_userdef_update");
1013 static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
1020 srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
1021 RNA_def_struct_sdna(srna, "ThemeSpace");
1022 RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
1024 rna_def_userdef_theme_spaces_main(srna, SPACE_IPO);
1026 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1027 RNA_def_property_array(prop, 3);
1028 RNA_def_property_ui_text(prop, "Grid", "");
1029 RNA_def_property_update(prop, 0, "rna_userdef_update");
1031 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1032 RNA_def_property_array(prop, 3);
1033 RNA_def_property_ui_text(prop, "Panel", "");
1034 RNA_def_property_update(prop, 0, "rna_userdef_update");
1036 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1037 RNA_def_property_float_sdna(prop, NULL, "shade1");
1038 RNA_def_property_array(prop, 3);
1039 RNA_def_property_ui_text(prop, "Window Sliders", "");
1040 RNA_def_property_update(prop, 0, "rna_userdef_update");
1042 prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR_GAMMA);
1043 RNA_def_property_float_sdna(prop, NULL, "shade2");
1044 RNA_def_property_array(prop, 3);
1045 RNA_def_property_ui_text(prop, "Channels Region", "");
1046 RNA_def_property_update(prop, 0, "rna_userdef_update");
1048 rna_def_userdef_theme_spaces_vertex(srna);
1049 rna_def_userdef_theme_spaces_curves(srna, 0);
1051 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1052 RNA_def_property_float_sdna(prop, NULL, "cframe");
1053 RNA_def_property_array(prop, 3);
1054 RNA_def_property_ui_text(prop, "Current Frame", "");
1055 RNA_def_property_update(prop, 0, "rna_userdef_update");
1057 prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
1058 RNA_def_property_array(prop, 3);
1059 RNA_def_property_ui_text(prop, "Handle Vertex", "");
1060 RNA_def_property_update(prop, 0, "rna_userdef_update");
1062 prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
1063 RNA_def_property_array(prop, 3);
1064 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
1065 RNA_def_property_update(prop, 0, "rna_userdef_update");
1067 prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
1068 RNA_def_property_range(prop, 0, 255);
1069 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
1070 RNA_def_property_update(prop, 0, "rna_userdef_update");
1072 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1073 RNA_def_property_float_sdna(prop, NULL, "group");
1074 RNA_def_property_array(prop, 3);
1075 RNA_def_property_ui_text(prop, "Channel Group", "");
1076 RNA_def_property_update(prop, 0, "rna_userdef_update");
1078 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1079 RNA_def_property_float_sdna(prop, NULL, "group_active");
1080 RNA_def_property_array(prop, 3);
1081 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1082 RNA_def_property_update(prop, 0, "rna_userdef_update");
1084 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
1085 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1086 RNA_def_property_array(prop, 3);
1087 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1088 RNA_def_property_update(prop, 0, "rna_userdef_update");
1090 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
1091 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1092 RNA_def_property_array(prop, 3);
1093 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1094 RNA_def_property_update(prop, 0, "rna_userdef_update");
1097 static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
1104 srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL);
1105 RNA_def_struct_sdna(srna, "ThemeSpace");
1106 RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
1108 rna_def_userdef_theme_spaces_main(srna, SPACE_FILE);
1110 prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA);
1111 RNA_def_property_float_sdna(prop, NULL, "hilite");
1112 RNA_def_property_array(prop, 3);
1113 RNA_def_property_ui_text(prop, "Selected File", "");
1114 RNA_def_property_update(prop, 0, "rna_userdef_update");
1116 prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR_GAMMA);
1117 RNA_def_property_float_sdna(prop, NULL, "panel");
1118 RNA_def_property_array(prop, 3);
1119 RNA_def_property_ui_text(prop, "Tiles", "");
1120 RNA_def_property_update(prop, 0, "rna_userdef_update");
1122 prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR_GAMMA);
1123 RNA_def_property_float_sdna(prop, NULL, "shade1");
1124 RNA_def_property_array(prop, 3);
1125 RNA_def_property_ui_text(prop, "Scrollbar", "");
1126 RNA_def_property_update(prop, 0, "rna_userdef_update");
1128 prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR_GAMMA);
1129 RNA_def_property_float_sdna(prop, NULL, "shade2");
1130 RNA_def_property_array(prop, 3);
1131 RNA_def_property_ui_text(prop, "Scroll Handle", "");
1132 RNA_def_property_update(prop, 0, "rna_userdef_update");
1134 prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR_GAMMA);
1135 RNA_def_property_float_sdna(prop, NULL, "active");
1136 RNA_def_property_array(prop, 3);
1137 RNA_def_property_ui_text(prop, "Active File", "");
1138 RNA_def_property_update(prop, 0, "rna_userdef_update");
1140 prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1141 RNA_def_property_float_sdna(prop, NULL, "grid");
1142 RNA_def_property_array(prop, 3);
1143 RNA_def_property_ui_text(prop, "Active File Text", "");
1144 RNA_def_property_update(prop, 0, "rna_userdef_update");
1147 static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
1151 /* space_outliner */
1153 srna= RNA_def_struct(brna, "ThemeOutliner", NULL);
1154 RNA_def_struct_sdna(srna, "ThemeSpace");
1155 RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
1157 rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER);
1160 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
1164 /* space_userpref */
1166 srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
1167 RNA_def_struct_sdna(srna, "ThemeSpace");
1168 RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
1170 rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
1173 static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
1180 srna= RNA_def_struct(brna, "ThemeConsole", NULL);
1181 RNA_def_struct_sdna(srna, "ThemeSpace");
1182 RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
1184 rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE);
1186 prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
1187 RNA_def_property_float_sdna(prop, NULL, "console_output");
1188 RNA_def_property_array(prop, 3);
1189 RNA_def_property_ui_text(prop, "Line Output", "");
1190 RNA_def_property_update(prop, 0, "rna_userdef_update");
1192 prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
1193 RNA_def_property_float_sdna(prop, NULL, "console_input");
1194 RNA_def_property_array(prop, 3);
1195 RNA_def_property_ui_text(prop, "Line Input", "");
1196 RNA_def_property_update(prop, 0, "rna_userdef_update");
1198 prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
1199 RNA_def_property_float_sdna(prop, NULL, "console_info");
1200 RNA_def_property_array(prop, 3);
1201 RNA_def_property_ui_text(prop, "Line Info", "");
1202 RNA_def_property_update(prop, 0, "rna_userdef_update");
1204 prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
1205 RNA_def_property_float_sdna(prop, NULL, "console_error");
1206 RNA_def_property_array(prop, 3);
1207 RNA_def_property_ui_text(prop, "Line Error", "");
1208 RNA_def_property_update(prop, 0, "rna_userdef_update");
1210 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
1211 RNA_def_property_float_sdna(prop, NULL, "console_cursor");
1212 RNA_def_property_array(prop, 3);
1213 RNA_def_property_ui_text(prop, "Cursor", "");
1214 RNA_def_property_update(prop, 0, "rna_userdef_update");
1217 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
1223 srna= RNA_def_struct(brna, "ThemeInfo", NULL);
1224 RNA_def_struct_sdna(srna, "ThemeSpace");
1225 RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
1227 rna_def_userdef_theme_spaces_main(srna, SPACE_INFO);
1231 static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
1238 srna= RNA_def_struct(brna, "ThemeTextEditor", NULL);
1239 RNA_def_struct_sdna(srna, "ThemeSpace");
1240 RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
1242 rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT);
1244 prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
1245 RNA_def_property_float_sdna(prop, NULL, "grid");
1246 RNA_def_property_array(prop, 3);
1247 RNA_def_property_ui_text(prop, "Line Numbers Background", "");
1248 RNA_def_property_update(prop, 0, "rna_userdef_update");
1250 prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
1251 RNA_def_property_float_sdna(prop, NULL, "shade1");
1252 RNA_def_property_array(prop, 3);
1253 RNA_def_property_ui_text(prop, "Scroll Bar", "");
1254 RNA_def_property_update(prop, 0, "rna_userdef_update");
1256 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1257 RNA_def_property_float_sdna(prop, NULL, "shade2");
1258 RNA_def_property_array(prop, 3);
1259 RNA_def_property_ui_text(prop, "Selected Text", "");
1260 RNA_def_property_update(prop, 0, "rna_userdef_update");
1262 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
1263 RNA_def_property_float_sdna(prop, NULL, "hilite");
1264 RNA_def_property_array(prop, 3);
1265 RNA_def_property_ui_text(prop, "Cursor", "");
1266 RNA_def_property_update(prop, 0, "rna_userdef_update");
1268 prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
1269 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1270 RNA_def_property_array(prop, 3);
1271 RNA_def_property_ui_text(prop, "Syntax Built-in", "");
1272 RNA_def_property_update(prop, 0, "rna_userdef_update");
1274 prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
1275 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1276 RNA_def_property_array(prop, 3);
1277 RNA_def_property_ui_text(prop, "Syntax Special", "");
1278 RNA_def_property_update(prop, 0, "rna_userdef_update");
1280 prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
1281 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1282 RNA_def_property_array(prop, 3);
1283 RNA_def_property_ui_text(prop, "Syntax Comment", "");
1284 RNA_def_property_update(prop, 0, "rna_userdef_update");
1286 prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
1287 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1288 RNA_def_property_array(prop, 3);
1289 RNA_def_property_ui_text(prop, "Syntax String", "");
1290 RNA_def_property_update(prop, 0, "rna_userdef_update");
1292 prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
1293 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1294 RNA_def_property_array(prop, 3);
1295 RNA_def_property_ui_text(prop, "Syntax Numbers", "");
1296 RNA_def_property_update(prop, 0, "rna_userdef_update");
1299 static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
1306 srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL);
1307 RNA_def_struct_sdna(srna, "ThemeSpace");
1308 RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
1310 rna_def_userdef_theme_spaces_main(srna, SPACE_NODE);
1312 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
1313 RNA_def_property_float_sdna(prop, NULL, "wire");
1314 RNA_def_property_array(prop, 3);
1315 RNA_def_property_ui_text(prop, "Wires", "");
1316 RNA_def_property_update(prop, 0, "rna_userdef_update");
1318 prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
1319 RNA_def_property_float_sdna(prop, NULL, "edge_select");
1320 RNA_def_property_array(prop, 3);
1321 RNA_def_property_ui_text(prop, "Wire Select", "");
1322 RNA_def_property_update(prop, 0, "rna_userdef_update");
1324 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1325 RNA_def_property_float_sdna(prop, NULL, "shade2");
1326 RNA_def_property_array(prop, 3);
1327 RNA_def_property_ui_text(prop, "Selected Text", "");
1328 RNA_def_property_update(prop, 0, "rna_userdef_update");
1330 prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
1331 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1332 RNA_def_property_array(prop, 4);
1333 RNA_def_property_ui_text(prop, "Node Backdrop", "");
1334 RNA_def_property_update(prop, 0, "rna_userdef_update");
1336 prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1337 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1338 RNA_def_property_array(prop, 3);
1339 RNA_def_property_ui_text(prop, "In/Out Node", "");
1340 RNA_def_property_update(prop, 0, "rna_userdef_update");
1342 prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1343 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1344 RNA_def_property_array(prop, 3);
1345 RNA_def_property_ui_text(prop, "Converter Node", "");
1346 RNA_def_property_update(prop, 0, "rna_userdef_update");
1348 prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1349 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1350 RNA_def_property_array(prop, 3);
1351 RNA_def_property_ui_text(prop, "Operator Node", "");
1352 RNA_def_property_update(prop, 0, "rna_userdef_update");
1354 prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1355 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1356 RNA_def_property_array(prop, 3);
1357 RNA_def_property_ui_text(prop, "Group Node", "");
1358 RNA_def_property_update(prop, 0, "rna_userdef_update");
1361 static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
1368 srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL);
1369 RNA_def_struct_sdna(srna, "ThemeSpace");
1370 RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor");
1372 rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC);
1374 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1375 RNA_def_property_array(prop, 3);
1376 RNA_def_property_ui_text(prop, "Panel", "");
1377 RNA_def_property_update(prop, 0, "rna_userdef_update");
1381 static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
1388 srna= RNA_def_struct(brna, "ThemeProperties", NULL);
1389 RNA_def_struct_sdna(srna, "ThemeSpace");
1390 RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
1392 rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS);
1394 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1395 RNA_def_property_array(prop, 3);
1396 RNA_def_property_ui_text(prop, "Panel", "");
1397 RNA_def_property_update(prop, 0, "rna_userdef_update");
1400 static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
1407 srna= RNA_def_struct(brna, "ThemeTimeline", NULL);
1408 RNA_def_struct_sdna(srna, "ThemeSpace");
1409 RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline");
1411 rna_def_userdef_theme_spaces_main(srna, SPACE_TIME);
1413 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1414 RNA_def_property_array(prop, 3);
1415 RNA_def_property_ui_text(prop, "Grid", "");
1416 RNA_def_property_update(prop, 0, "rna_userdef_update");
1418 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1419 RNA_def_property_float_sdna(prop, NULL, "cframe");
1420 RNA_def_property_array(prop, 3);
1421 RNA_def_property_ui_text(prop, "Current Frame", "");
1422 RNA_def_property_update(prop, 0, "rna_userdef_update");
1425 static void rna_def_userdef_theme_space_sound(BlenderRNA *brna)
1432 srna= RNA_def_struct(brna, "ThemeAudioWindow", NULL);
1433 RNA_def_struct_sdna(srna, "ThemeSpace");
1434 RNA_def_struct_ui_text(srna, "Theme Audio Window", "Theme settings for the Audio Window");
1436 rna_def_userdef_theme_spaces_main(srna, SPACE_SOUND);
1438 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1439 RNA_def_property_array(prop, 3);
1440 RNA_def_property_ui_text(prop, "Grid", "");
1441 RNA_def_property_update(prop, 0, "rna_userdef_update");
1443 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1444 RNA_def_property_float_sdna(prop, NULL, "shade1");
1445 RNA_def_property_array(prop, 3);
1446 RNA_def_property_ui_text(prop, "Window Sliders", "");
1447 RNA_def_property_update(prop, 0, "rna_userdef_update");
1449 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1450 RNA_def_property_float_sdna(prop, NULL, "cframe");
1451 RNA_def_property_array(prop, 3);
1452 RNA_def_property_ui_text(prop, "Current Frame", "");
1453 RNA_def_property_update(prop, 0, "rna_userdef_update");
1456 static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
1463 srna= RNA_def_struct(brna, "ThemeImageEditor", NULL);
1464 RNA_def_struct_sdna(srna, "ThemeSpace");
1465 RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
1467 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1468 rna_def_userdef_theme_spaces_vertex(srna);
1469 rna_def_userdef_theme_spaces_face(srna);
1471 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
1472 RNA_def_property_array(prop, 4);
1473 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
1474 RNA_def_property_update(prop, 0, "rna_userdef_update");
1476 prop= RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
1477 RNA_def_property_float_sdna(prop, NULL, "preview_back");
1478 RNA_def_property_array(prop, 4);
1479 RNA_def_property_ui_text(prop, "Scope region background color", "");
1480 RNA_def_property_update(prop, 0, "rna_userdef_update");
1483 static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
1490 srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
1491 RNA_def_struct_sdna(srna, "ThemeSpace");
1492 RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
1494 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1496 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1497 RNA_def_property_array(prop, 3);
1498 RNA_def_property_ui_text(prop, "Grid", "");
1499 RNA_def_property_update(prop, 0, "rna_userdef_update");
1501 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1502 RNA_def_property_float_sdna(prop, NULL, "shade1");
1503 RNA_def_property_array(prop, 3);
1504 RNA_def_property_ui_text(prop, "Window Sliders", "");
1505 RNA_def_property_update(prop, 0, "rna_userdef_update");
1507 prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1508 RNA_def_property_float_sdna(prop, NULL, "movie");
1509 RNA_def_property_array(prop, 3);
1510 RNA_def_property_ui_text(prop, "Movie Strip", "");
1511 RNA_def_property_update(prop, 0, "rna_userdef_update");
1513 prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1514 RNA_def_property_float_sdna(prop, NULL, "image");
1515 RNA_def_property_array(prop, 3);
1516 RNA_def_property_ui_text(prop, "Image Strip", "");
1517 RNA_def_property_update(prop, 0, "rna_userdef_update");
1519 prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1520 RNA_def_property_float_sdna(prop, NULL, "scene");
1521 RNA_def_property_array(prop, 3);
1522 RNA_def_property_ui_text(prop, "Scene Strip", "");
1523 RNA_def_property_update(prop, 0, "rna_userdef_update");
1525 prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1526 RNA_def_property_float_sdna(prop, NULL, "audio");
1527 RNA_def_property_array(prop, 3);
1528 RNA_def_property_ui_text(prop, "Audio Strip", "");
1529 RNA_def_property_update(prop, 0, "rna_userdef_update");
1531 prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1532 RNA_def_property_float_sdna(prop, NULL, "effect");
1533 RNA_def_property_array(prop, 3);
1534 RNA_def_property_ui_text(prop, "Effect Strip", "");
1535 RNA_def_property_update(prop, 0, "rna_userdef_update");
1537 prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1538 RNA_def_property_float_sdna(prop, NULL, "plugin");
1539 RNA_def_property_array(prop, 3);
1540 RNA_def_property_ui_text(prop, "Plugin Strip", "");
1541 RNA_def_property_update(prop, 0, "rna_userdef_update");
1543 prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1544 RNA_def_property_float_sdna(prop, NULL, "transition");
1545 RNA_def_property_array(prop, 3);
1546 RNA_def_property_ui_text(prop, "Transition Strip", "");
1547 RNA_def_property_update(prop, 0, "rna_userdef_update");
1549 prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1550 RNA_def_property_float_sdna(prop, NULL, "meta");
1551 RNA_def_property_array(prop, 3);
1552 RNA_def_property_ui_text(prop, "Meta Strip", "");
1553 RNA_def_property_update(prop, 0, "rna_userdef_update");
1555 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1556 RNA_def_property_float_sdna(prop, NULL, "cframe");
1557 RNA_def_property_array(prop, 3);
1558 RNA_def_property_ui_text(prop, "Current Frame", "");
1559 RNA_def_property_update(prop, 0, "rna_userdef_update");
1561 prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
1562 RNA_def_property_float_sdna(prop, NULL, "vertex_select");
1563 RNA_def_property_array(prop, 3);
1564 RNA_def_property_ui_text(prop, "Keyframe", "");
1565 RNA_def_property_update(prop, 0, "rna_userdef_update");
1567 prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR_GAMMA);
1568 RNA_def_property_float_sdna(prop, NULL, "bone_pose");
1569 RNA_def_property_array(prop, 3);
1570 RNA_def_property_ui_text(prop, "Draw Action", "");
1571 RNA_def_property_update(prop, 0, "rna_userdef_update");
1574 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
1581 srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL);
1582 RNA_def_struct_sdna(srna, "ThemeSpace");
1583 RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet");
1585 rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION);
1587 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1588 RNA_def_property_array(prop, 3);
1589 RNA_def_property_ui_text(prop, "Grid", "");
1590 RNA_def_property_update(prop, 0, "rna_userdef_update");
1592 prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1593 RNA_def_property_float_sdna(prop, NULL, "face");
1594 RNA_def_property_array(prop, 3);
1595 RNA_def_property_ui_text(prop, "Value Sliders", "");
1596 RNA_def_property_update(prop, 0, "rna_userdef_update");
1598 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1599 RNA_def_property_float_sdna(prop, NULL, "shade1");
1600 RNA_def_property_array(prop, 3);
1601 RNA_def_property_ui_text(prop, "View Sliders", "");
1602 RNA_def_property_update(prop, 0, "rna_userdef_update");
1604 prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
1605 RNA_def_property_float_sdna(prop, NULL, "shade2");
1606 RNA_def_property_array(prop, 3);
1607 RNA_def_property_ui_text(prop, "Channels", "");
1608 RNA_def_property_update(prop, 0, "rna_userdef_update");
1610 prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1611 RNA_def_property_float_sdna(prop, NULL, "hilite");
1612 RNA_def_property_array(prop, 3);
1613 RNA_def_property_ui_text(prop, "Channels Selected", "");
1614 RNA_def_property_update(prop, 0, "rna_userdef_update");
1616 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1617 RNA_def_property_float_sdna(prop, NULL, "group");
1618 RNA_def_property_array(prop, 3);
1619 RNA_def_property_ui_text(prop, "Channel Group", "");
1620 RNA_def_property_update(prop, 0, "rna_userdef_update");
1622 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1623 RNA_def_property_float_sdna(prop, NULL, "group_active");
1624 RNA_def_property_array(prop, 3);
1625 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1626 RNA_def_property_update(prop, 0, "rna_userdef_update");
1628 prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
1629 RNA_def_property_float_sdna(prop, NULL, "strip");
1630 RNA_def_property_array(prop, 3);
1631 RNA_def_property_ui_text(prop, "Long Key", "");
1632 RNA_def_property_update(prop, 0, "rna_userdef_update");
1634 prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1635 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1636 RNA_def_property_array(prop, 3);
1637 RNA_def_property_ui_text(prop, "Long Key Selected", "");
1638 RNA_def_property_update(prop, 0, "rna_userdef_update");
1640 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1641 RNA_def_property_float_sdna(prop, NULL, "cframe");
1642 RNA_def_property_array(prop, 3);
1643 RNA_def_property_ui_text(prop, "Current Frame", "");
1644 RNA_def_property_update(prop, 0, "rna_userdef_update");
1646 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
1647 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1648 RNA_def_property_array(prop, 3);
1649 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1650 RNA_def_property_update(prop, 0, "rna_userdef_update");
1652 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
1653 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1654 RNA_def_property_array(prop, 3);
1655 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1656 RNA_def_property_update(prop, 0, "rna_userdef_update");
1659 static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
1666 srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL);
1667 RNA_def_struct_sdna(srna, "ThemeSpace");
1668 RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor");
1670 rna_def_userdef_theme_spaces_main(srna, SPACE_NLA);
1672 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1673 RNA_def_property_array(prop, 3);
1674 RNA_def_property_ui_text(prop, "Grid", "");
1675 RNA_def_property_update(prop, 0, "rna_userdef_update");
1677 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1678 RNA_def_property_float_sdna(prop, NULL, "shade1");
1679 RNA_def_property_array(prop, 3);
1680 RNA_def_property_ui_text(prop, "View Sliders", "");
1681 RNA_def_property_update(prop, 0, "rna_userdef_update");
1683 prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR_GAMMA);
1684 RNA_def_property_float_sdna(prop, NULL, "shade2");
1685 RNA_def_property_array(prop, 3);
1686 RNA_def_property_ui_text(prop, "Bars", "");
1687 RNA_def_property_update(prop, 0, "rna_userdef_update");
1689 prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1690 RNA_def_property_float_sdna(prop, NULL, "hilite");
1691 RNA_def_property_array(prop, 3);
1692 RNA_def_property_ui_text(prop, "Bars Selected", "");
1693 RNA_def_property_update(prop, 0, "rna_userdef_update");
1695 prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
1696 RNA_def_property_float_sdna(prop, NULL, "strip");
1697 RNA_def_property_array(prop, 3);
1698 RNA_def_property_ui_text(prop, "Strips", "");
1699 RNA_def_property_update(prop, 0, "rna_userdef_update");
1701 prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1702 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1703 RNA_def_property_array(prop, 3);
1704 RNA_def_property_ui_text(prop, "Strips Selected", "");
1705 RNA_def_property_update(prop, 0, "rna_userdef_update");
1707 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1708 RNA_def_property_float_sdna(prop, NULL, "cframe");
1709 RNA_def_property_array(prop, 3);
1710 RNA_def_property_ui_text(prop, "Current Frame", "");
1711 RNA_def_property_update(prop, 0, "rna_userdef_update");
1714 static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
1719 srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
1720 RNA_def_struct_sdna(srna, "ThemeWireColor");
1721 RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
1723 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
1724 RNA_def_property_float_sdna(prop, NULL, "solid");
1725 RNA_def_property_array(prop, 3);
1726 RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
1727 RNA_def_property_update(prop, 0, "rna_userdef_update");
1729 prop= RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
1730 RNA_def_property_float_sdna(prop, NULL, "select");
1731 RNA_def_property_array(prop, 3);
1732 RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
1733 RNA_def_property_update(prop, 0, "rna_userdef_update");
1735 prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
1736 RNA_def_property_array(prop, 3);
1737 RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
1738 RNA_def_property_update(prop, 0, "rna_userdef_update");
1740 prop= RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
1741 RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
1742 RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
1743 RNA_def_property_update(prop, 0, "rna_userdef_update");
1746 static void rna_def_userdef_themes(BlenderRNA *brna)
1751 static EnumPropertyItem active_theme_area[] = {
1752 {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
1753 {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
1754 {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
1755 {2, "TIMELINE", ICON_TIME, "Timeline", ""},
1756 {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
1757 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
1758 {5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
1759 {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
1760 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
1761 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
1762 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
1763 {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
1764 {11, "PROPERTIES", ICON_BUTS, "Properties", ""},
1765 {12, "OUTLINER", ICON_OOPS, "Outliner", ""},
1766 {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
1767 {15, "INFO", ICON_INFO, "Info", ""},
1768 {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
1769 {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
1770 {0, NULL, 0, NULL, NULL}};
1772 srna= RNA_def_struct(brna, "Theme", NULL);
1773 RNA_def_struct_sdna(srna, "bTheme");
1774 RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface");
1776 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1777 RNA_def_property_ui_text(prop, "Name", "Name of the theme");
1778 RNA_def_struct_name_property(srna, prop);
1780 prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
1781 RNA_def_property_enum_sdna(prop, NULL, "active_theme_area");
1782 RNA_def_property_enum_items(prop, active_theme_area);
1783 RNA_def_property_ui_text(prop, "Active Theme Area", "");
1785 prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
1786 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1787 RNA_def_property_pointer_sdna(prop, NULL, "tui");
1788 RNA_def_property_struct_type(prop, "ThemeUserInterface");
1789 RNA_def_property_ui_text(prop, "User Interface", "");
1791 prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
1792 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1793 RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
1794 RNA_def_property_struct_type(prop, "ThemeView3D");
1795 RNA_def_property_ui_text(prop, "3D View", "");
1797 prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
1798 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1799 RNA_def_property_pointer_sdna(prop, NULL, "tipo");
1800 RNA_def_property_struct_type(prop, "ThemeGraphEditor");
1801 RNA_def_property_ui_text(prop, "Graph Editor", "");
1803 prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
1804 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1805 RNA_def_property_pointer_sdna(prop, NULL, "tfile");
1806 RNA_def_property_struct_type(prop, "ThemeFileBrowser");
1807 RNA_def_property_ui_text(prop, "File Browser", "");
1809 prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
1810 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1811 RNA_def_property_pointer_sdna(prop, NULL, "tnla");
1812 RNA_def_property_struct_type(prop, "ThemeNLAEditor");
1813 RNA_def_property_ui_text(prop, "NLA Editor", "");
1815 prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
1816 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1817 RNA_def_property_pointer_sdna(prop, NULL, "tact");
1818 RNA_def_property_struct_type(prop, "ThemeDopeSheet");
1819 RNA_def_property_ui_text(prop, "DopeSheet", "");
1821 prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
1822 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1823 RNA_def_property_pointer_sdna(prop, NULL, "tima");
1824 RNA_def_property_struct_type(prop, "ThemeImageEditor");
1825 RNA_def_property_ui_text(prop, "Image Editor", "");
1827 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
1828 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1829 RNA_def_property_pointer_sdna(prop, NULL, "tseq");
1830 RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
1831 RNA_def_property_ui_text(prop, "Sequence Editor", "");
1833 prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
1834 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1835 RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
1836 RNA_def_property_struct_type(prop, "ThemeProperties");
1837 RNA_def_property_ui_text(prop, "Properties", "");
1839 prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
1840 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1841 RNA_def_property_pointer_sdna(prop, NULL, "text");
1842 RNA_def_property_struct_type(prop, "ThemeTextEditor");
1843 RNA_def_property_ui_text(prop, "Text Editor", "");
1845 prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
1846 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1847 RNA_def_property_pointer_sdna(prop, NULL, "ttime");
1848 RNA_def_property_struct_type(prop, "ThemeTimeline");
1849 RNA_def_property_ui_text(prop, "Timeline", "");
1851 prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
1852 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1853 RNA_def_property_pointer_sdna(prop, NULL, "tnode");
1854 RNA_def_property_struct_type(prop, "ThemeNodeEditor");
1855 RNA_def_property_ui_text(prop, "Node Editor", "");
1857 prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
1858 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1859 RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
1860 RNA_def_property_struct_type(prop, "ThemeLogicEditor");
1861 RNA_def_property_ui_text(prop, "Logic Editor", "");
1863 prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
1864 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1865 RNA_def_property_pointer_sdna(prop, NULL, "toops");
1866 RNA_def_property_struct_type(prop, "ThemeOutliner");
1867 RNA_def_property_ui_text(prop, "Outliner", "");
1869 prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
1870 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1871 RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
1872 RNA_def_property_struct_type(prop, "ThemeInfo");
1873 RNA_def_property_ui_text(prop, "Info", "");
1875 prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
1876 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1877 RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
1878 RNA_def_property_struct_type(prop, "ThemeUserPreferences");
1879 RNA_def_property_ui_text(prop, "User Preferences", "");
1881 prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
1882 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1883 RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
1884 RNA_def_property_struct_type(prop, "ThemeConsole");
1885 RNA_def_property_ui_text(prop, "Console", "");
1887 prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
1888 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1889 RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
1890 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
1891 RNA_def_property_ui_text(prop, "Bone Color Sets", "");
1894 static void rna_def_userdef_addon(BlenderRNA *brna)
1899 srna= RNA_def_struct(brna, "Addon", NULL);
1900 RNA_def_struct_sdna(srna, "bAddon");
1901 RNA_def_struct_ui_text(srna, "Addon", "Python addons to be loaded automatically");
1903 prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
1904 RNA_def_property_ui_text(prop, "Module", "Module name");
1905 RNA_def_struct_name_property(srna, prop);
1909 static void rna_def_userdef_dothemes(BlenderRNA *brna)
1912 rna_def_userdef_theme_ui_style(brna);
1913 rna_def_userdef_theme_ui(brna);
1915 rna_def_userdef_theme_space_view3d(brna);
1916 rna_def_userdef_theme_space_graph(brna);
1917 rna_def_userdef_theme_space_file(brna);
1918 rna_def_userdef_theme_space_nla(brna);
1919 rna_def_userdef_theme_space_action(brna);
1920 rna_def_userdef_theme_space_image(brna);
1921 rna_def_userdef_theme_space_seq(brna);
1922 rna_def_userdef_theme_space_buts(brna);
1923 rna_def_userdef_theme_space_text(brna);
1924 rna_def_userdef_theme_space_time(brna);
1925 rna_def_userdef_theme_space_node(brna);
1926 rna_def_userdef_theme_space_outliner(brna);
1927 rna_def_userdef_theme_space_info(brna);
1928 rna_def_userdef_theme_space_userpref(brna);
1929 rna_def_userdef_theme_space_console(brna);
1930 rna_def_userdef_theme_space_sound(brna);
1931 rna_def_userdef_theme_space_logic(brna);
1932 rna_def_userdef_theme_colorset(brna);
1933 rna_def_userdef_themes(brna);
1936 static void rna_def_userdef_solidlight(BlenderRNA *brna)
1941 srna= RNA_def_struct(brna, "UserSolidLight", NULL);
1942 RNA_def_struct_sdna(srna, "SolidLight");
1943 RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
1945 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1946 RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
1947 RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
1948 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1950 prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
1951 RNA_def_property_float_sdna(prop, NULL, "vec");
1952 RNA_def_property_array(prop, 3);
1953 RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining");
1954 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1956 prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
1957 RNA_def_property_float_sdna(prop, NULL, "col");
1958 RNA_def_property_array(prop, 3);
1959 RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light");
1960 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1962 prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
1963 RNA_def_property_float_sdna(prop, NULL, "spec");
1964 RNA_def_property_array(prop, 3);
1965 RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight");
1966 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1969 static void rna_def_userdef_view(BlenderRNA *brna)
1971 static EnumPropertyItem timecode_styles[] = {
1972 {USER_TIMECODE_MINIMAL, "MINIMAL", 0, "Minimal Info", "Most compact representation. Uses '+' as separator for sub-second frame numbers, with left and right truncation of the timecode as necessary"},
1973 {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode. Format is HH:MM:SS:FF"},
1974 {USER_TIMECODE_SMPTE_MSF, "SMPTE_COMPACT", 0, "SMPTE (Compact)", "SMPTE timecode showing minutes, seconds, and frames only. Hours are also shown if necessary, but not by default"},
1975 {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", "Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead"},
1976 {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
1977 {0, NULL, 0, NULL, NULL}};
1982 srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
1983 RNA_def_struct_sdna(srna, "UserDef");
1984 RNA_def_struct_nested(brna, srna, "UserPreferences");
1985 RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
1990 prop= RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
1991 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
1992 RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
1994 prop= RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
1995 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
1996 RNA_def_property_ui_text(prop, "Show Python Tooltips", "Show Python references in tooltips");
1998 prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
1999 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
2000 RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
2001 RNA_def_property_update(prop, 0, "rna_userdef_update");
2003 prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
2004 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
2005 RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens");
2006 RNA_def_property_update(prop, 0, "rna_userdef_update");
2008 prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
2009 RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
2010 RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
2011 RNA_def_property_update(prop, 0, "rna_userdef_update");
2013 prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
2014 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME);
2015 RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
2016 RNA_def_property_update(prop, 0, "rna_userdef_update");
2018 prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
2019 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
2020 RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
2022 prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
2023 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
2024 RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back");
2025 RNA_def_property_update(prop, 0, "rna_userdef_update");
2028 prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
2029 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
2030 RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering");
2032 prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
2033 RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
2034 RNA_def_property_range(prop, 1, 40);
2035 RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening top level menus");
2037 prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
2038 RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
2039 RNA_def_property_range(prop, 1, 40);
2040 RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening sub level menus");
2042 /* Toolbox click-hold delay */
2043 prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
2044 RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
2045 RNA_def_property_range(prop, 1, 40);
2046 RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
2048 prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
2049 RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
2050 RNA_def_property_range(prop, 1, 40);
2051 RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
2053 prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
2054 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
2055 RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
2057 prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
2058 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
2059 RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction");
2061 prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
2062 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
2063 RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
2065 prop= RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
2066 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
2067 RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
2069 prop= RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
2070 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
2071 RNA_def_property_ui_text(prop, "Camera Parent Lock", "When the camera is locked to the view and in fly mode, transform the parent rather than the camera");
2074 prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
2075 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
2076 RNA_def_property_ui_text(prop, "Zoom To Mouse Position", "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
2079 prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
2080 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
2081 RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views");
2083 prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
2084 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
2085 RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
2088 prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
2089 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
2090 RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View");
2091 RNA_def_property_update(prop, 0, "rna_userdef_update");
2093 prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
2094 RNA_def_property_int_sdna(prop, NULL, "rvisize");
2095 RNA_def_property_range(prop, 10, 64);
2096 RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size");
2097 RNA_def_property_update(prop, 0, "rna_userdef_update");
2099 prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
2100 RNA_def_property_int_sdna(prop, NULL, "rvibright");
2101 RNA_def_property_range(prop, 0, 10);
2102 RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon");
2103 RNA_def_property_update(prop, 0, "rna_userdef_update");
2105 prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
2106 RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
2107 RNA_def_property_range(prop, 0, 1000);
2108 RNA_def_property_ui_text(prop, "Smooth View", "The time to animate the view in milliseconds, zero to disable");
2110 prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
2111 RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
2112 RNA_def_property_range(prop, 0, 90);
2113 RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)");
2115 /* 3D transform widget */
2116 prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
2117 RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", V3D_USE_MANIPULATOR);
2118 RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
2119 RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update");
2121 prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
2122 RNA_def_property_int_sdna(prop, NULL, "tw_size");
2123 RNA_def_property_range(prop, 2, 40);
2124 RNA_def_property_int_default(prop, 15);
2125 RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units");
2126 RNA_def_property_update(prop, 0, "rna_userdef_update");
2128 prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
2129 RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
2130 RNA_def_property_range(prop, 2, 40);
2131 RNA_def_property_int_default(prop, 25);
2132 RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius");
2133 RNA_def_property_update(prop, 0, "rna_userdef_update");
2135 prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
2136 RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
2137 RNA_def_property_range(prop, 4, 40);
2138 RNA_def_property_int_default(prop, 14);
2139 RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Pixel distance around the handles to accept mouse clicks");
2141 prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
2142 RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
2143 RNA_def_property_range(prop, 4, 10);
2144 RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display");
2145 RNA_def_property_update(prop, 0, "rna_userdef_update");
2147 /* View2D Grid Displays */
2148 prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
2149 RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
2150 RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
2151 RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports");
2152 RNA_def_property_update(prop, 0, "rna_userdef_update");
2154 // TODO: add a setter for this, so that we can bump up the minimum size as necessary...
2155 prop= RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
2156 RNA_def_property_enum_items(prop, timecode_styles);
2157 RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
2158 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
2159 RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
2160 RNA_def_property_update(prop, 0, "rna_userdef_update");
2163 static void rna_def_userdef_edit(BlenderRNA *brna)
2168 static EnumPropertyItem auto_key_modes[] = {
2169 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
2170 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
2171 {0, NULL, 0, NULL, NULL}};
2173 static const EnumPropertyItem material_link_items[]= {
2174 {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
2175 {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"},
2176 {0, NULL, 0, NULL, NULL}};
2178 static const EnumPropertyItem object_align_items[]= {
2179 {0, "WORLD", 0, "World", "Align newly added objects to the world coordinates"},
2180 {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
2181 {0, NULL, 0, NULL, NULL}};
2183 srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
2184 RNA_def_struct_sdna(srna, "UserDef");
2185 RNA_def_struct_nested(brna, srna, "UserPreferences");
2186 RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
2190 prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
2191 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2192 RNA_def_property_enum_items(prop, material_link_items);
2193 RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
2195 prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
2196 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2197 RNA_def_property_enum_items(prop, object_align_items);
2198 RNA_def_property_ui_text(prop, "Align Object To", "When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates");
2200 prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
2201 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
2202 RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object");
2204 prop= RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
2205 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM);
2206 RNA_def_property_ui_text(prop, "Release confirms", "Moving things with a mouse drag confirms when releasing the button");
2209 prop= RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
2210 RNA_def_property_int_sdna(prop, NULL, "undosteps");
2211 RNA_def_property_range(prop, 0, 64);
2212 RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
2214 prop= RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
2215 RNA_def_property_int_sdna(prop, NULL, "undomemory");
2216 RNA_def_property_range(prop, 0, 32767);
2217 RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
2219 prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
2220 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
2221 RNA_def_property_ui_text(prop, "Global Undo", "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
2223 /* auto keyframing */
2224 prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
2225 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
2226 RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones");
2227 RNA_def_property_ui_icon(prop, ICON_REC, 0);
2229 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
2230 RNA_def_property_enum_items(prop, auto_key_modes);
2231 RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
2232 RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
2234 prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
2235 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
2236 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves");
2238 /* keyframing settings */
2239 prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
2240 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
2241 RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
2243 prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
2244 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
2245 RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
2247 prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
2248 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
2249 RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis");
2251 prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
2252 RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
2253 RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
2254 RNA_def_property_ui_text(prop, "New Interpolation Type", "");
2256 prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
2257 RNA_def_property_enum_items(prop, beztriple_handle_type_items);
2258 RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new");
2259 RNA_def_property_ui_text(prop, "New Handles Type", "");
2262 prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
2263 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
2264 RNA_def_property_ui_text(prop, "Allow Negative Frames", "Current frame number can be manually set to a negative value");
2267 prop= RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
2268 RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist");
2269 RNA_def_property_range(prop, 0, 100);
2270 RNA_def_property_ui_text(prop, "Grease Pencil Manhattan Distance", "Pixels moved by mouse per axis when drawing stroke");
2272 prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
2273 RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
2274 RNA_def_property_range(prop, 0, 100);
2275 RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include");
2277 prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
2278 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
2279 RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
2281 prop= RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
2282 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
2283 RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
2285 prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
2286 RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
2287 RNA_def_property_range(prop, 0, 100);
2288 RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
2290 /* sculpt and paint */
2292 prop= RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2293 RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_overlay_col");
2294 RNA_def_property_array(prop, 3);
2295 RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
2297 /* duplication linking */
2298 prop= RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
2299 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
2300 RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
2302 prop= RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
2303 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
2304 RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
2306 prop= RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
2307 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
2308 RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
2310 prop= RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
2311 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
2312 RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
2314 prop= RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
2315 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
2316 RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
2318 prop= RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
2319 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
2320 RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
2322 prop= RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
2323 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
2324 RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
2326 prop= RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
2327 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
2328 RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
2330 prop= RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
2331 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
2332 RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
2335 prop= RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
2336 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
2337 RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
2339 prop= RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
2340 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
2341 RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
2343 prop= RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
2344 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
2345 RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
2348 static void rna_def_userdef_system(BlenderRNA *brna)
2353 static EnumPropertyItem gl_texture_clamp_items[] = {
2354 {0, "CLAMP_OFF", 0, "Off", ""},
2355 {8192, "CLAMP_8192", 0, "8192", ""},
2356 {4096, "CLAMP_4096", 0, "4096", ""},
2357 {2048, "CLAMP_2048", 0, "2048", ""},
2358 {1024, "CLAMP_1024", 0, "1024", ""},
2359 {512, "CLAMP_512", 0, "512", ""},
2360 {256, "CLAMP_256", 0, "256", ""},
2361 {128, "CLAMP_128", 0, "128", ""},
2362 {0, NULL, 0, NULL, NULL}};
2364 static EnumPropertyItem anisotropic_items[] ={
2365 {1, "FILTER_0", 0, "Off", ""},
2366 {2, "FILTER_2", 0, "2x", ""},
2367 {4, "FILTER_4", 0, "4x", ""},
2368 {8, "FILTER_8", 0, "8x", ""},
2369 {16, "FILTER_16", 0, "16x", ""},
2370 {0, NULL, 0, NULL, NULL}};
2372 static EnumPropertyItem audio_mixing_samples_items[] = {
2373 {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
2374 {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
2375 {1024, "SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
2376 {2048, "SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
2377 {4096, "SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
2378 {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
2379 {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
2380 {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
2381 {0, NULL, 0, NULL, NULL}};
2383 static EnumPropertyItem audio_device_items[] = {
2384 {0, "NONE", 0, "None", "Null device - there will be no audio output"},
2386 {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage"},
2389 {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"},
2392 {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"},
2394 {0, NULL, 0, NULL, NULL}};
2396 static EnumPropertyItem audio_rate_items[] = {
2397 // {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
2398 // {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
2399 // {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
2400 // {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
2401 // {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
2402 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
2403 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
2404 // {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
2405 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
2406 {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
2407 {0, NULL, 0, NULL, NULL}};
2409 static EnumPropertyItem audio_format_items[] = {
2410 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
2411 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer"},
2412 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer"},
2413 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
2414 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
2415 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
2416 {0, NULL, 0, NULL, NULL}};
2418 static EnumPropertyItem audio_channel_items[] = {
2419 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2420 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
2421 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2422 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2423 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2424 {0, NULL, 0, NULL, NULL}};
2426 static EnumPropertyItem draw_method_items[] = {
2427 {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
2428 {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory"},
2429 {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
2430 {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip", "Redraw all overlapping regions, minimal memory usage but more redraws (for graphics drivers that do flipping)"},
2431 {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails"},
2432 {0, NULL, 0, NULL, NULL}};
2434 static EnumPropertyItem color_picker_types[] = {
2435 {USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
2436 {USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
2437 {USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
2438 {USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
2439 {0, NULL, 0, NULL, NULL}};
2441 /* hardcoded here, could become dynamic somehow */
2442 static EnumPropertyItem language_items[] = {
2443 {0, "ENGLISH", 0, "English", ""},
2444 {1, "JAPANESE", 0, "Japanese", ""},
2445 {2, "DUTCH", 0, "Dutch", ""},
2446 {3, "ITALIAN", 0, "Italian", ""},
2447 {4, "GERMAN", 0, "German", ""},
2448 {5, "FINNISH", 0, "Finnish", ""},
2449 {6, "SWEDISH", 0, "Swedish", ""},
2450 {7, "FRENCH", 0, "French", ""},
2451 {8, "SPANISH", 0, "Spanish", ""},
2452 {9, "CATALAN", 0, "Catalan", ""},
2453 {10, "CZECH", 0, "Czech", ""},
2454 {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""},
2455 {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""},
2456 {13, "RUSSIAN", 0, "Russian", ""},
2457 {14, "CROATIAN", 0, "Croatian", ""},
2458 {15, "SERBIAN", 0, "Serbian", ""},
2459 {16, "UKRAINIAN", 0, "Ukrainian", ""},
2460 {17, "POLISH", 0, "Polish", ""},
2461 {18, "ROMANIAN", 0, "Romanian", ""},
2462 {19, "ARABIC", 0, "Arabic", ""},
2463 {20, "BULGARIAN", 0, "Bulgarian", ""},
2464 {21, "GREEK", 0, "Greek", ""},
2465 {22, "KOREAN", 0, "Korean", ""},
2466 {0, NULL, 0, NULL, NULL}};
2468 srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
2469 RNA_def_struct_sdna(srna, "UserDef");
2470 RNA_def_struct_nested(brna, srna, "UserPreferences");
2471 RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
2475 prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
2476 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
2477 RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
2478 RNA_def_property_update(prop, 0, "rna_userdef_update");
2480 prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
2481 RNA_def_property_int_sdna(prop, NULL, "dpi");
2482 RNA_def_property_range(prop, 48, 128);
2483 RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
2484 RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
2486 prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
2487 RNA_def_property_int_sdna(prop, NULL, "scrollback");
2488 RNA_def_property_range(prop, 32, 32768);
2489 RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
2491 prop= RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
2492 RNA_def_property_string_sdna(prop, NULL, "author");
2493 RNA_def_property_string_maxlength(prop, 80);
2494 RNA_def_property_ui_text(prop, "Author", "Name that will be used in exported files when format supports such feature");
2496 /* Language Selection */
2498 prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
2499 RNA_def_property_enum_items(prop, language_items);
2500 RNA_def_property_ui_text(prop, "Language", "Language use for translation");
2501 RNA_def_property_update(prop, 0, "rna_userdef_update");
2503 prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
2504 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
2505 RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
2506 RNA_def_property_update(prop, 0, "rna_userdef_update");
2508 prop= RNA_def_property(srna, "use_translate_buttons", PROP_BOOLEAN, PROP_NONE);
2509 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS);
2510 RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels");
2511 RNA_def_property_update(prop, 0, "rna_userdef_update");
2513 prop= RNA_def_property(srna, "use_translate_toolbox", PROP_BOOLEAN, PROP_NONE);
2514 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS);
2515 RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu");
2516 RNA_def_property_update(prop, 0, "rna_userdef_update");
2518 prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
2519 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
2520 RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts");
2521 RNA_def_property_update(prop, 0, "rna_userdef_update");
2523 /* System & OpenGL */
2525 prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
2526 RNA_def_property_collection_sdna(prop, NULL, "light", "");
2527 RNA_def_property_struct_type(prop, "UserSolidLight");
2528 RNA_def_property_ui_text(prop, "Solid Lights", "Lights user to display objects in solid draw mode");
2530 prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
2531 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
2532 RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode");
2533 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2535 prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
2536 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2537 RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
2538 RNA_def_property_struct_type(prop, "ColorRamp");
2539 RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode");
2540 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2542 prop= RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
2543 RNA_def_property_enum_items(prop, color_picker_types);
2544 RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
2545 RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
2547 prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
2548 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
2549 RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)");
2551 prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
2552 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
2553 RNA_def_property_ui_text(prop, "Auto Run Python Scripts", "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)");
2554 RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
2556 prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
2557 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
2558 RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces for new and loaded text files");
2560 prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
2561 RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
2562 RNA_def_property_range(prop, 0, 500);
2563 RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
2565 prop= RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
2566 RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
2567 RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
2568 RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
2569 RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
2571 prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
2572 RNA_def_property_int_sdna(prop, NULL, "frameserverport");
2573 RNA_def_property_range(prop, 0, 32727);
2574 RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering");
2576 prop= RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
2577 RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
2578 RNA_def_property_range(prop, 0.0f, 1.0f);
2579 RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
2580 RNA_def_property_update(prop, 0, "rna_userdef_update");
2582 prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
2583 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
2584 RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
2585 RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
2587 prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
2588 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
2589 RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
2591 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2592 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
2593 RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)");
2595 prop= RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
2596 RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
2597 RNA_def_property_enum_items(prop, anisotropic_items);
2598 RNA_def_property_enum_default(prop, 1);
2599 RNA_def_property_ui_text(prop, "Anisotropic Filter", "The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
2600 RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update");
2602 prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
2603 RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
2604 RNA_def_property_enum_items(prop, gl_texture_clamp_items);
2605 RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
2606 RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update");
2608 prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
2609 RNA_def_property_int_sdna(prop, NULL, "textimeout");
2610 RNA_def_property_range(prop, 0, 3600);
2611 RNA_def_property_ui_text(prop, "Texture Time Out", "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated.)");
2613 prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
2614 RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
2615 RNA_def_property_range(prop, 1, 3600);
2616 RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector");
2618 prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
2619 RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
2620 RNA_def_property_enum_items(prop, draw_method_items);
2621 RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
2622 RNA_def_property_update(prop, 0, "rna_userdef_update");
2624 prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
2625 RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
2626 RNA_def_property_enum_items(prop, audio_mixing_samples_items);
2627 RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer");
2628 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2630 prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
2631 RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
2632 RNA_def_property_enum_items(prop, audio_device_items);
2633 RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device");
2634 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2636 prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
2637 RNA_def_property_enum_sdna(prop, NULL, "audiorate");
2638 RNA_def_property_enum_items(prop, audio_rate_items);
2639 RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate");
2640 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2642 prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
2643 RNA_def_property_enum_sdna(prop, NULL, "audioformat");
2644 RNA_def_property_enum_items(prop, audio_format_items);
2645 RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format");
2646 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2648 prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
2649 RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
2650 RNA_def_property_enum_items(prop, audio_channel_items);
2651 RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
2652 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2654 prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
2655 RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
2656 RNA_def_property_range(prop, 10, 50);
2657 RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back");
2659 prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
2660 RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
2661 RNA_def_property_range(prop, 50, 1000);
2662 RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast");
2664 prop= RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
2665 RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_AA);
2666 RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
2667 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
2670 prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
2671 RNA_def_property_string_sdna(prop, NULL, "versemaster");
2672 RNA_def_property_ui_text(prop, "Verse Master", "The Verse Master-server IP");
2674 prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE);
2675 RNA_def_property_string_sdna(prop, NULL, "verseuser");
2676 RNA_def_property_ui_text(prop, "Verse Username", "The Verse user name");
2680 static void rna_def_userdef_input(BlenderRNA *brna)
2685 static EnumPropertyItem select_mouse_items[] = {
2686 {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
2687 {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
2688 {0, NULL, 0, NULL, NULL}};
2690 static EnumPropertyItem view_rotation_items[] = {
2691 {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
2692 {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
2693 {0, NULL, 0, NULL, NULL}};
2695 static EnumPropertyItem view_zoom_styles[] = {
2696 {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
2697 {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement"},
2698 {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center"},
2699 {0, NULL, 0, NULL, NULL}};
2701 static EnumPropertyItem view_zoom_axes[] = {
2702 {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"},
2703 {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"},
2704 {0, NULL, 0, NULL, NULL}};
2706 srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
2707 RNA_def_struct_sdna(srna, "UserDef");
2708 RNA_def_struct_nested(brna, srna, "UserPreferences");
2709 RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
2711 prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
2712 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2713 RNA_def_property_enum_items(prop, select_mouse_items);
2714 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
2715 RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection");
2717 prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
2718 RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
2719 RNA_def_property_enum_items(prop, view_zoom_styles);
2720 RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
2722 prop= RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
2723 RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
2724 RNA_def_property_enum_items(prop, view_zoom_axes);
2725 RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
2727 prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
2728 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
2729 RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
2731 prop= RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
2732 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2733 RNA_def_property_enum_items(prop, view_rotation_items);
2734 RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
2736 prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
2737 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
2738 RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
2740 /* tweak tablet & mouse preset */
2741 prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
2742 RNA_def_property_int_sdna(prop, NULL, "dragthreshold");
2743 RNA_def_property_range(prop, 3, 40);
2744 RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
2746 /* 3D mouse settings */
2747 prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
2748 RNA_def_property_range(prop, 0.25f, 4.0f);
2749 RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
2751 prop= RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
2752 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
2753 RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
2754 /* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/
2756 prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
2757 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
2758 RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
2760 prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
2761 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);
2762 RNA_def_property_ui_text(prop, "Lock Horizon", "Keep horizon level while flying with 3D Mouse");
2764 prop= RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
2765 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_FLY_HELICOPTER);
2766 RNA_def_property_ui_text(prop, "Helicopter Mode", "Device up/down directly controls your Z position");
2769 prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
2770 RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
2771 RNA_def_property_range(prop, 1, 1000);
2772 RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click");
2774 prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
2775 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
2776 RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)");
2778 prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
2779 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
2780 RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
2782 /* middle mouse button */
2783 prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
2784 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
2785 RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
2787 prop= RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
2788 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
2789 RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
2791 prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
2792 RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
2793 RNA_def_property_range(prop, 0, 32);
2794 RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
2796 /* U.keymaps - custom keymaps that have been edited from default configs */
2797 prop= RNA_def_property(srna, "edited_keymaps", PROP_COLLECTION, PROP_NONE);
2798 RNA_def_property_collection_sdna(prop, NULL, "keymaps", NULL);
2799 RNA_def_property_struct_type(prop, "KeyMap");
2800 RNA_def_property_ui_text(prop, "Edited Keymaps", "");
2802 prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
2803 RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
2804 RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
2807 static void rna_def_userdef_filepaths(BlenderRNA *brna)
2812 static EnumPropertyItem anim_player_presets[] = {
2813 //{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, // doesn't work yet!
2814 {1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
2815 {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
2816 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
2817 {4, "RV", 0, "rv", "Frame player from Tweak Software"},
2818 {5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"},
2819 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
2820 {0, NULL, 0, NULL, NULL}};
2822 srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
2823 RNA_def_struct_sdna(srna, "UserDef");
2824 RNA_def_struct_nested(brna, srna, "UserPreferences");
2825 RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
2827 prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
2828 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
2829 RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
2831 prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
2832 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
2833 RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
2835 prop= RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE);
2836 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
2837 RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector");
2839 prop= RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
2840 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_THUMBNAILS);
2841 RNA_def_property_ui_text(prop, "Show Thumbnails", "Open in thumbnail view for images and movies");
2843 prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
2844 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
2845 RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
2847 prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
2848 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
2849 RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
2851 prop= RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
2852 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
2853 RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
2855 prop= RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
2856 RNA_def_property_string_sdna(prop, NULL, "fontdir");
2857 RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
2859 prop= RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
2860 RNA_def_property_string_sdna(prop, NULL, "textudir");
2861 RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
2863 prop= RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
2864 RNA_def_property_string_sdna(prop, NULL, "plugtexdir");
2865 RNA_def_property_ui_text(prop, "Texture Plugin Directory", "The default directory to search for texture plugins");
2867 prop= RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
2868 RNA_def_property_string_sdna(prop, NULL, "plugseqdir");
2869 RNA_def_property_ui_text(prop, "Sequence Plugin Directory", "The default directory to search for sequence plugins");
2871 prop= RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
2872 RNA_def_property_string_sdna(prop, NULL, "renderdir");
2873 RNA_def_property_ui_text(prop, "Render Output Directory", "The default directory for rendering output, for new scenes");
2875 prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
2876 RNA_def_property_string_sdna(prop, NULL, "pythondir");
2877 RNA_def_property_ui_text(prop, "Python Scripts Directory", "Alternate script path, matching the default layout with subdirs: startup, addons & modules (requires restart)");
2878 /* TODO, editing should reset sys.path! */
2880 prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
2881 RNA_def_property_string_sdna(prop, NULL, "sounddir");
2882 RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
2884 prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
2885 RNA_def_property_string_sdna(prop, NULL, "tempdir");
2886 RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
2887 RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
2889 prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
2890 RNA_def_property_string_sdna(prop, NULL, "image_editor");
2891 RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
2893 prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
2894 RNA_def_property_string_sdna(prop, NULL, "anim_player");
2895 RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player");
2897 prop= RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
2898 RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
2899 RNA_def_property_enum_items(prop, anim_player_presets);
2900 RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
2901 RNA_def_property_enum_default(prop, 1); /* set default to blender 2.4 player until an internal one is back */
2905 prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
2906 RNA_def_property_int_sdna(prop, NULL, "versions");
2907 RNA_def_property_range(prop, 0, 32);
2908 RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving");
2910 prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
2911 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
2912 RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files in temp directory, uses process ID");
2913 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2915 prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
2916 RNA_def_property_int_sdna(prop, NULL, "savetime");
2917 RNA_def_property_range(prop, 1, 60);
2918 RNA_def_property_ui_text(prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
2919 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2921 prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
2922 RNA_def_property_range(prop, 0, 30);
2923 RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
2925 prop= RNA_def_property(srna, "use_update_recent_files_on_load", PROP_BOOLEAN, PROP_NONE);
2926 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NO_RECENTLOAD_UPDATE);
2927 RNA_def_property_ui_text(prop, "Update Recent on Load", "When enabled, opening files will update the recent files list. Otherwise, updates only occur when saving");
2929 prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
2930 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
2931 RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");
2934 void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
2940 RNA_def_property_srna(cprop, "Addons");
2941 srna= RNA_def_struct(brna, "Addons", NULL);
2942 RNA_def_struct_ui_text(srna, "User Add-Ons", "Collection of add-ons");
2944 func= RNA_def_function(srna, "new", "rna_userdef_addon_new");
2945 RNA_def_function_flag(func, FUNC_NO_SELF);
2946 RNA_def_function_ui_description(func, "Add a new addon");
2948 parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock.");
2949 RNA_def_function_return(func, parm);
2951 func= RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
2952 RNA_def_function_flag(func, FUNC_NO_SELF);
2953 RNA_def_function_ui_description(func, "Remove addon.");
2954 parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove.");
2955 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
2958 void RNA_def_userdef(BlenderRNA *brna)
2963 static EnumPropertyItem user_pref_sections[] = {
2964 {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
2965 {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
2966 {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
2967 {USER_SECTION_ADDONS, "ADDONS", 0, "Add-Ons", ""},
2968 {USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
2969 {USER_SECTION_FILE, "FILES", 0, "File", ""},
2970 {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
2971 {0, NULL, 0, NULL, NULL}};
2973 rna_def_userdef_dothemes(brna);
2974 rna_def_userdef_solidlight(brna);
2976 srna= RNA_def_struct(brna, "UserPreferences", NULL);
2977 RNA_def_struct_sdna(srna, "UserDef");
2978 RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences");
2980 prop= RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
2981 RNA_def_property_enum_sdna(prop, NULL, "userpref");
2982 RNA_def_property_enum_items(prop, user_pref_sections);
2983 RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface");
2984 RNA_def_property_update(prop, 0, "rna_userdef_update");
2986 prop= RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
2987 RNA_def_property_collection_sdna(prop, NULL, "themes", NULL);
2988 RNA_def_property_struct_type(prop, "Theme");
2989 RNA_def_property_ui_text(prop, "Themes", "");
2991 prop= RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
2992 RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL);
2993 RNA_def_property_struct_type(prop, "ThemeStyle");
2994 RNA_def_property_ui_text(prop, "Styles", "");
2996 prop= RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
2997 RNA_def_property_collection_sdna(prop, NULL, "addons", NULL);
2998 RNA_def_property_struct_type(prop, "Addon");
2999 RNA_def_property_ui_text(prop, "Addon", "");
3000 rna_def_userdef_addon_collection(brna, prop);
3003 /* nested structs */
3004 prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
3005 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3006 RNA_def_property_struct_type(prop, "UserPreferencesView");
3007 RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL);
3008 RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
3010 prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
3011 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3012 RNA_def_property_struct_type(prop, "UserPreferencesEdit");
3013 RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL);
3014 RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
3016 prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
3017 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3018 RNA_def_property_struct_type(prop, "UserPreferencesInput");
3019 RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL);
3020 RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
3022 prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
3023 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3024 RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
3025 RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL);
3026 RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
3028 prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
3029 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3030 RNA_def_property_struct_type(prop, "UserPreferencesSystem");
3031 RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL);
3032 RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings");
3034 rna_def_userdef_view(brna);
3035 rna_def_userdef_edit(brna);
3036 rna_def_userdef_input(brna);
3037 rna_def_userdef_filepaths(brna);
3038 rna_def_userdef_system(brna);
3039 rna_def_userdef_addon(brna);