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"
49 #include "BKE_sound.h"
53 #include "DNA_object_types.h"
54 #include "DNA_screen_types.h"
56 #include "BKE_DerivedMesh.h"
57 #include "BKE_depsgraph.h"
58 #include "BKE_global.h"
65 #include "MEM_guardedalloc.h"
66 #include "MEM_CacheLimiterC-Api.h"
68 static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
70 WM_main_add_notifier(NC_WINDOW, NULL);
73 static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr)
75 U.widget_unit = (U.dpi * 20 + 36)/72;
76 WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */
77 WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); /* refresh region sizes */
80 static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
85 static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr)
87 UserDef *userdef = (UserDef *)ptr->data;
89 /* lame, loop over all views and set */
94 /* from scene copy to the other views */
95 for(sc=bmain->screen.first; sc; sc=sc->id.next) {
96 for(sa=sc->areabase.first; sa; sa=sa->next) {
97 for(sl=sa->spacedata.first; sl; sl=sl->next) {
98 if(sl->spacetype==SPACE_VIEW3D) {
99 View3D *v3d= (View3D *)sl;
100 if(userdef->tw_flag & V3D_USE_MANIPULATOR)
101 v3d->twflag |= V3D_USE_MANIPULATOR;
103 v3d->twflag &= ~V3D_USE_MANIPULATOR;
109 rna_userdef_update(bmain, scene, ptr);
113 static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
115 UserDef *userdef = (UserDef*)ptr->data;
116 if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
117 else G.f |= G_SCRIPT_AUTOEXEC;
120 static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
122 GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
123 rna_userdef_update(bmain, scene, ptr);
126 static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr)
128 GPU_set_anisotropic(U.anisotropic_filter);
129 rna_userdef_update(bmain, scene, ptr);
132 static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
135 rna_userdef_update(bmain, scene, ptr);
138 static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
140 UserDef *userdef = (UserDef*)ptr->data;
143 userdef->flag |= USER_LMOUSESELECT;
144 userdef->flag &= ~USER_TWOBUTTONMOUSE;
147 userdef->flag &= ~USER_LMOUSESELECT;
150 static int rna_userdef_autokeymode_get(PointerRNA *ptr)
152 UserDef *userdef = (UserDef*)ptr->data;
153 short retval = userdef->autokey_mode;
155 if(!(userdef->autokey_mode & AUTOKEY_ON))
156 retval |= AUTOKEY_ON;
161 static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
163 UserDef *userdef = (UserDef*)ptr->data;
165 if(value == AUTOKEY_MODE_NORMAL) {
166 userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
167 userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
169 else if(value == AUTOKEY_MODE_EDITKEYS) {
170 userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
171 userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
175 static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
177 UserDef *userdef = (UserDef*)ptr->data;
178 int required_size = userdef->v2d_min_gridsize;
180 /* set the timecode style */
181 userdef->timecode_style= value;
183 /* adjust the v2d gridsize if needed so that timecodes don't overlap
184 * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
185 * things from getting too blown out
188 case USER_TIMECODE_MINIMAL:
189 case USER_TIMECODE_SECONDS_ONLY:
190 /* 35 is great most of the time, but not that great for full-blown */
193 case USER_TIMECODE_SMPTE_MSF:
196 case USER_TIMECODE_SMPTE_FULL:
197 /* the granddaddy! */
200 case USER_TIMECODE_MILLISECONDS:
205 if (U.v2d_min_gridsize < required_size)
206 U.v2d_min_gridsize= required_size;
209 static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
211 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesView, ptr->data);
214 static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
216 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
219 static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
221 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data);
224 static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
226 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
229 static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
231 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
234 static void rna_UserDef_audio_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
239 static void rna_Userdef_memcache_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
241 MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
244 static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
248 vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
250 for(ob= bmain->object.first; ob; ob= ob->id.next) {
251 if(ob->mode & OB_MODE_WEIGHT_PAINT)
252 DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
255 rna_userdef_update(bmain, scene, ptr);
258 static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
260 /* if all lights are off gpu_draw resets them all, [#27627]
261 * so disallow them all to be disabled */
262 if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
263 SolidLight *light= ptr->data;
267 WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
268 rna_userdef_update(bmain, scene, ptr);
271 static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
273 wmWindowManager *wm= bmain->wm.first;
276 WM_autosave_init(wm);
277 rna_userdef_update(bmain, scene, ptr);
280 static bAddon *rna_userdef_addon_new(void)
282 bAddon *bext= MEM_callocN(sizeof(bAddon), "bAddon");
283 BLI_addtail(&U.addons, bext);
287 static void rna_userdef_addon_remove(bAddon *bext)
289 BLI_freelinkN(&U.addons, bext);
292 static void rna_userdef_temp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
294 extern char btempdir[];
295 BLI_where_is_temp(btempdir, FILE_MAX, 1);
298 static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
301 WM_main_add_notifier(NC_WINDOW, NULL);
306 static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
311 static EnumPropertyItem font_kerning_style[] = {
312 {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"},
313 {1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
314 {0, NULL, 0, NULL, NULL}};
316 srna= RNA_def_struct(brna, "ThemeFontStyle", NULL);
317 RNA_def_struct_sdna(srna, "uiFontStyle");
318 RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
320 prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE);
321 RNA_def_property_range(prop, 6, 48);
322 RNA_def_property_ui_text(prop, "Points", "");
323 RNA_def_property_update(prop, 0, "rna_userdef_update");
325 prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE);
326 RNA_def_property_enum_sdna(prop, NULL, "kerning");
327 RNA_def_property_enum_items(prop, font_kerning_style);
328 RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning");
329 RNA_def_property_update(prop, 0, "rna_userdef_update");
331 prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
332 RNA_def_property_range(prop, 0, 5);
333 RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)");
334 RNA_def_property_update(prop, 0, "rna_userdef_update");
336 prop= RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_NONE);
337 RNA_def_property_int_sdna(prop, NULL, "shadx");
338 RNA_def_property_range(prop, -10, 10);
339 RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
340 RNA_def_property_update(prop, 0, "rna_userdef_update");
342 prop= RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
343 RNA_def_property_int_sdna(prop, NULL, "shady");
344 RNA_def_property_range(prop, -10, 10);
345 RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
346 RNA_def_property_update(prop, 0, "rna_userdef_update");
348 prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
349 RNA_def_property_range(prop, 0.0f, 1.0f);
350 RNA_def_property_ui_text(prop, "Shadow Alpha", "");
351 RNA_def_property_update(prop, 0, "rna_userdef_update");
353 prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
354 RNA_def_property_range(prop, 0.0f, 1.0f);
355 RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
356 RNA_def_property_update(prop, 0, "rna_userdef_update");
359 static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
364 rna_def_userdef_theme_ui_font_style(brna);
366 srna= RNA_def_struct(brna, "ThemeStyle", NULL);
367 RNA_def_struct_sdna(srna, "uiStyle");
368 RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
371 prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
372 RNA_def_property_range(prop, 0.5, 2.0);
373 RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
375 prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
376 RNA_def_property_flag(prop, PROP_NEVER_NULL);
377 RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
378 RNA_def_property_struct_type(prop, "ThemeFontStyle");
379 RNA_def_property_ui_text(prop, "Panel Style", "");
380 RNA_def_property_update(prop, 0, "rna_userdef_update");
382 prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
383 RNA_def_property_flag(prop, PROP_NEVER_NULL);
384 RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
385 RNA_def_property_struct_type(prop, "ThemeFontStyle");
386 RNA_def_property_ui_text(prop, "Group Label Font", "");
387 RNA_def_property_update(prop, 0, "rna_userdef_update");
389 prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
390 RNA_def_property_flag(prop, PROP_NEVER_NULL);
391 RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
392 RNA_def_property_struct_type(prop, "ThemeFontStyle");
393 RNA_def_property_ui_text(prop, "Widget Label Style", "");
394 RNA_def_property_update(prop, 0, "rna_userdef_update");
396 prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
397 RNA_def_property_flag(prop, PROP_NEVER_NULL);
398 RNA_def_property_pointer_sdna(prop, NULL, "widget");
399 RNA_def_property_struct_type(prop, "ThemeFontStyle");
400 RNA_def_property_ui_text(prop, "Widget Style", "");
401 RNA_def_property_update(prop, 0, "rna_userdef_update");
405 static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
410 srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL);
411 RNA_def_struct_sdna(srna, "uiWidgetColors");
412 RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
414 prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
415 RNA_def_property_array(prop, 3);
416 RNA_def_property_ui_text(prop, "Outline", "");
417 RNA_def_property_update(prop, 0, "rna_userdef_update");
419 prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
420 RNA_def_property_array(prop, 4);
421 RNA_def_property_ui_text(prop, "Inner", "");
422 RNA_def_property_update(prop, 0, "rna_userdef_update");
424 prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
425 RNA_def_property_array(prop, 4);
426 RNA_def_property_ui_text(prop, "Inner Selected", "");
427 RNA_def_property_update(prop, 0, "rna_userdef_update");
429 prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
430 RNA_def_property_array(prop, 4);
431 RNA_def_property_ui_text(prop, "Item", "");
432 RNA_def_property_update(prop, 0, "rna_userdef_update");
434 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
435 RNA_def_property_array(prop, 3);
436 RNA_def_property_ui_text(prop, "Text", "");
437 RNA_def_property_update(prop, 0, "rna_userdef_update");
439 prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
440 RNA_def_property_array(prop, 3);
441 RNA_def_property_ui_text(prop, "Text Selected", "");
442 RNA_def_property_update(prop, 0, "rna_userdef_update");
444 prop= RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
445 RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
446 RNA_def_property_ui_text(prop, "Shaded", "");
447 RNA_def_property_update(prop, 0, "rna_userdef_update");
449 prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
450 RNA_def_property_range(prop, -100, 100);
451 RNA_def_property_ui_text(prop, "Shade Top", "");
452 RNA_def_property_update(prop, 0, "rna_userdef_update");
454 prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
455 RNA_def_property_range(prop, -100, 100);
456 RNA_def_property_ui_text(prop, "Shade Down", "");
457 RNA_def_property_update(prop, 0, "rna_userdef_update");
460 static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
465 srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
466 RNA_def_struct_sdna(srna, "uiWidgetStateColors");
467 RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors");
469 prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
470 RNA_def_property_array(prop, 3);
471 RNA_def_property_ui_text(prop, "Animated", "");
472 RNA_def_property_update(prop, 0, "rna_userdef_update");
474 prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
475 RNA_def_property_array(prop, 3);
476 RNA_def_property_ui_text(prop, "Animated Selected", "");
477 RNA_def_property_update(prop, 0, "rna_userdef_update");
479 prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
480 RNA_def_property_array(prop, 3);
481 RNA_def_property_ui_text(prop, "Keyframe", "");
482 RNA_def_property_update(prop, 0, "rna_userdef_update");
484 prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
485 RNA_def_property_array(prop, 3);
486 RNA_def_property_ui_text(prop, "Keyframe Selected", "");
487 RNA_def_property_update(prop, 0, "rna_userdef_update");
489 prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
490 RNA_def_property_array(prop, 3);
491 RNA_def_property_ui_text(prop, "Driven", "");
492 RNA_def_property_update(prop, 0, "rna_userdef_update");
494 prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
495 RNA_def_property_array(prop, 3);
496 RNA_def_property_ui_text(prop, "Driven Selected", "");
497 RNA_def_property_update(prop, 0, "rna_userdef_update");
499 prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
500 RNA_def_property_ui_text(prop, "Blend", "");
501 RNA_def_property_update(prop, 0, "rna_userdef_update");
504 static void rna_def_userdef_theme_ui(BlenderRNA *brna)
509 rna_def_userdef_theme_ui_wcol(brna);
510 rna_def_userdef_theme_ui_wcol_state(brna);
512 srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
513 RNA_def_struct_sdna(srna, "ThemeUI");
514 RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements");
516 prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
517 RNA_def_property_flag(prop, PROP_NEVER_NULL);
518 RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
519 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
520 RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
521 RNA_def_property_update(prop, 0, "rna_userdef_update");
523 prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
524 RNA_def_property_flag(prop, PROP_NEVER_NULL);
525 RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
526 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
527 RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
528 RNA_def_property_update(prop, 0, "rna_userdef_update");
530 prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
531 RNA_def_property_flag(prop, PROP_NEVER_NULL);
532 RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
533 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
534 RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
535 RNA_def_property_update(prop, 0, "rna_userdef_update");
537 prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
538 RNA_def_property_flag(prop, PROP_NEVER_NULL);
539 RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
540 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
541 RNA_def_property_ui_text(prop, "Text Widget Colors", "");
542 RNA_def_property_update(prop, 0, "rna_userdef_update");
544 prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
545 RNA_def_property_flag(prop, PROP_NEVER_NULL);
546 RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
547 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
548 RNA_def_property_ui_text(prop, "Option Widget Colors", "");
549 RNA_def_property_update(prop, 0, "rna_userdef_update");
551 prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
552 RNA_def_property_flag(prop, PROP_NEVER_NULL);
553 RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
554 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
555 RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
556 RNA_def_property_update(prop, 0, "rna_userdef_update");
558 prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
559 RNA_def_property_flag(prop, PROP_NEVER_NULL);
560 RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
561 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
562 RNA_def_property_ui_text(prop, "Number Widget Colors", "");
563 RNA_def_property_update(prop, 0, "rna_userdef_update");
565 prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
566 RNA_def_property_flag(prop, PROP_NEVER_NULL);
567 RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
568 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
569 RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
570 RNA_def_property_update(prop, 0, "rna_userdef_update");
572 prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
573 RNA_def_property_flag(prop, PROP_NEVER_NULL);
574 RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
575 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
576 RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
577 RNA_def_property_update(prop, 0, "rna_userdef_update");
579 prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
580 RNA_def_property_flag(prop, PROP_NEVER_NULL);
581 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
582 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
583 RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
584 RNA_def_property_update(prop, 0, "rna_userdef_update");
586 prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
587 RNA_def_property_flag(prop, PROP_NEVER_NULL);
588 RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
589 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
590 RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
591 RNA_def_property_update(prop, 0, "rna_userdef_update");
593 prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
594 RNA_def_property_flag(prop, PROP_NEVER_NULL);
595 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
596 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
597 RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
598 RNA_def_property_update(prop, 0, "rna_userdef_update");
600 prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
601 RNA_def_property_flag(prop, PROP_NEVER_NULL);
602 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
603 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
604 RNA_def_property_ui_text(prop, "Menu Item Colors", "");
605 RNA_def_property_update(prop, 0, "rna_userdef_update");
607 prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
608 RNA_def_property_flag(prop, PROP_NEVER_NULL);
609 RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
610 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
611 RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
612 RNA_def_property_update(prop, 0, "rna_userdef_update");
614 prop= RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
615 RNA_def_property_flag(prop, PROP_NEVER_NULL);
616 RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress");
617 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
618 RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
619 RNA_def_property_update(prop, 0, "rna_userdef_update");
621 prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
622 RNA_def_property_flag(prop, PROP_NEVER_NULL);
623 RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
624 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
625 RNA_def_property_ui_text(prop, "List Item Colors", "");
626 RNA_def_property_update(prop, 0, "rna_userdef_update");
628 prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
629 RNA_def_property_flag(prop, PROP_NEVER_NULL);
630 RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
631 RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
632 RNA_def_property_ui_text(prop, "State Colors", "");
633 RNA_def_property_update(prop, 0, "rna_userdef_update");
635 prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
636 RNA_def_property_string_sdna(prop, NULL, "iconfile");
637 RNA_def_property_ui_text(prop, "Icon File", "");
638 RNA_def_property_update(prop, 0, "rna_userdef_update");
641 static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype)
646 prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
647 RNA_def_property_array(prop, 3);
648 RNA_def_property_ui_text(prop, "Window Background", "");
649 RNA_def_property_update(prop, 0, "rna_userdef_update");
651 prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
652 RNA_def_property_array(prop, 3);
653 RNA_def_property_ui_text(prop, "Title", "");
654 RNA_def_property_update(prop, 0, "rna_userdef_update");
656 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
657 RNA_def_property_array(prop, 3);
658 RNA_def_property_ui_text(prop, "Text", "");
659 RNA_def_property_update(prop, 0, "rna_userdef_update");
661 prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
662 RNA_def_property_array(prop, 3);
663 RNA_def_property_ui_text(prop, "Text Highlight", "");
664 RNA_def_property_update(prop, 0, "rna_userdef_update");
667 prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
668 RNA_def_property_array(prop, 3);
669 RNA_def_property_ui_text(prop, "Header", "");
670 RNA_def_property_update(prop, 0, "rna_userdef_update");
672 prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
673 RNA_def_property_array(prop, 3);
674 RNA_def_property_ui_text(prop, "Header Text", "");
675 RNA_def_property_update(prop, 0, "rna_userdef_update");
677 prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
678 RNA_def_property_array(prop, 3);
679 RNA_def_property_ui_text(prop, "Header Text Highlight", "");
680 RNA_def_property_update(prop, 0, "rna_userdef_update");
683 // if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) {
684 prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
685 RNA_def_property_array(prop, 3);
686 RNA_def_property_ui_text(prop, "Region Background", "");
687 RNA_def_property_update(prop, 0, "rna_userdef_update");
689 prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA);
690 RNA_def_property_array(prop, 3);
691 RNA_def_property_ui_text(prop, "Region Text Titles", "");
692 RNA_def_property_update(prop, 0, "rna_userdef_update");
694 prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA);
695 RNA_def_property_array(prop, 3);
696 RNA_def_property_ui_text(prop, "Region Text", "");
697 RNA_def_property_update(prop, 0, "rna_userdef_update");
699 prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
700 RNA_def_property_array(prop, 3);
701 RNA_def_property_ui_text(prop, "Region Text Highlight", "");
702 RNA_def_property_update(prop, 0, "rna_userdef_update");
706 if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) {
707 prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA);
708 RNA_def_property_array(prop, 3);
709 RNA_def_property_ui_text(prop, "Source List", "");
710 RNA_def_property_update(prop, 0, "rna_userdef_update");
712 prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA);
713 RNA_def_property_array(prop, 3);
714 RNA_def_property_ui_text(prop, "Source List Title", "");
715 RNA_def_property_update(prop, 0, "rna_userdef_update");
717 prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA);
718 RNA_def_property_array(prop, 3);
719 RNA_def_property_ui_text(prop, "Source List Text", "");
720 RNA_def_property_update(prop, 0, "rna_userdef_update");
722 prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
723 RNA_def_property_array(prop, 3);
724 RNA_def_property_ui_text(prop, "Source List Text Highlight", "");
725 RNA_def_property_update(prop, 0, "rna_userdef_update");
729 static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna)
733 prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
734 RNA_def_property_array(prop, 3);
735 RNA_def_property_ui_text(prop, "Vertex", "");
736 RNA_def_property_update(prop, 0, "rna_userdef_update");
738 prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
739 RNA_def_property_array(prop, 3);
740 RNA_def_property_ui_text(prop, "Vertex Select", "");
741 RNA_def_property_update(prop, 0, "rna_userdef_update");
743 prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
744 RNA_def_property_range(prop, 1, 10);
745 RNA_def_property_ui_text(prop, "Vertex Size", "");
746 RNA_def_property_update(prop, 0, "rna_userdef_update");
749 static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
753 prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
754 RNA_def_property_array(prop, 3);
755 RNA_def_property_ui_text(prop, "Edge Select", "");
756 RNA_def_property_update(prop, 0, "rna_userdef_update");
758 prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR_GAMMA);
759 RNA_def_property_array(prop, 3);
760 RNA_def_property_ui_text(prop, "Edge Seam", "");
761 RNA_def_property_update(prop, 0, "rna_userdef_update");
763 prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
764 RNA_def_property_array(prop, 3);
765 RNA_def_property_ui_text(prop, "Edge Sharp", "");
766 RNA_def_property_update(prop, 0, "rna_userdef_update");
768 prop= RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR_GAMMA);
769 RNA_def_property_array(prop, 3);
770 RNA_def_property_ui_text(prop, "Edge Crease", "");
771 RNA_def_property_update(prop, 0, "rna_userdef_update");
773 prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR_GAMMA);
774 RNA_def_property_array(prop, 3);
775 RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
776 RNA_def_property_update(prop, 0, "rna_userdef_update");
779 static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
783 prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
784 RNA_def_property_array(prop, 4);
785 RNA_def_property_ui_text(prop, "Face", "");
786 RNA_def_property_update(prop, 0, "rna_userdef_update");
788 prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
789 RNA_def_property_array(prop, 4);
790 RNA_def_property_ui_text(prop, "Face Selected", "");
791 RNA_def_property_update(prop, 0, "rna_userdef_update");
793 prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR_GAMMA);
794 RNA_def_property_array(prop, 3);
795 RNA_def_property_ui_text(prop, "Face Dot Selected", "");
796 RNA_def_property_update(prop, 0, "rna_userdef_update");
798 prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
799 RNA_def_property_range(prop, 1, 10);
800 RNA_def_property_ui_text(prop, "Face Dot Size", "");
801 RNA_def_property_update(prop, 0, "rna_userdef_update");
804 static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurbs)
809 prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
810 RNA_def_property_float_sdna(prop, NULL, "nurb_uline");
811 RNA_def_property_array(prop, 3);
812 RNA_def_property_ui_text(prop, "Nurb U-lines", "");
813 RNA_def_property_update(prop, 0, "rna_userdef_update");
815 prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
816 RNA_def_property_float_sdna(prop, NULL, "nurb_vline");
817 RNA_def_property_array(prop, 3);
818 RNA_def_property_ui_text(prop, "Nurb V-lines", "");
819 RNA_def_property_update(prop, 0, "rna_userdef_update");
821 prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
822 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline");
823 RNA_def_property_array(prop, 3);
824 RNA_def_property_ui_text(prop, "Nurb active U-lines", "");
825 RNA_def_property_update(prop, 0, "rna_userdef_update");
827 prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
828 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline");
829 RNA_def_property_array(prop, 3);
830 RNA_def_property_ui_text(prop, "Nurb active V-lines", "");
831 RNA_def_property_update(prop, 0, "rna_userdef_update");
833 prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR_GAMMA);
834 RNA_def_property_float_sdna(prop, NULL, "act_spline");
835 RNA_def_property_array(prop, 3);
836 RNA_def_property_ui_text(prop, "Active spline", "");
837 RNA_def_property_update(prop, 0, "rna_userdef_update");
840 prop= RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
841 RNA_def_property_float_sdna(prop, NULL, "handle_free");
842 RNA_def_property_array(prop, 3);
843 RNA_def_property_ui_text(prop, "Free handle color", "");
844 RNA_def_property_update(prop, 0, "rna_userdef_update");
846 prop= RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
847 RNA_def_property_float_sdna(prop, NULL, "handle_auto");
848 RNA_def_property_array(prop, 3);
849 RNA_def_property_ui_text(prop, "Auto handle color", "");
850 RNA_def_property_update(prop, 0, "rna_userdef_update");
852 prop= RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
853 RNA_def_property_float_sdna(prop, NULL, "handle_vect");
854 RNA_def_property_array(prop, 3);
855 RNA_def_property_ui_text(prop, "Vector handle color", "");
856 RNA_def_property_update(prop, 0, "rna_userdef_update");
858 prop= RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
859 RNA_def_property_float_sdna(prop, NULL, "handle_align");
860 RNA_def_property_array(prop, 3);
861 RNA_def_property_ui_text(prop, "Align handle color", "");
862 RNA_def_property_update(prop, 0, "rna_userdef_update");
864 prop= RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
865 RNA_def_property_float_sdna(prop, NULL, "handle_sel_free");
866 RNA_def_property_array(prop, 3);
867 RNA_def_property_ui_text(prop, "Free handle selected color", "");
868 RNA_def_property_update(prop, 0, "rna_userdef_update");
870 prop= RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
871 RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto");
872 RNA_def_property_array(prop, 3);
873 RNA_def_property_ui_text(prop, "Auto handle selected color", "");
874 RNA_def_property_update(prop, 0, "rna_userdef_update");
876 prop= RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
877 RNA_def_property_float_sdna(prop, NULL, "handle_sel_vect");
878 RNA_def_property_array(prop, 3);
879 RNA_def_property_ui_text(prop, "Vector handle selected color", "");
880 RNA_def_property_update(prop, 0, "rna_userdef_update");
882 prop= RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
883 RNA_def_property_float_sdna(prop, NULL, "handle_sel_align");
884 RNA_def_property_array(prop, 3);
885 RNA_def_property_ui_text(prop, "Align handle selected color", "");
886 RNA_def_property_update(prop, 0, "rna_userdef_update");
888 if (incl_nurbs == 0) {
889 /* assume that when nurbs are off, this is for 2D (i.e. anim) editors */
890 prop= RNA_def_property(srna, "handle_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
891 RNA_def_property_float_sdna(prop, NULL, "handle_auto_clamped");
892 RNA_def_property_array(prop, 3);
893 RNA_def_property_ui_text(prop, "Auto-Clamped handle color", "");
894 RNA_def_property_update(prop, 0, "rna_userdef_update");
896 prop= RNA_def_property(srna, "handle_sel_auto_clamped", PROP_FLOAT, PROP_COLOR_GAMMA);
897 RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto_clamped");
898 RNA_def_property_array(prop, 3);
899 RNA_def_property_ui_text(prop, "Auto-Clamped handle selected color", "");
900 RNA_def_property_update(prop, 0, "rna_userdef_update");
903 prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR_GAMMA);
904 RNA_def_property_float_sdna(prop, NULL, "lastsel_point");
905 RNA_def_property_array(prop, 3);
906 RNA_def_property_ui_text(prop, "Last selected point", "");
907 RNA_def_property_update(prop, 0, "rna_userdef_update");
910 static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
917 srna= RNA_def_struct(brna, "ThemeView3D", NULL);
918 RNA_def_struct_sdna(srna, "ThemeSpace");
919 RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
921 rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D);
923 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
924 RNA_def_property_array(prop, 3);
925 RNA_def_property_ui_text(prop, "Grid", "");
926 RNA_def_property_update(prop, 0, "rna_userdef_update");
928 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
929 RNA_def_property_array(prop, 4);
930 RNA_def_property_ui_text(prop, "Panel", "");
931 RNA_def_property_update(prop, 0, "rna_userdef_update");
933 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
934 RNA_def_property_array(prop, 3);
935 RNA_def_property_ui_text(prop, "Wire", "");
936 RNA_def_property_update(prop, 0, "rna_userdef_update");
938 prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA);
939 RNA_def_property_array(prop, 4);
940 RNA_def_property_ui_text(prop, "Lamp", "");
941 RNA_def_property_update(prop, 0, "rna_userdef_update");
943 prop= RNA_def_property(srna, "speaker", PROP_FLOAT, PROP_COLOR_GAMMA);
944 RNA_def_property_array(prop, 3);
945 RNA_def_property_ui_text(prop, "Speaker", "");
946 RNA_def_property_update(prop, 0, "rna_userdef_update");
948 prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
949 RNA_def_property_float_sdna(prop, NULL, "select");
950 RNA_def_property_array(prop, 3);
951 RNA_def_property_ui_text(prop, "Object Selected", "");
952 RNA_def_property_update(prop, 0, "rna_userdef_update");
954 prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
955 RNA_def_property_float_sdna(prop, NULL, "active");
956 RNA_def_property_array(prop, 3);
957 RNA_def_property_ui_text(prop, "Active Object", "");
958 RNA_def_property_update(prop, 0, "rna_userdef_update");
960 prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR_GAMMA);
961 RNA_def_property_float_sdna(prop, NULL, "group");
962 RNA_def_property_array(prop, 3);
963 RNA_def_property_ui_text(prop, "Object Grouped", "");
964 RNA_def_property_update(prop, 0, "rna_userdef_update");
966 prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR_GAMMA);
967 RNA_def_property_float_sdna(prop, NULL, "group_active");
968 RNA_def_property_array(prop, 3);
969 RNA_def_property_ui_text(prop, "Object Grouped Active", "");
970 RNA_def_property_update(prop, 0, "rna_userdef_update");
972 prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
973 RNA_def_property_array(prop, 3);
974 RNA_def_property_ui_text(prop, "Transform", "");
975 RNA_def_property_update(prop, 0, "rna_userdef_update");
977 rna_def_userdef_theme_spaces_vertex(srna);
978 rna_def_userdef_theme_spaces_edge(srna);
979 rna_def_userdef_theme_spaces_face(srna);
980 rna_def_userdef_theme_spaces_curves(srna, 1);
982 prop= RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
983 RNA_def_property_array(prop, 3);
984 RNA_def_property_ui_text(prop, "Edge Length Text", "");
985 RNA_def_property_update(prop, 0, "rna_userdef_update");
987 prop= RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
988 RNA_def_property_array(prop, 3);
989 RNA_def_property_ui_text(prop, "Face Angle Text", "");
990 RNA_def_property_update(prop, 0, "rna_userdef_update");
992 prop= RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
993 RNA_def_property_array(prop, 3);
994 RNA_def_property_ui_text(prop, "Face Area Text", "");
995 RNA_def_property_update(prop, 0, "rna_userdef_update");
997 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
998 RNA_def_property_array(prop, 4);
999 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
1000 RNA_def_property_update(prop, 0, "rna_userdef_update");
1002 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
1003 RNA_def_property_array(prop, 3);
1004 RNA_def_property_ui_text(prop, "Face Normal", "");
1005 RNA_def_property_update(prop, 0, "rna_userdef_update");
1007 prop= RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
1008 RNA_def_property_array(prop, 3);
1009 RNA_def_property_ui_text(prop, "Vertex Normal", "");
1010 RNA_def_property_update(prop, 0, "rna_userdef_update");
1012 prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
1013 RNA_def_property_array(prop, 3);
1014 RNA_def_property_ui_text(prop, "Bone Solid", "");
1015 RNA_def_property_update(prop, 0, "rna_userdef_update");
1017 prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
1018 RNA_def_property_array(prop, 3);
1019 RNA_def_property_ui_text(prop, "Bone Pose", "");
1020 RNA_def_property_update(prop, 0, "rna_userdef_update");
1022 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1023 RNA_def_property_float_sdna(prop, NULL, "cframe");
1024 RNA_def_property_array(prop, 3);
1025 RNA_def_property_ui_text(prop, "Current Frame", "");
1026 RNA_def_property_update(prop, 0, "rna_userdef_update");
1028 prop= RNA_def_property(srna, "outline_width", PROP_INT, PROP_NONE);
1029 RNA_def_property_range(prop, 1, 5);
1030 RNA_def_property_ui_text(prop, "Outline Width", "");
1031 RNA_def_property_update(prop, 0, "rna_userdef_update");
1034 static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
1041 srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
1042 RNA_def_struct_sdna(srna, "ThemeSpace");
1043 RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
1045 rna_def_userdef_theme_spaces_main(srna, SPACE_IPO);
1047 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1048 RNA_def_property_array(prop, 3);
1049 RNA_def_property_ui_text(prop, "Grid", "");
1050 RNA_def_property_update(prop, 0, "rna_userdef_update");
1052 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1053 RNA_def_property_array(prop, 3);
1054 RNA_def_property_ui_text(prop, "Panel", "");
1055 RNA_def_property_update(prop, 0, "rna_userdef_update");
1057 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1058 RNA_def_property_float_sdna(prop, NULL, "shade1");
1059 RNA_def_property_array(prop, 3);
1060 RNA_def_property_ui_text(prop, "Window Sliders", "");
1061 RNA_def_property_update(prop, 0, "rna_userdef_update");
1063 prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR_GAMMA);
1064 RNA_def_property_float_sdna(prop, NULL, "shade2");
1065 RNA_def_property_array(prop, 3);
1066 RNA_def_property_ui_text(prop, "Channels Region", "");
1067 RNA_def_property_update(prop, 0, "rna_userdef_update");
1069 rna_def_userdef_theme_spaces_vertex(srna);
1070 rna_def_userdef_theme_spaces_curves(srna, 0);
1072 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1073 RNA_def_property_float_sdna(prop, NULL, "cframe");
1074 RNA_def_property_array(prop, 3);
1075 RNA_def_property_ui_text(prop, "Current Frame", "");
1076 RNA_def_property_update(prop, 0, "rna_userdef_update");
1078 prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
1079 RNA_def_property_array(prop, 3);
1080 RNA_def_property_ui_text(prop, "Handle Vertex", "");
1081 RNA_def_property_update(prop, 0, "rna_userdef_update");
1083 prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
1084 RNA_def_property_array(prop, 3);
1085 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
1086 RNA_def_property_update(prop, 0, "rna_userdef_update");
1088 prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
1089 RNA_def_property_range(prop, 0, 255);
1090 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
1091 RNA_def_property_update(prop, 0, "rna_userdef_update");
1093 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1094 RNA_def_property_float_sdna(prop, NULL, "group");
1095 RNA_def_property_array(prop, 3);
1096 RNA_def_property_ui_text(prop, "Channel Group", "");
1097 RNA_def_property_update(prop, 0, "rna_userdef_update");
1099 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1100 RNA_def_property_float_sdna(prop, NULL, "group_active");
1101 RNA_def_property_array(prop, 3);
1102 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1103 RNA_def_property_update(prop, 0, "rna_userdef_update");
1105 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
1106 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1107 RNA_def_property_array(prop, 3);
1108 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1109 RNA_def_property_update(prop, 0, "rna_userdef_update");
1111 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
1112 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1113 RNA_def_property_array(prop, 3);
1114 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1115 RNA_def_property_update(prop, 0, "rna_userdef_update");
1118 static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
1125 srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL);
1126 RNA_def_struct_sdna(srna, "ThemeSpace");
1127 RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
1129 rna_def_userdef_theme_spaces_main(srna, SPACE_FILE);
1131 prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA);
1132 RNA_def_property_float_sdna(prop, NULL, "hilite");
1133 RNA_def_property_array(prop, 3);
1134 RNA_def_property_ui_text(prop, "Selected File", "");
1135 RNA_def_property_update(prop, 0, "rna_userdef_update");
1137 prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR_GAMMA);
1138 RNA_def_property_float_sdna(prop, NULL, "panel");
1139 RNA_def_property_array(prop, 3);
1140 RNA_def_property_ui_text(prop, "Tiles", "");
1141 RNA_def_property_update(prop, 0, "rna_userdef_update");
1143 prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR_GAMMA);
1144 RNA_def_property_float_sdna(prop, NULL, "shade1");
1145 RNA_def_property_array(prop, 3);
1146 RNA_def_property_ui_text(prop, "Scrollbar", "");
1147 RNA_def_property_update(prop, 0, "rna_userdef_update");
1149 prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR_GAMMA);
1150 RNA_def_property_float_sdna(prop, NULL, "shade2");
1151 RNA_def_property_array(prop, 3);
1152 RNA_def_property_ui_text(prop, "Scroll Handle", "");
1153 RNA_def_property_update(prop, 0, "rna_userdef_update");
1155 prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR_GAMMA);
1156 RNA_def_property_float_sdna(prop, NULL, "active");
1157 RNA_def_property_array(prop, 3);
1158 RNA_def_property_ui_text(prop, "Active File", "");
1159 RNA_def_property_update(prop, 0, "rna_userdef_update");
1161 prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1162 RNA_def_property_float_sdna(prop, NULL, "grid");
1163 RNA_def_property_array(prop, 3);
1164 RNA_def_property_ui_text(prop, "Active File Text", "");
1165 RNA_def_property_update(prop, 0, "rna_userdef_update");
1168 static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
1172 /* space_outliner */
1174 srna= RNA_def_struct(brna, "ThemeOutliner", NULL);
1175 RNA_def_struct_sdna(srna, "ThemeSpace");
1176 RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
1178 rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER);
1181 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
1185 /* space_userpref */
1187 srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
1188 RNA_def_struct_sdna(srna, "ThemeSpace");
1189 RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
1191 rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
1194 static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
1201 srna= RNA_def_struct(brna, "ThemeConsole", NULL);
1202 RNA_def_struct_sdna(srna, "ThemeSpace");
1203 RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
1205 rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE);
1207 prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
1208 RNA_def_property_float_sdna(prop, NULL, "console_output");
1209 RNA_def_property_array(prop, 3);
1210 RNA_def_property_ui_text(prop, "Line Output", "");
1211 RNA_def_property_update(prop, 0, "rna_userdef_update");
1213 prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
1214 RNA_def_property_float_sdna(prop, NULL, "console_input");
1215 RNA_def_property_array(prop, 3);
1216 RNA_def_property_ui_text(prop, "Line Input", "");
1217 RNA_def_property_update(prop, 0, "rna_userdef_update");
1219 prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
1220 RNA_def_property_float_sdna(prop, NULL, "console_info");
1221 RNA_def_property_array(prop, 3);
1222 RNA_def_property_ui_text(prop, "Line Info", "");
1223 RNA_def_property_update(prop, 0, "rna_userdef_update");
1225 prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
1226 RNA_def_property_float_sdna(prop, NULL, "console_error");
1227 RNA_def_property_array(prop, 3);
1228 RNA_def_property_ui_text(prop, "Line Error", "");
1229 RNA_def_property_update(prop, 0, "rna_userdef_update");
1231 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
1232 RNA_def_property_float_sdna(prop, NULL, "console_cursor");
1233 RNA_def_property_array(prop, 3);
1234 RNA_def_property_ui_text(prop, "Cursor", "");
1235 RNA_def_property_update(prop, 0, "rna_userdef_update");
1238 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
1244 srna= RNA_def_struct(brna, "ThemeInfo", NULL);
1245 RNA_def_struct_sdna(srna, "ThemeSpace");
1246 RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
1248 rna_def_userdef_theme_spaces_main(srna, SPACE_INFO);
1252 static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
1259 srna= RNA_def_struct(brna, "ThemeTextEditor", NULL);
1260 RNA_def_struct_sdna(srna, "ThemeSpace");
1261 RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
1263 rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT);
1265 prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
1266 RNA_def_property_float_sdna(prop, NULL, "grid");
1267 RNA_def_property_array(prop, 3);
1268 RNA_def_property_ui_text(prop, "Line Numbers Background", "");
1269 RNA_def_property_update(prop, 0, "rna_userdef_update");
1271 prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
1272 RNA_def_property_float_sdna(prop, NULL, "shade1");
1273 RNA_def_property_array(prop, 3);
1274 RNA_def_property_ui_text(prop, "Scroll Bar", "");
1275 RNA_def_property_update(prop, 0, "rna_userdef_update");
1277 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1278 RNA_def_property_float_sdna(prop, NULL, "shade2");
1279 RNA_def_property_array(prop, 3);
1280 RNA_def_property_ui_text(prop, "Selected Text", "");
1281 RNA_def_property_update(prop, 0, "rna_userdef_update");
1283 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
1284 RNA_def_property_float_sdna(prop, NULL, "hilite");
1285 RNA_def_property_array(prop, 3);
1286 RNA_def_property_ui_text(prop, "Cursor", "");
1287 RNA_def_property_update(prop, 0, "rna_userdef_update");
1289 prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
1290 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1291 RNA_def_property_array(prop, 3);
1292 RNA_def_property_ui_text(prop, "Syntax Built-in", "");
1293 RNA_def_property_update(prop, 0, "rna_userdef_update");
1295 prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
1296 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1297 RNA_def_property_array(prop, 3);
1298 RNA_def_property_ui_text(prop, "Syntax Special", "");
1299 RNA_def_property_update(prop, 0, "rna_userdef_update");
1301 prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
1302 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1303 RNA_def_property_array(prop, 3);
1304 RNA_def_property_ui_text(prop, "Syntax Comment", "");
1305 RNA_def_property_update(prop, 0, "rna_userdef_update");
1307 prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
1308 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1309 RNA_def_property_array(prop, 3);
1310 RNA_def_property_ui_text(prop, "Syntax String", "");
1311 RNA_def_property_update(prop, 0, "rna_userdef_update");
1313 prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
1314 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1315 RNA_def_property_array(prop, 3);
1316 RNA_def_property_ui_text(prop, "Syntax Numbers", "");
1317 RNA_def_property_update(prop, 0, "rna_userdef_update");
1320 static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
1327 srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL);
1328 RNA_def_struct_sdna(srna, "ThemeSpace");
1329 RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
1331 rna_def_userdef_theme_spaces_main(srna, SPACE_NODE);
1333 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
1334 RNA_def_property_float_sdna(prop, NULL, "wire");
1335 RNA_def_property_array(prop, 3);
1336 RNA_def_property_ui_text(prop, "Wires", "");
1337 RNA_def_property_update(prop, 0, "rna_userdef_update");
1339 prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
1340 RNA_def_property_float_sdna(prop, NULL, "edge_select");
1341 RNA_def_property_array(prop, 3);
1342 RNA_def_property_ui_text(prop, "Wire Select", "");
1343 RNA_def_property_update(prop, 0, "rna_userdef_update");
1345 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1346 RNA_def_property_float_sdna(prop, NULL, "shade2");
1347 RNA_def_property_array(prop, 3);
1348 RNA_def_property_ui_text(prop, "Selected Text", "");
1349 RNA_def_property_update(prop, 0, "rna_userdef_update");
1351 prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
1352 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1353 RNA_def_property_array(prop, 4);
1354 RNA_def_property_ui_text(prop, "Node Backdrop", "");
1355 RNA_def_property_update(prop, 0, "rna_userdef_update");
1357 prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1358 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1359 RNA_def_property_array(prop, 3);
1360 RNA_def_property_ui_text(prop, "In/Out Node", "");
1361 RNA_def_property_update(prop, 0, "rna_userdef_update");
1363 prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1364 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1365 RNA_def_property_array(prop, 3);
1366 RNA_def_property_ui_text(prop, "Converter Node", "");
1367 RNA_def_property_update(prop, 0, "rna_userdef_update");
1369 prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1370 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1371 RNA_def_property_array(prop, 3);
1372 RNA_def_property_ui_text(prop, "Operator Node", "");
1373 RNA_def_property_update(prop, 0, "rna_userdef_update");
1375 prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1376 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1377 RNA_def_property_array(prop, 3);
1378 RNA_def_property_ui_text(prop, "Group Node", "");
1379 RNA_def_property_update(prop, 0, "rna_userdef_update");
1381 prop= RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
1382 RNA_def_property_int_sdna(prop, NULL, "noodle_curving");
1383 RNA_def_property_int_default(prop, 5);
1384 RNA_def_property_range(prop, 0, 10);
1385 RNA_def_property_ui_text(prop, "Noodle curving", "Curving of the noodle");
1386 RNA_def_property_update(prop, 0, "rna_userdef_update");
1389 static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
1396 srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL);
1397 RNA_def_struct_sdna(srna, "ThemeSpace");
1398 RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor");
1400 rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC);
1402 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1403 RNA_def_property_array(prop, 3);
1404 RNA_def_property_ui_text(prop, "Panel", "");
1405 RNA_def_property_update(prop, 0, "rna_userdef_update");
1409 static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
1416 srna= RNA_def_struct(brna, "ThemeProperties", NULL);
1417 RNA_def_struct_sdna(srna, "ThemeSpace");
1418 RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
1420 rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS);
1422 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1423 RNA_def_property_array(prop, 3);
1424 RNA_def_property_ui_text(prop, "Panel", "");
1425 RNA_def_property_update(prop, 0, "rna_userdef_update");
1428 static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
1435 srna= RNA_def_struct(brna, "ThemeTimeline", NULL);
1436 RNA_def_struct_sdna(srna, "ThemeSpace");
1437 RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline");
1439 rna_def_userdef_theme_spaces_main(srna, SPACE_TIME);
1441 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1442 RNA_def_property_array(prop, 3);
1443 RNA_def_property_ui_text(prop, "Grid", "");
1444 RNA_def_property_update(prop, 0, "rna_userdef_update");
1446 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1447 RNA_def_property_float_sdna(prop, NULL, "cframe");
1448 RNA_def_property_array(prop, 3);
1449 RNA_def_property_ui_text(prop, "Current Frame", "");
1450 RNA_def_property_update(prop, 0, "rna_userdef_update");
1453 static void rna_def_userdef_theme_space_sound(BlenderRNA *brna)
1460 srna= RNA_def_struct(brna, "ThemeAudioWindow", NULL);
1461 RNA_def_struct_sdna(srna, "ThemeSpace");
1462 RNA_def_struct_ui_text(srna, "Theme Audio Window", "Theme settings for the Audio Window");
1464 rna_def_userdef_theme_spaces_main(srna, SPACE_SOUND);
1466 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1467 RNA_def_property_array(prop, 3);
1468 RNA_def_property_ui_text(prop, "Grid", "");
1469 RNA_def_property_update(prop, 0, "rna_userdef_update");
1471 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1472 RNA_def_property_float_sdna(prop, NULL, "shade1");
1473 RNA_def_property_array(prop, 3);
1474 RNA_def_property_ui_text(prop, "Window Sliders", "");
1475 RNA_def_property_update(prop, 0, "rna_userdef_update");
1477 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1478 RNA_def_property_float_sdna(prop, NULL, "cframe");
1479 RNA_def_property_array(prop, 3);
1480 RNA_def_property_ui_text(prop, "Current Frame", "");
1481 RNA_def_property_update(prop, 0, "rna_userdef_update");
1484 static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
1491 srna= RNA_def_struct(brna, "ThemeImageEditor", NULL);
1492 RNA_def_struct_sdna(srna, "ThemeSpace");
1493 RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
1495 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1496 rna_def_userdef_theme_spaces_vertex(srna);
1497 rna_def_userdef_theme_spaces_face(srna);
1499 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
1500 RNA_def_property_array(prop, 4);
1501 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
1502 RNA_def_property_update(prop, 0, "rna_userdef_update");
1504 prop= RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
1505 RNA_def_property_float_sdna(prop, NULL, "preview_back");
1506 RNA_def_property_array(prop, 4);
1507 RNA_def_property_ui_text(prop, "Scope region background color", "");
1508 RNA_def_property_update(prop, 0, "rna_userdef_update");
1511 static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
1518 srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
1519 RNA_def_struct_sdna(srna, "ThemeSpace");
1520 RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
1522 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1524 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1525 RNA_def_property_array(prop, 3);
1526 RNA_def_property_ui_text(prop, "Grid", "");
1527 RNA_def_property_update(prop, 0, "rna_userdef_update");
1529 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1530 RNA_def_property_float_sdna(prop, NULL, "shade1");
1531 RNA_def_property_array(prop, 3);
1532 RNA_def_property_ui_text(prop, "Window Sliders", "");
1533 RNA_def_property_update(prop, 0, "rna_userdef_update");
1535 prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1536 RNA_def_property_float_sdna(prop, NULL, "movie");
1537 RNA_def_property_array(prop, 3);
1538 RNA_def_property_ui_text(prop, "Movie Strip", "");
1539 RNA_def_property_update(prop, 0, "rna_userdef_update");
1541 prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1542 RNA_def_property_float_sdna(prop, NULL, "image");
1543 RNA_def_property_array(prop, 3);
1544 RNA_def_property_ui_text(prop, "Image Strip", "");
1545 RNA_def_property_update(prop, 0, "rna_userdef_update");
1547 prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1548 RNA_def_property_float_sdna(prop, NULL, "scene");
1549 RNA_def_property_array(prop, 3);
1550 RNA_def_property_ui_text(prop, "Scene Strip", "");
1551 RNA_def_property_update(prop, 0, "rna_userdef_update");
1553 prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1554 RNA_def_property_float_sdna(prop, NULL, "audio");
1555 RNA_def_property_array(prop, 3);
1556 RNA_def_property_ui_text(prop, "Audio Strip", "");
1557 RNA_def_property_update(prop, 0, "rna_userdef_update");
1559 prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1560 RNA_def_property_float_sdna(prop, NULL, "effect");
1561 RNA_def_property_array(prop, 3);
1562 RNA_def_property_ui_text(prop, "Effect Strip", "");
1563 RNA_def_property_update(prop, 0, "rna_userdef_update");
1565 prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1566 RNA_def_property_float_sdna(prop, NULL, "plugin");
1567 RNA_def_property_array(prop, 3);
1568 RNA_def_property_ui_text(prop, "Plugin Strip", "");
1569 RNA_def_property_update(prop, 0, "rna_userdef_update");
1571 prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1572 RNA_def_property_float_sdna(prop, NULL, "transition");
1573 RNA_def_property_array(prop, 3);
1574 RNA_def_property_ui_text(prop, "Transition Strip", "");
1575 RNA_def_property_update(prop, 0, "rna_userdef_update");
1577 prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1578 RNA_def_property_float_sdna(prop, NULL, "meta");
1579 RNA_def_property_array(prop, 3);
1580 RNA_def_property_ui_text(prop, "Meta Strip", "");
1581 RNA_def_property_update(prop, 0, "rna_userdef_update");
1583 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1584 RNA_def_property_float_sdna(prop, NULL, "cframe");
1585 RNA_def_property_array(prop, 3);
1586 RNA_def_property_ui_text(prop, "Current Frame", "");
1587 RNA_def_property_update(prop, 0, "rna_userdef_update");
1589 prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
1590 RNA_def_property_float_sdna(prop, NULL, "vertex_select");
1591 RNA_def_property_array(prop, 3);
1592 RNA_def_property_ui_text(prop, "Keyframe", "");
1593 RNA_def_property_update(prop, 0, "rna_userdef_update");
1595 prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR_GAMMA);
1596 RNA_def_property_float_sdna(prop, NULL, "bone_pose");
1597 RNA_def_property_array(prop, 3);
1598 RNA_def_property_ui_text(prop, "Draw Action", "");
1599 RNA_def_property_update(prop, 0, "rna_userdef_update");
1602 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
1609 srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL);
1610 RNA_def_struct_sdna(srna, "ThemeSpace");
1611 RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet");
1613 rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION);
1615 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1616 RNA_def_property_array(prop, 3);
1617 RNA_def_property_ui_text(prop, "Grid", "");
1618 RNA_def_property_update(prop, 0, "rna_userdef_update");
1620 prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1621 RNA_def_property_float_sdna(prop, NULL, "face");
1622 RNA_def_property_array(prop, 3);
1623 RNA_def_property_ui_text(prop, "Value Sliders", "");
1624 RNA_def_property_update(prop, 0, "rna_userdef_update");
1626 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1627 RNA_def_property_float_sdna(prop, NULL, "shade1");
1628 RNA_def_property_array(prop, 3);
1629 RNA_def_property_ui_text(prop, "View Sliders", "");
1630 RNA_def_property_update(prop, 0, "rna_userdef_update");
1632 prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
1633 RNA_def_property_float_sdna(prop, NULL, "shade2");
1634 RNA_def_property_array(prop, 3);
1635 RNA_def_property_ui_text(prop, "Channels", "");
1636 RNA_def_property_update(prop, 0, "rna_userdef_update");
1638 prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1639 RNA_def_property_float_sdna(prop, NULL, "hilite");
1640 RNA_def_property_array(prop, 3);
1641 RNA_def_property_ui_text(prop, "Channels Selected", "");
1642 RNA_def_property_update(prop, 0, "rna_userdef_update");
1644 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1645 RNA_def_property_float_sdna(prop, NULL, "group");
1646 RNA_def_property_array(prop, 3);
1647 RNA_def_property_ui_text(prop, "Channel Group", "");
1648 RNA_def_property_update(prop, 0, "rna_userdef_update");
1650 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
1651 RNA_def_property_float_sdna(prop, NULL, "group_active");
1652 RNA_def_property_array(prop, 3);
1653 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1654 RNA_def_property_update(prop, 0, "rna_userdef_update");
1656 prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
1657 RNA_def_property_float_sdna(prop, NULL, "strip");
1658 RNA_def_property_array(prop, 3);
1659 RNA_def_property_ui_text(prop, "Long Key", "");
1660 RNA_def_property_update(prop, 0, "rna_userdef_update");
1662 prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1663 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1664 RNA_def_property_array(prop, 3);
1665 RNA_def_property_ui_text(prop, "Long Key Selected", "");
1666 RNA_def_property_update(prop, 0, "rna_userdef_update");
1668 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1669 RNA_def_property_float_sdna(prop, NULL, "cframe");
1670 RNA_def_property_array(prop, 3);
1671 RNA_def_property_ui_text(prop, "Current Frame", "");
1672 RNA_def_property_update(prop, 0, "rna_userdef_update");
1674 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
1675 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1676 RNA_def_property_array(prop, 3);
1677 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1678 RNA_def_property_update(prop, 0, "rna_userdef_update");
1680 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
1681 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1682 RNA_def_property_array(prop, 3);
1683 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1684 RNA_def_property_update(prop, 0, "rna_userdef_update");
1687 static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
1694 srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL);
1695 RNA_def_struct_sdna(srna, "ThemeSpace");
1696 RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor");
1698 rna_def_userdef_theme_spaces_main(srna, SPACE_NLA);
1700 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1701 RNA_def_property_array(prop, 3);
1702 RNA_def_property_ui_text(prop, "Grid", "");
1703 RNA_def_property_update(prop, 0, "rna_userdef_update");
1705 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1706 RNA_def_property_float_sdna(prop, NULL, "shade1");
1707 RNA_def_property_array(prop, 3);
1708 RNA_def_property_ui_text(prop, "View Sliders", "");
1709 RNA_def_property_update(prop, 0, "rna_userdef_update");
1711 prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR_GAMMA);
1712 RNA_def_property_float_sdna(prop, NULL, "shade2");
1713 RNA_def_property_array(prop, 3);
1714 RNA_def_property_ui_text(prop, "Bars", "");
1715 RNA_def_property_update(prop, 0, "rna_userdef_update");
1717 prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1718 RNA_def_property_float_sdna(prop, NULL, "hilite");
1719 RNA_def_property_array(prop, 3);
1720 RNA_def_property_ui_text(prop, "Bars Selected", "");
1721 RNA_def_property_update(prop, 0, "rna_userdef_update");
1723 prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
1724 RNA_def_property_float_sdna(prop, NULL, "strip");
1725 RNA_def_property_array(prop, 3);
1726 RNA_def_property_ui_text(prop, "Strips", "");
1727 RNA_def_property_update(prop, 0, "rna_userdef_update");
1729 prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1730 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1731 RNA_def_property_array(prop, 3);
1732 RNA_def_property_ui_text(prop, "Strips Selected", "");
1733 RNA_def_property_update(prop, 0, "rna_userdef_update");
1735 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1736 RNA_def_property_float_sdna(prop, NULL, "cframe");
1737 RNA_def_property_array(prop, 3);
1738 RNA_def_property_ui_text(prop, "Current Frame", "");
1739 RNA_def_property_update(prop, 0, "rna_userdef_update");
1742 static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
1747 srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
1748 RNA_def_struct_sdna(srna, "ThemeWireColor");
1749 RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
1751 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
1752 RNA_def_property_float_sdna(prop, NULL, "solid");
1753 RNA_def_property_array(prop, 3);
1754 RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
1755 RNA_def_property_update(prop, 0, "rna_userdef_update");
1757 prop= RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
1758 RNA_def_property_float_sdna(prop, NULL, "select");
1759 RNA_def_property_array(prop, 3);
1760 RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
1761 RNA_def_property_update(prop, 0, "rna_userdef_update");
1763 prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
1764 RNA_def_property_array(prop, 3);
1765 RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
1766 RNA_def_property_update(prop, 0, "rna_userdef_update");
1768 prop= RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
1769 RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
1770 RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
1771 RNA_def_property_update(prop, 0, "rna_userdef_update");
1774 static void rna_def_userdef_themes(BlenderRNA *brna)
1779 static EnumPropertyItem active_theme_area[] = {
1780 {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
1781 {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
1782 {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
1783 {2, "TIMELINE", ICON_TIME, "Timeline", ""},
1784 {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
1785 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
1786 {5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
1787 {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
1788 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
1789 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
1790 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
1791 {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
1792 {11, "PROPERTIES", ICON_BUTS, "Properties", ""},
1793 {12, "OUTLINER", ICON_OOPS, "Outliner", ""},
1794 {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
1795 {15, "INFO", ICON_INFO, "Info", ""},
1796 {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
1797 {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
1798 {0, NULL, 0, NULL, NULL}};
1800 srna= RNA_def_struct(brna, "Theme", NULL);
1801 RNA_def_struct_sdna(srna, "bTheme");
1802 RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface");
1804 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1805 RNA_def_property_ui_text(prop, "Name", "Name of the theme");
1806 RNA_def_struct_name_property(srna, prop);
1808 prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
1809 RNA_def_property_enum_sdna(prop, NULL, "active_theme_area");
1810 RNA_def_property_enum_items(prop, active_theme_area);
1811 RNA_def_property_ui_text(prop, "Active Theme Area", "");
1813 prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
1814 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1815 RNA_def_property_pointer_sdna(prop, NULL, "tui");
1816 RNA_def_property_struct_type(prop, "ThemeUserInterface");
1817 RNA_def_property_ui_text(prop, "User Interface", "");
1819 prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
1820 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1821 RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
1822 RNA_def_property_struct_type(prop, "ThemeView3D");
1823 RNA_def_property_ui_text(prop, "3D View", "");
1825 prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
1826 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1827 RNA_def_property_pointer_sdna(prop, NULL, "tipo");
1828 RNA_def_property_struct_type(prop, "ThemeGraphEditor");
1829 RNA_def_property_ui_text(prop, "Graph Editor", "");
1831 prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
1832 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1833 RNA_def_property_pointer_sdna(prop, NULL, "tfile");
1834 RNA_def_property_struct_type(prop, "ThemeFileBrowser");
1835 RNA_def_property_ui_text(prop, "File Browser", "");
1837 prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
1838 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1839 RNA_def_property_pointer_sdna(prop, NULL, "tnla");
1840 RNA_def_property_struct_type(prop, "ThemeNLAEditor");
1841 RNA_def_property_ui_text(prop, "NLA Editor", "");
1843 prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
1844 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1845 RNA_def_property_pointer_sdna(prop, NULL, "tact");
1846 RNA_def_property_struct_type(prop, "ThemeDopeSheet");
1847 RNA_def_property_ui_text(prop, "DopeSheet", "");
1849 prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
1850 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1851 RNA_def_property_pointer_sdna(prop, NULL, "tima");
1852 RNA_def_property_struct_type(prop, "ThemeImageEditor");
1853 RNA_def_property_ui_text(prop, "Image Editor", "");
1855 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
1856 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1857 RNA_def_property_pointer_sdna(prop, NULL, "tseq");
1858 RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
1859 RNA_def_property_ui_text(prop, "Sequence Editor", "");
1861 prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
1862 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1863 RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
1864 RNA_def_property_struct_type(prop, "ThemeProperties");
1865 RNA_def_property_ui_text(prop, "Properties", "");
1867 prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
1868 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1869 RNA_def_property_pointer_sdna(prop, NULL, "text");
1870 RNA_def_property_struct_type(prop, "ThemeTextEditor");
1871 RNA_def_property_ui_text(prop, "Text Editor", "");
1873 prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
1874 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1875 RNA_def_property_pointer_sdna(prop, NULL, "ttime");
1876 RNA_def_property_struct_type(prop, "ThemeTimeline");
1877 RNA_def_property_ui_text(prop, "Timeline", "");
1879 prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
1880 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1881 RNA_def_property_pointer_sdna(prop, NULL, "tnode");
1882 RNA_def_property_struct_type(prop, "ThemeNodeEditor");
1883 RNA_def_property_ui_text(prop, "Node Editor", "");
1885 prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
1886 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1887 RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
1888 RNA_def_property_struct_type(prop, "ThemeLogicEditor");
1889 RNA_def_property_ui_text(prop, "Logic Editor", "");
1891 prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
1892 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1893 RNA_def_property_pointer_sdna(prop, NULL, "toops");
1894 RNA_def_property_struct_type(prop, "ThemeOutliner");
1895 RNA_def_property_ui_text(prop, "Outliner", "");
1897 prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
1898 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1899 RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
1900 RNA_def_property_struct_type(prop, "ThemeInfo");
1901 RNA_def_property_ui_text(prop, "Info", "");
1903 prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
1904 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1905 RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
1906 RNA_def_property_struct_type(prop, "ThemeUserPreferences");
1907 RNA_def_property_ui_text(prop, "User Preferences", "");
1909 prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
1910 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1911 RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
1912 RNA_def_property_struct_type(prop, "ThemeConsole");
1913 RNA_def_property_ui_text(prop, "Console", "");
1915 prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
1916 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1917 RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
1918 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
1919 RNA_def_property_ui_text(prop, "Bone Color Sets", "");
1922 static void rna_def_userdef_addon(BlenderRNA *brna)
1927 srna= RNA_def_struct(brna, "Addon", NULL);
1928 RNA_def_struct_sdna(srna, "bAddon");
1929 RNA_def_struct_ui_text(srna, "Addon", "Python addons to be loaded automatically");
1931 prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
1932 RNA_def_property_ui_text(prop, "Module", "Module name");
1933 RNA_def_struct_name_property(srna, prop);
1937 static void rna_def_userdef_dothemes(BlenderRNA *brna)
1940 rna_def_userdef_theme_ui_style(brna);
1941 rna_def_userdef_theme_ui(brna);
1943 rna_def_userdef_theme_space_view3d(brna);
1944 rna_def_userdef_theme_space_graph(brna);
1945 rna_def_userdef_theme_space_file(brna);
1946 rna_def_userdef_theme_space_nla(brna);
1947 rna_def_userdef_theme_space_action(brna);
1948 rna_def_userdef_theme_space_image(brna);
1949 rna_def_userdef_theme_space_seq(brna);
1950 rna_def_userdef_theme_space_buts(brna);
1951 rna_def_userdef_theme_space_text(brna);
1952 rna_def_userdef_theme_space_time(brna);
1953 rna_def_userdef_theme_space_node(brna);
1954 rna_def_userdef_theme_space_outliner(brna);
1955 rna_def_userdef_theme_space_info(brna);
1956 rna_def_userdef_theme_space_userpref(brna);
1957 rna_def_userdef_theme_space_console(brna);
1958 rna_def_userdef_theme_space_sound(brna);
1959 rna_def_userdef_theme_space_logic(brna);
1960 rna_def_userdef_theme_colorset(brna);
1961 rna_def_userdef_themes(brna);
1964 static void rna_def_userdef_solidlight(BlenderRNA *brna)
1968 static float default_dir[3] = {0.f, 1.f, 0.f};
1970 srna= RNA_def_struct(brna, "UserSolidLight", NULL);
1971 RNA_def_struct_sdna(srna, "SolidLight");
1972 RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
1974 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1975 RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
1976 RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
1977 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1979 prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
1980 RNA_def_property_float_sdna(prop, NULL, "vec");
1981 RNA_def_property_array(prop, 3);
1982 RNA_def_property_float_array_default(prop, default_dir);
1983 RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining");
1984 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1986 prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
1987 RNA_def_property_float_sdna(prop, NULL, "col");
1988 RNA_def_property_array(prop, 3);
1989 RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light");
1990 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1992 prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
1993 RNA_def_property_float_sdna(prop, NULL, "spec");
1994 RNA_def_property_array(prop, 3);
1995 RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight");
1996 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1999 static void rna_def_userdef_view(BlenderRNA *brna)
2001 static EnumPropertyItem timecode_styles[] = {
2002 {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"},
2003 {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode. Format is HH:MM:SS:FF"},
2004 {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"},
2005 {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", "Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead"},
2006 {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
2007 {0, NULL, 0, NULL, NULL}};
2012 srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
2013 RNA_def_struct_sdna(srna, "UserDef");
2014 RNA_def_struct_nested(brna, srna, "UserPreferences");
2015 RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
2020 prop= RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
2021 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
2022 RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
2024 prop= RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
2025 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
2026 RNA_def_property_ui_text(prop, "Show Python Tooltips", "Show Python references in tooltips");
2028 prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
2029 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
2030 RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
2031 RNA_def_property_update(prop, 0, "rna_userdef_update");
2033 prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
2034 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
2035 RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens");
2036 RNA_def_property_update(prop, 0, "rna_userdef_update");
2038 prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
2039 RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
2040 RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
2041 RNA_def_property_update(prop, 0, "rna_userdef_update");
2043 prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
2044 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME);
2045 RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
2046 RNA_def_property_update(prop, 0, "rna_userdef_update");
2048 prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
2049 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
2050 RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
2052 prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
2053 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
2054 RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back");
2055 RNA_def_property_update(prop, 0, "rna_userdef_update");
2058 prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
2059 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
2060 RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering");
2062 prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
2063 RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
2064 RNA_def_property_range(prop, 1, 40);
2065 RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening top level menus");
2067 prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
2068 RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
2069 RNA_def_property_range(prop, 1, 40);
2070 RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening sub level menus");
2072 /* Toolbox click-hold delay */
2073 prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
2074 RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
2075 RNA_def_property_range(prop, 1, 40);
2076 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");
2078 prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
2079 RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
2080 RNA_def_property_range(prop, 1, 40);
2081 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");
2083 prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
2084 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
2085 RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
2087 prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
2088 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
2089 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");
2091 prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
2092 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
2093 RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
2095 prop= RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
2096 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
2097 RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
2099 prop= RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
2100 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
2101 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");
2104 prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
2105 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
2106 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");
2109 prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
2110 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
2111 RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views");
2113 prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
2114 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
2115 RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
2118 prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
2119 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
2120 RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View");
2121 RNA_def_property_update(prop, 0, "rna_userdef_update");
2123 prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
2124 RNA_def_property_int_sdna(prop, NULL, "rvisize");
2125 RNA_def_property_range(prop, 10, 64);
2126 RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size");
2127 RNA_def_property_update(prop, 0, "rna_userdef_update");
2129 prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
2130 RNA_def_property_int_sdna(prop, NULL, "rvibright");
2131 RNA_def_property_range(prop, 0, 10);
2132 RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon");
2133 RNA_def_property_update(prop, 0, "rna_userdef_update");
2135 prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
2136 RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
2137 RNA_def_property_range(prop, 0, 1000);
2138 RNA_def_property_ui_text(prop, "Smooth View", "The time to animate the view in milliseconds, zero to disable");
2140 prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
2141 RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
2142 RNA_def_property_range(prop, 0, 90);
2143 RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)");
2145 /* 3D transform widget */
2146 prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
2147 RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", V3D_USE_MANIPULATOR);
2148 RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
2149 RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update");
2151 prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
2152 RNA_def_property_int_sdna(prop, NULL, "tw_size");
2153 RNA_def_property_range(prop, 2, 40);
2154 RNA_def_property_int_default(prop, 15);
2155 RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units");
2156 RNA_def_property_update(prop, 0, "rna_userdef_update");
2158 prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
2159 RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
2160 RNA_def_property_range(prop, 2, 40);
2161 RNA_def_property_int_default(prop, 25);
2162 RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius");
2163 RNA_def_property_update(prop, 0, "rna_userdef_update");
2165 prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
2166 RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
2167 RNA_def_property_range(prop, 4, 40);
2168 RNA_def_property_int_default(prop, 14);
2169 RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Pixel distance around the handles to accept mouse clicks");
2171 prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
2172 RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
2173 RNA_def_property_range(prop, 4, 10);
2174 RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display");
2175 RNA_def_property_update(prop, 0, "rna_userdef_update");
2177 /* View2D Grid Displays */
2178 prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
2179 RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
2180 RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
2181 RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports");
2182 RNA_def_property_update(prop, 0, "rna_userdef_update");
2184 // TODO: add a setter for this, so that we can bump up the minimum size as necessary...
2185 prop= RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
2186 RNA_def_property_enum_items(prop, timecode_styles);
2187 RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
2188 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
2189 RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
2190 RNA_def_property_update(prop, 0, "rna_userdef_update");
2193 static void rna_def_userdef_edit(BlenderRNA *brna)
2198 static EnumPropertyItem auto_key_modes[] = {
2199 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
2200 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
2201 {0, NULL, 0, NULL, NULL}};
2203 static const EnumPropertyItem material_link_items[]= {
2204 {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
2205 {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"},
2206 {0, NULL, 0, NULL, NULL}};
2208 static const EnumPropertyItem object_align_items[]= {
2209 {0, "WORLD", 0, "World", "Align newly added objects to the world coordinates"},
2210 {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
2211 {0, NULL, 0, NULL, NULL}};
2213 srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
2214 RNA_def_struct_sdna(srna, "UserDef");
2215 RNA_def_struct_nested(brna, srna, "UserPreferences");
2216 RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
2220 prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
2221 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2222 RNA_def_property_enum_items(prop, material_link_items);
2223 RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
2225 prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
2226 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2227 RNA_def_property_enum_items(prop, object_align_items);
2228 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");
2230 prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
2231 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
2232 RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object");
2234 prop= RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
2235 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM);
2236 RNA_def_property_ui_text(prop, "Release confirms", "Moving things with a mouse drag confirms when releasing the button");
2239 prop= RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
2240 RNA_def_property_int_sdna(prop, NULL, "undosteps");
2241 RNA_def_property_range(prop, 0, 64);
2242 RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
2244 prop= RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
2245 RNA_def_property_int_sdna(prop, NULL, "undomemory");
2246 RNA_def_property_range(prop, 0, 32767);
2247 RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
2249 prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
2250 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
2251 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");
2253 /* auto keyframing */
2254 prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
2255 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
2256 RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)");
2257 RNA_def_property_ui_icon(prop, ICON_REC, 0);
2259 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
2260 RNA_def_property_enum_items(prop, auto_key_modes);
2261 RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
2262 RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones (default setting used for new Scenes)");
2264 prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
2265 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
2266 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves");
2268 /* keyframing settings */
2269 prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
2270 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
2271 RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
2273 prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
2274 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
2275 RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
2277 prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
2278 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
2279 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");
2281 prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
2282 RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
2283 RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
2284 RNA_def_property_ui_text(prop, "New Interpolation Type", "Interpolation mode used for first keyframe on newly added F-Curves. Subsequent keyframes take interpolation from preceeding keyframe");
2286 prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
2287 RNA_def_property_enum_items(prop, keyframe_handle_type_items);
2288 RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new");
2289 RNA_def_property_ui_text(prop, "New Handles Type", "Handle type for handles of new keyframes");
2292 prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
2293 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
2294 RNA_def_property_ui_text(prop, "Allow Negative Frames", "Current frame number can be manually set to a negative value");
2297 prop= RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
2298 RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist");
2299 RNA_def_property_range(prop, 0, 100);
2300 RNA_def_property_ui_text(prop, "Grease Pencil Manhattan Distance", "Pixels moved by mouse per axis when drawing stroke");
2302 prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
2303 RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
2304 RNA_def_property_range(prop, 0, 100);
2305 RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include");
2307 prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
2308 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
2309 RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
2311 prop= RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
2312 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
2313 RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
2315 prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
2316 RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
2317 RNA_def_property_range(prop, 0, 100);
2318 RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
2320 /* sculpt and paint */
2322 prop= RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2323 RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_overlay_col");
2324 RNA_def_property_array(prop, 3);
2325 RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
2327 /* duplication linking */
2328 prop= RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
2329 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
2330 RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
2332 prop= RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
2333 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
2334 RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
2336 prop= RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
2337 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
2338 RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
2340 prop= RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
2341 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
2342 RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
2344 prop= RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
2345 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
2346 RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
2348 prop= RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
2349 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
2350 RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
2352 prop= RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
2353 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
2354 RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
2356 prop= RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
2357 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
2358 RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
2360 prop= RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
2361 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
2362 RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
2365 prop= RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
2366 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
2367 RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
2369 prop= RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
2370 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
2371 RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
2373 prop= RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
2374 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
2375 RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
2378 static void rna_def_userdef_system(BlenderRNA *brna)
2383 static EnumPropertyItem gl_texture_clamp_items[] = {
2384 {0, "CLAMP_OFF", 0, "Off", ""},
2385 {8192, "CLAMP_8192", 0, "8192", ""},
2386 {4096, "CLAMP_4096", 0, "4096", ""},
2387 {2048, "CLAMP_2048", 0, "2048", ""},
2388 {1024, "CLAMP_1024", 0, "1024", ""},
2389 {512, "CLAMP_512", 0, "512", ""},
2390 {256, "CLAMP_256", 0, "256", ""},
2391 {128, "CLAMP_128", 0, "128", ""},
2392 {0, NULL, 0, NULL, NULL}};
2394 static EnumPropertyItem anisotropic_items[] ={
2395 {1, "FILTER_0", 0, "Off", ""},
2396 {2, "FILTER_2", 0, "2x", ""},
2397 {4, "FILTER_4", 0, "4x", ""},
2398 {8, "FILTER_8", 0, "8x", ""},
2399 {16, "FILTER_16", 0, "16x", ""},
2400 {0, NULL, 0, NULL, NULL}};
2402 static EnumPropertyItem audio_mixing_samples_items[] = {
2403 {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
2404 {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
2405 {1024, "SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
2406 {2048, "SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
2407 {4096, "SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
2408 {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
2409 {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
2410 {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
2411 {0, NULL, 0, NULL, NULL}};
2413 static EnumPropertyItem audio_device_items[] = {
2414 {0, "NONE", 0, "None", "Null device - there will be no audio output"},
2416 {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage"},
2419 {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"},
2422 {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"},
2424 {0, NULL, 0, NULL, NULL}};
2426 static EnumPropertyItem audio_rate_items[] = {
2427 // {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
2428 // {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
2429 // {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
2430 // {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
2431 // {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
2432 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
2433 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
2434 // {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
2435 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
2436 {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
2437 {0, NULL, 0, NULL, NULL}};
2439 static EnumPropertyItem audio_format_items[] = {
2440 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
2441 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer"},
2442 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer"},
2443 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
2444 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
2445 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
2446 {0, NULL, 0, NULL, NULL}};
2448 static EnumPropertyItem audio_channel_items[] = {
2449 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2450 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
2451 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2452 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2453 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2454 {0, NULL, 0, NULL, NULL}};
2456 static EnumPropertyItem draw_method_items[] = {
2457 {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
2458 {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory"},
2459 {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
2460 {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)"},
2461 {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails"},
2462 {0, NULL, 0, NULL, NULL}};
2464 static EnumPropertyItem color_picker_types[] = {
2465 {USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
2466 {USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
2467 {USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
2468 {USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
2469 {0, NULL, 0, NULL, NULL}};
2471 /* hardcoded here, could become dynamic somehow */
2472 /* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
2473 /* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
2474 static EnumPropertyItem language_items[] = {
2475 {0, "DEFAULT", 0, N_("Default (Default)"), ""},
2476 {1, "ENGLISH", 0, N_("English (English)"), "en_US"},
2477 {2, "JAPANESE", 0, N_("Japanese (日本語)"), "ja_JP"},
2478 {3, "DUTCH", 0, N_("Dutch (Nederlandse taal)"), "nl_NL"},
2479 {4, "ITALIAN", 0, N_("Italian (Italiano)"), "it_IT"},
2480 {5, "GERMAN", 0, N_("German (Deutsch)"), "de_DE"},
2481 {6, "FINNISH", 0, N_("Finnish (Suomi)"), "fi_FI"},
2482 {7, "SWEDISH", 0, N_("Swedish (Svenska)"), "sv_SE"},
2483 {8, "FRENCH", 0, N_("French (Française)"), "fr_FR"},
2484 {9, "SPANISH", 0, N_("Spanish (Español)"), "es_ES"},
2485 {10, "CATALAN", 0, N_("Catalan (Català)"), "ca_AD"},
2486 {11, "CZECH", 0, N_("Czech (Český)"), "cs_CZ"},
2487 {12, "BRAZILIAN_PORTUGUESE", 0, N_("Brazilian Portuguese (Português do Brasil)"), "pt_BR"},
2488 {13, "SIMPLIFIED_CHINESE", 0, N_("Simplified Chinese (简体中文)"), "zh_CN"},
2489 {14, "TRADITIONAL_CHINESE", 0, N_("Traditional Chinese (繁體中文)"), "zh_TW"},
2490 {15, "RUSSIAN", 0, N_("Russian (Русский)"), "ru_RU"},
2491 {16, "CROATIAN", 0, N_("Croatian (Hrvatski)"), "hr_HR"},
2492 {17, "SERBIAN", 0, N_("Serbian (Српском језику)"), "sr_RS"},
2493 {18, "UKRAINIAN", 0, N_("Ukrainian (Український)"), "uk_UA"},
2494 {19, "POLISH", 0, N_("Polish (Polski)"), "pl_PL"},
2495 {20, "ROMANIAN", 0, N_("Romanian (Român)"), "ro_RO"},
2496 {21, "ARABIC", 0, N_("Arabic (العربية)"), "ar_EG"},
2497 {22, "BULGARIAN", 0, N_("Bulgarian (Български)"), "bg_BG"},
2498 {23, "GREEK", 0, N_("Greek (Ελληνικά)"), "el_GR"},
2499 {24, "KOREAN", 0, N_("Korean (한국 언어)"), "ko_KR"},
2500 /*{25, "Nepali", 0, N_("Nepali (नेपाली)"), "ne_NP"},*/
2501 {0, NULL, 0, NULL, NULL}};
2503 srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
2504 RNA_def_struct_sdna(srna, "UserDef");
2505 RNA_def_struct_nested(brna, srna, "UserPreferences");
2506 RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
2510 prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
2511 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
2512 RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
2513 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
2515 prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
2516 RNA_def_property_int_sdna(prop, NULL, "dpi");
2517 RNA_def_property_range(prop, 48, 128);
2518 RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
2519 RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
2521 prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
2522 RNA_def_property_int_sdna(prop, NULL, "scrollback");
2523 RNA_def_property_range(prop, 32, 32768);
2524 RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
2526 prop= RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
2527 RNA_def_property_string_sdna(prop, NULL, "author");
2528 RNA_def_property_string_maxlength(prop, 80);
2529 RNA_def_property_ui_text(prop, "Author", "Name that will be used in exported files when format supports such feature");
2531 /* Language Selection */
2533 prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
2534 RNA_def_property_enum_items(prop, language_items);
2535 RNA_def_property_ui_text(prop, "Language", "Language use for translation");
2536 RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
2538 prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
2539 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
2540 RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
2541 RNA_def_property_update(prop, 0, "rna_userdef_update");
2543 prop= RNA_def_property(srna, "use_translate_interface", PROP_BOOLEAN, PROP_NONE);
2544 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_IFACE);
2545 RNA_def_property_ui_text(prop, "Translate Interface", "Translate Interface");
2546 RNA_def_property_update(prop, 0, "rna_userdef_update");
2548 prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
2549 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
2550 RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts");
2551 RNA_def_property_update(prop, 0, "rna_userdef_update");
2553 /* System & OpenGL */
2555 prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
2556 RNA_def_property_collection_sdna(prop, NULL, "light", "");
2557 RNA_def_property_struct_type(prop, "UserSolidLight");
2558 RNA_def_property_ui_text(prop, "Solid Lights", "Lights user to display objects in solid draw mode");
2560 prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
2561 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
2562 RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode");
2563 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2565 prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
2566 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2567 RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
2568 RNA_def_property_struct_type(prop, "ColorRamp");
2569 RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode");
2570 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2572 prop= RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
2573 RNA_def_property_enum_items(prop, color_picker_types);
2574 RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
2575 RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
2577 prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
2578 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
2579 RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)");
2581 prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
2582 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
2583 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)");
2584 RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
2586 prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
2587 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
2588 RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces for new and loaded text files");
2590 prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
2591 RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
2592 RNA_def_property_range(prop, 0, 500);
2593 RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
2595 prop= RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
2596 RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
2597 RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
2598 RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
2599 RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
2601 prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
2602 RNA_def_property_int_sdna(prop, NULL, "frameserverport");
2603 RNA_def_property_range(prop, 0, 32727);
2604 RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering");
2606 prop= RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
2607 RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
2608 RNA_def_property_range(prop, 0.0f, 1.0f);
2609 RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
2610 RNA_def_property_update(prop, 0, "rna_userdef_update");
2612 prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
2613 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
2614 RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
2615 RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
2617 prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
2618 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
2619 RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
2621 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2622 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
2623 RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)");
2625 prop= RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
2626 RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
2627 RNA_def_property_enum_items(prop, anisotropic_items);
2628 RNA_def_property_enum_default(prop, 1);
2629 RNA_def_property_ui_text(prop, "Anisotropic Filter", "The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
2630 RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update");
2632 prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
2633 RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
2634 RNA_def_property_enum_items(prop, gl_texture_clamp_items);
2635 RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
2636 RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update");
2638 prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
2639 RNA_def_property_int_sdna(prop, NULL, "textimeout");
2640 RNA_def_property_range(prop, 0, 3600);
2641 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.)");
2643 prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
2644 RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
2645 RNA_def_property_range(prop, 1, 3600);
2646 RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector");
2648 prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
2649 RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
2650 RNA_def_property_enum_items(prop, draw_method_items);
2651 RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
2652 RNA_def_property_update(prop, 0, "rna_userdef_update");
2654 prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
2655 RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
2656 RNA_def_property_enum_items(prop, audio_mixing_samples_items);
2657 RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer");
2658 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2660 prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
2661 RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
2662 RNA_def_property_enum_items(prop, audio_device_items);
2663 RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device");
2664 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2666 prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
2667 RNA_def_property_enum_sdna(prop, NULL, "audiorate");
2668 RNA_def_property_enum_items(prop, audio_rate_items);
2669 RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate");
2670 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2672 prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
2673 RNA_def_property_enum_sdna(prop, NULL, "audioformat");
2674 RNA_def_property_enum_items(prop, audio_format_items);
2675 RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format");
2676 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2678 prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
2679 RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
2680 RNA_def_property_enum_items(prop, audio_channel_items);
2681 RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
2682 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2684 prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
2685 RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
2686 RNA_def_property_range(prop, 10, 50);
2687 RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back");
2689 prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
2690 RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
2691 RNA_def_property_range(prop, 50, 1000);
2692 RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast");
2694 prop= RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
2695 RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_AA);
2696 RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
2697 RNA_def_property_update(prop, 0, "rna_userdef_text_update");
2700 prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
2701 RNA_def_property_string_sdna(prop, NULL, "versemaster");
2702 RNA_def_property_ui_text(prop, "Verse Master", "The Verse Master-server IP");
2704 prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE);
2705 RNA_def_property_string_sdna(prop, NULL, "verseuser");
2706 RNA_def_property_ui_text(prop, "Verse Username", "The Verse user name");
2710 static void rna_def_userdef_input(BlenderRNA *brna)
2715 static EnumPropertyItem select_mouse_items[] = {
2716 {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
2717 {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
2718 {0, NULL, 0, NULL, NULL}};
2720 static EnumPropertyItem view_rotation_items[] = {
2721 {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
2722 {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
2723 {0, NULL, 0, NULL, NULL}};
2725 static EnumPropertyItem view_zoom_styles[] = {
2726 {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
2727 {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement"},
2728 {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center"},
2729 {0, NULL, 0, NULL, NULL}};
2731 static EnumPropertyItem view_zoom_axes[] = {
2732 {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"},
2733 {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"},
2734 {0, NULL, 0, NULL, NULL}};
2736 srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
2737 RNA_def_struct_sdna(srna, "UserDef");
2738 RNA_def_struct_nested(brna, srna, "UserPreferences");
2739 RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
2741 prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
2742 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2743 RNA_def_property_enum_items(prop, select_mouse_items);
2744 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
2745 RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection");
2747 prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
2748 RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
2749 RNA_def_property_enum_items(prop, view_zoom_styles);
2750 RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
2752 prop= RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
2753 RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
2754 RNA_def_property_enum_items(prop, view_zoom_axes);
2755 RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
2757 prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
2758 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
2759 RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
2761 prop= RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
2762 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2763 RNA_def_property_enum_items(prop, view_rotation_items);
2764 RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
2766 prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
2767 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
2768 RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
2770 /* tweak tablet & mouse preset */
2771 prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
2772 RNA_def_property_int_sdna(prop, NULL, "dragthreshold");
2773 RNA_def_property_range(prop, 3, 40);
2774 RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
2776 /* 3D mouse settings */
2777 /* global options */
2778 prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
2779 RNA_def_property_range(prop, 0.25f, 4.0f);
2780 RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
2782 prop= RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
2783 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
2784 RNA_def_property_ui_text(prop, "Zoom = Up/Down", "Zoom using up/down on the device (otherwise forward/backward)");
2786 prop= RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
2787 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT);
2788 RNA_def_property_ui_text(prop, "Invert Zoom", "Zoom using opposite direction");
2791 prop= RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
2792 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
2793 RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
2794 /* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/
2796 /* 3D view: orbit */
2797 prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
2798 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
2799 RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
2800 /* in 3Dx docs, this is called 'object mode' vs. 'target camera mode' */
2803 prop= RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE);
2804 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROLL_INVERT_AXIS);
2805 RNA_def_property_ui_text(prop, "Invert roll Axis", "Invert roll axis");
2808 prop= RNA_def_property(srna, "ndof_tilt_invert_axis", PROP_BOOLEAN, PROP_NONE);
2809 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_TILT_INVERT_AXIS);
2810 RNA_def_property_ui_text(prop, "Invert tilt Axis", "Invert tilt axis");
2812 /* 3D view: rotate */
2813 prop= RNA_def_property(srna, "ndof_rotate_invert_axis", PROP_BOOLEAN, PROP_NONE);
2814 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ROTATE_INVERT_AXIS);
2815 RNA_def_property_ui_text(prop, "Invert rotation Axis", "Invert rotation axis");
2817 /* 3D view: pan x */
2818 prop= RNA_def_property(srna, "ndof_panx_invert_axis", PROP_BOOLEAN, PROP_NONE);
2819 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANX_INVERT_AXIS);
2820 RNA_def_property_ui_text(prop, "Invert x Axis", "Invert x axis");
2822 /* 3D view: pan y */
2823 prop= RNA_def_property(srna, "ndof_pany_invert_axis", PROP_BOOLEAN, PROP_NONE);
2824 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANY_INVERT_AXIS);
2825 RNA_def_property_ui_text(prop, "Invert y Axis", "Invert y axis");
2827 /* 3D view: pan z */
2828 prop= RNA_def_property(srna, "ndof_panz_invert_axis", PROP_BOOLEAN, PROP_NONE);
2829 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PANZ_INVERT_AXIS);
2830 RNA_def_property_ui_text(prop, "Invert z Axis", "Invert z axis");
2833 prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
2834 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);
2835 RNA_def_property_ui_text(prop, "Lock Horizon", "Keep horizon level while flying with 3D Mouse");
2837 prop= RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
2838 RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_FLY_HELICOPTER);
2839 RNA_def_property_ui_text(prop, "Helicopter Mode", "Device up/down directly controls your Z position");
2842 prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
2843 RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
2844 RNA_def_property_range(prop, 1, 1000);
2845 RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click");
2847 prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
2848 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
2849 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)");
2851 prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
2852 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
2853 RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
2855 /* middle mouse button */
2856 prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
2857 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
2858 RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
2860 prop= RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
2861 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
2862 RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
2864 prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
2865 RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
2866 RNA_def_property_range(prop, 0, 32);
2867 RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
2869 prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
2870 RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
2871 RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
2874 static void rna_def_userdef_filepaths(BlenderRNA *brna)
2879 static EnumPropertyItem anim_player_presets[] = {
2880 //{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, // doesn't work yet!
2881 {1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
2882 {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
2883 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
2884 {4, "RV", 0, "rv", "Frame player from Tweak Software"},
2885 {5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"},
2886 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
2887 {0, NULL, 0, NULL, NULL}};
2889 srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
2890 RNA_def_struct_sdna(srna, "UserDef");
2891 RNA_def_struct_nested(brna, srna, "UserPreferences");
2892 RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
2894 prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
2895 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
2896 RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
2898 prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
2899 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
2900 RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
2902 prop= RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE);
2903 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
2904 RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector");
2906 prop= RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
2907 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_THUMBNAILS);
2908 RNA_def_property_ui_text(prop, "Show Thumbnails", "Open in thumbnail view for images and movies");
2910 prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
2911 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
2912 RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
2914 prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
2915 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
2916 RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
2918 prop= RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
2919 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
2920 RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
2922 prop= RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
2923 RNA_def_property_string_sdna(prop, NULL, "fontdir");
2924 RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
2926 prop= RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
2927 RNA_def_property_string_sdna(prop, NULL, "textudir");
2928 RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
2930 prop= RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
2931 RNA_def_property_string_sdna(prop, NULL, "plugtexdir");
2932 RNA_def_property_ui_text(prop, "Texture Plugin Directory", "The default directory to search for texture plugins");
2934 prop= RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
2935 RNA_def_property_string_sdna(prop, NULL, "plugseqdir");
2936 RNA_def_property_ui_text(prop, "Sequence Plugin Directory", "The default directory to search for sequence plugins");
2938 prop= RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
2939 RNA_def_property_string_sdna(prop, NULL, "renderdir");
2940 RNA_def_property_ui_text(prop, "Render Output Directory", "The default directory for rendering output, for new scenes");
2942 prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
2943 RNA_def_property_string_sdna(prop, NULL, "pythondir");
2944 RNA_def_property_ui_text(prop, "Python Scripts Directory", "Alternate script path, matching the default layout with subdirs: startup, addons & modules (requires restart)");
2945 /* TODO, editing should reset sys.path! */
2947 prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
2948 RNA_def_property_string_sdna(prop, NULL, "sounddir");
2949 RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
2951 prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
2952 RNA_def_property_string_sdna(prop, NULL, "tempdir");
2953 RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
2954 RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
2956 prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
2957 RNA_def_property_string_sdna(prop, NULL, "image_editor");
2958 RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
2960 prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
2961 RNA_def_property_string_sdna(prop, NULL, "anim_player");
2962 RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player");
2964 prop= RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
2965 RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
2966 RNA_def_property_enum_items(prop, anim_player_presets);
2967 RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
2968 RNA_def_property_enum_default(prop, 1); /* set default to blender 2.4 player until an internal one is back */
2972 prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
2973 RNA_def_property_int_sdna(prop, NULL, "versions");
2974 RNA_def_property_range(prop, 0, 32);
2975 RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving");
2977 prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
2978 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
2979 RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files in temp directory, uses process ID");
2980 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2982 prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
2983 RNA_def_property_int_sdna(prop, NULL, "savetime");
2984 RNA_def_property_range(prop, 1, 60);
2985 RNA_def_property_ui_text(prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
2986 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2988 prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
2989 RNA_def_property_range(prop, 0, 30);
2990 RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
2992 prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
2993 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
2994 RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");
2997 void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
3003 RNA_def_property_srna(cprop, "Addons");
3004 srna= RNA_def_struct(brna, "Addons", NULL);
3005 RNA_def_struct_ui_text(srna, "User Add-Ons", "Collection of add-ons");
3007 func= RNA_def_function(srna, "new", "rna_userdef_addon_new");
3008 RNA_def_function_flag(func, FUNC_NO_SELF);
3009 RNA_def_function_ui_description(func, "Add a new addon");
3011 parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock.");
3012 RNA_def_function_return(func, parm);
3014 func= RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
3015 RNA_def_function_flag(func, FUNC_NO_SELF);
3016 RNA_def_function_ui_description(func, "Remove addon.");
3017 parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove.");
3018 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
3021 void RNA_def_userdef(BlenderRNA *brna)
3026 static EnumPropertyItem user_pref_sections[] = {
3027 {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
3028 {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
3029 {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
3030 {USER_SECTION_ADDONS, "ADDONS", 0, "Add-Ons", ""},
3031 {USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
3032 {USER_SECTION_FILE, "FILES", 0, "File", ""},
3033 {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
3034 {0, NULL, 0, NULL, NULL}};
3036 rna_def_userdef_dothemes(brna);
3037 rna_def_userdef_solidlight(brna);
3039 srna= RNA_def_struct(brna, "UserPreferences", NULL);
3040 RNA_def_struct_sdna(srna, "UserDef");
3041 RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences");
3043 prop= RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
3044 RNA_def_property_enum_sdna(prop, NULL, "userpref");
3045 RNA_def_property_enum_items(prop, user_pref_sections);
3046 RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface");
3047 RNA_def_property_update(prop, 0, "rna_userdef_update");
3049 prop= RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
3050 RNA_def_property_collection_sdna(prop, NULL, "themes", NULL);
3051 RNA_def_property_struct_type(prop, "Theme");
3052 RNA_def_property_ui_text(prop, "Themes", "");
3054 prop= RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
3055 RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL);
3056 RNA_def_property_struct_type(prop, "ThemeStyle");
3057 RNA_def_property_ui_text(prop, "Styles", "");
3059 prop= RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
3060 RNA_def_property_collection_sdna(prop, NULL, "addons", NULL);
3061 RNA_def_property_struct_type(prop, "Addon");
3062 RNA_def_property_ui_text(prop, "Addon", "");
3063 rna_def_userdef_addon_collection(brna, prop);
3066 /* nested structs */
3067 prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
3068 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3069 RNA_def_property_struct_type(prop, "UserPreferencesView");
3070 RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL);
3071 RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
3073 prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
3074 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3075 RNA_def_property_struct_type(prop, "UserPreferencesEdit");
3076 RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL);
3077 RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
3079 prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
3080 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3081 RNA_def_property_struct_type(prop, "UserPreferencesInput");
3082 RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL);
3083 RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
3085 prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
3086 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3087 RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
3088 RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL);
3089 RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
3091 prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
3092 RNA_def_property_flag(prop, PROP_NEVER_NULL);
3093 RNA_def_property_struct_type(prop, "UserPreferencesSystem");
3094 RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL);
3095 RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings");
3097 rna_def_userdef_view(brna);
3098 rna_def_userdef_edit(brna);
3099 rna_def_userdef_input(brna);
3100 rna_def_userdef_filepaths(brna);
3101 rna_def_userdef_system(brna);
3102 rna_def_userdef_addon(brna);