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 *****
27 #include "RNA_define.h"
28 #include "RNA_types.h"
30 #include "rna_internal.h"
32 #include "DNA_curve_types.h"
33 #include "DNA_space_types.h"
34 #include "DNA_userdef_types.h"
39 #include "BKE_utildefines.h"
41 #include "BKE_sound.h"
46 #include "BKE_DerivedMesh.h"
47 #include "BKE_depsgraph.h"
48 #include "DNA_object_types.h"
51 #include "MEM_guardedalloc.h"
53 static void rna_userdef_update(Main *bmain, Scene *scene, PointerRNA *ptr)
55 WM_main_add_notifier(NC_WINDOW, NULL);
58 static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
60 GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
61 rna_userdef_update(bmain, scene, ptr);
65 static void rna_userdef_lmb_select_set(PointerRNA *ptr,int value)
67 UserDef *userdef = (UserDef*)ptr->data;
70 userdef->flag |= USER_LMOUSESELECT;
71 userdef->flag &= ~USER_TWOBUTTONMOUSE;
74 userdef->flag &= ~USER_LMOUSESELECT;
77 static void rna_userdef_rmb_select_set(PointerRNA *ptr,int value)
79 rna_userdef_lmb_select_set(ptr, !value);
83 static void rna_userdef_emulate_set(PointerRNA *ptr,int value)
85 UserDef *userdef = (UserDef*)ptr->data;
87 if(userdef->flag & USER_LMOUSESELECT)
88 userdef->flag &= ~USER_TWOBUTTONMOUSE;
90 userdef->flag ^= USER_TWOBUTTONMOUSE;
93 static int rna_userdef_autokeymode_get(PointerRNA *ptr)
95 UserDef *userdef = (UserDef*)ptr->data;
96 short retval = userdef->autokey_mode;
98 if(!(userdef->autokey_mode & AUTOKEY_ON))
104 static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
106 UserDef *userdef = (UserDef*)ptr->data;
108 if(value == AUTOKEY_MODE_NORMAL) {
109 userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
110 userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
112 else if(value == AUTOKEY_MODE_EDITKEYS) {
113 userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
114 userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
118 static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
120 UserDef *userdef = (UserDef*)ptr->data;
121 int required_size = userdef->v2d_min_gridsize;
123 /* set the timecode style */
124 userdef->timecode_style= value;
126 /* adjust the v2d gridsize if needed so that timecodes don't overlap
127 * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
128 * things from getting too blown out
131 case USER_TIMECODE_MINIMAL:
132 case USER_TIMECODE_SECONDS_ONLY:
133 /* 35 is great most of the time, but not that great for full-blown */
136 case USER_TIMECODE_SMPTE_MSF:
139 case USER_TIMECODE_SMPTE_FULL:
140 /* the granddaddy! */
143 case USER_TIMECODE_MILLISECONDS:
148 if (U.v2d_min_gridsize < required_size)
149 U.v2d_min_gridsize= required_size;
152 static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
154 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesView, ptr->data);
157 static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
159 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
162 static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
164 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data);
167 static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
169 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
172 static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
174 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
177 static void rna_UserDef_audio_update(Main *bmain, Scene *scene, PointerRNA *ptr)
182 static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
186 vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
188 for(ob= bmain->object.first; ob; ob= ob->id.next) {
189 if(ob->mode & OB_MODE_WEIGHT_PAINT)
190 DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
193 rna_userdef_update(bmain, scene, ptr);
196 // XXX - todo, this is not accessible from here and it only works when the userprefs are in the same window.
197 // extern int GPU_default_lights(void);
198 static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
200 // GPU_default_lights();
201 WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL);
202 rna_userdef_update(bmain, scene, ptr);
205 static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
207 wmWindowManager *wm= bmain->wm.first;
210 WM_autosave_init(wm);
211 rna_userdef_update(bmain, scene, ptr);
214 static bExtension *rna_userdef_extension_new(void)
216 bExtension *bext= MEM_callocN(sizeof(bExtension), "bext");
217 BLI_addtail(&U.extensions, bext);
221 static void rna_userdef_extension_remove(bExtension *bext)
223 BLI_freelinkN(&U.extensions, bext);
230 static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
235 static EnumPropertyItem font_kerning_style[] = {
236 {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"},
237 {1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
238 {0, NULL, 0, NULL, NULL}};
240 srna= RNA_def_struct(brna, "ThemeFontStyle", NULL);
241 RNA_def_struct_sdna(srna, "uiFontStyle");
242 RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
244 prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE);
245 RNA_def_property_range(prop, 6, 48);
246 RNA_def_property_ui_text(prop, "Points", "");
247 RNA_def_property_update(prop, 0, "rna_userdef_update");
249 prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE);
250 RNA_def_property_enum_sdna(prop, NULL, "kerning");
251 RNA_def_property_enum_items(prop, font_kerning_style);
252 RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning");
253 RNA_def_property_update(prop, 0, "rna_userdef_update");
255 prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
256 RNA_def_property_range(prop, 0, 5);
257 RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)");
258 RNA_def_property_update(prop, 0, "rna_userdef_update");
260 prop= RNA_def_property(srna, "shadx", PROP_INT, PROP_NONE);
261 RNA_def_property_range(prop, -10, 10);
262 RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
263 RNA_def_property_update(prop, 0, "rna_userdef_update");
265 prop= RNA_def_property(srna, "shady", PROP_INT, PROP_NONE);
266 RNA_def_property_range(prop, -10, 10);
267 RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
268 RNA_def_property_update(prop, 0, "rna_userdef_update");
270 prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
271 RNA_def_property_range(prop, 0.0f, 1.0f);
272 RNA_def_property_ui_text(prop, "Shadow Alpha", "");
273 RNA_def_property_update(prop, 0, "rna_userdef_update");
275 prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
276 RNA_def_property_range(prop, 0.0f, 1.0f);
277 RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
278 RNA_def_property_update(prop, 0, "rna_userdef_update");
281 static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
286 rna_def_userdef_theme_ui_font_style(brna);
288 srna= RNA_def_struct(brna, "ThemeStyle", NULL);
289 RNA_def_struct_sdna(srna, "uiStyle");
290 RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
292 prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
293 RNA_def_property_range(prop, 0.5, 2.0);
294 RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
296 prop= RNA_def_property(srna, "paneltitle", PROP_POINTER, PROP_NONE);
297 RNA_def_property_flag(prop, PROP_NEVER_NULL);
298 RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
299 RNA_def_property_struct_type(prop, "ThemeFontStyle");
300 RNA_def_property_ui_text(prop, "Panel Font", "");
301 RNA_def_property_update(prop, 0, "rna_userdef_update");
303 prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NONE);
304 RNA_def_property_flag(prop, PROP_NEVER_NULL);
305 RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
306 RNA_def_property_struct_type(prop, "ThemeFontStyle");
307 RNA_def_property_ui_text(prop, "Group Label Font", "");
308 RNA_def_property_update(prop, 0, "rna_userdef_update");
310 prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NONE);
311 RNA_def_property_flag(prop, PROP_NEVER_NULL);
312 RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
313 RNA_def_property_struct_type(prop, "ThemeFontStyle");
314 RNA_def_property_ui_text(prop, "Widget Label Font", "");
315 RNA_def_property_update(prop, 0, "rna_userdef_update");
317 prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
318 RNA_def_property_flag(prop, PROP_NEVER_NULL);
319 RNA_def_property_pointer_sdna(prop, NULL, "widget");
320 RNA_def_property_struct_type(prop, "ThemeFontStyle");
321 RNA_def_property_ui_text(prop, "Widget Font", "");
322 RNA_def_property_update(prop, 0, "rna_userdef_update");
326 static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
331 srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL);
332 RNA_def_struct_sdna(srna, "uiWidgetColors");
333 RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
335 prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR);
336 RNA_def_property_array(prop, 3);
337 RNA_def_property_ui_text(prop, "Outline", "");
338 RNA_def_property_update(prop, 0, "rna_userdef_update");
340 prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR);
341 RNA_def_property_array(prop, 4);
342 RNA_def_property_ui_text(prop, "Inner", "");
343 RNA_def_property_update(prop, 0, "rna_userdef_update");
345 prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR);
346 RNA_def_property_array(prop, 4);
347 RNA_def_property_ui_text(prop, "Inner Selected", "");
348 RNA_def_property_update(prop, 0, "rna_userdef_update");
350 prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR);
351 RNA_def_property_array(prop, 4);
352 RNA_def_property_ui_text(prop, "Item", "");
353 RNA_def_property_update(prop, 0, "rna_userdef_update");
355 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR);
356 RNA_def_property_array(prop, 3);
357 RNA_def_property_ui_text(prop, "Text", "");
358 RNA_def_property_update(prop, 0, "rna_userdef_update");
360 prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR);
361 RNA_def_property_array(prop, 3);
362 RNA_def_property_ui_text(prop, "Text Selected", "");
363 RNA_def_property_update(prop, 0, "rna_userdef_update");
365 prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE);
366 RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
367 RNA_def_property_ui_text(prop, "Shaded", "");
368 RNA_def_property_update(prop, 0, "rna_userdef_update");
370 prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
371 RNA_def_property_range(prop, -100, 100);
372 RNA_def_property_ui_text(prop, "Shade Top", "");
373 RNA_def_property_update(prop, 0, "rna_userdef_update");
375 prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
376 RNA_def_property_range(prop, -100, 100);
377 RNA_def_property_ui_text(prop, "Shade Down", "");
378 RNA_def_property_update(prop, 0, "rna_userdef_update");
381 static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
386 srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
387 RNA_def_struct_sdna(srna, "uiWidgetStateColors");
388 RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors");
390 prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR);
391 RNA_def_property_array(prop, 3);
392 RNA_def_property_ui_text(prop, "Animated", "");
393 RNA_def_property_update(prop, 0, "rna_userdef_update");
395 prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR);
396 RNA_def_property_array(prop, 3);
397 RNA_def_property_ui_text(prop, "Animated Selected", "");
398 RNA_def_property_update(prop, 0, "rna_userdef_update");
400 prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR);
401 RNA_def_property_array(prop, 3);
402 RNA_def_property_ui_text(prop, "Keyframe", "");
403 RNA_def_property_update(prop, 0, "rna_userdef_update");
405 prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR);
406 RNA_def_property_array(prop, 3);
407 RNA_def_property_ui_text(prop, "Keyframe Selected", "");
408 RNA_def_property_update(prop, 0, "rna_userdef_update");
410 prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR);
411 RNA_def_property_array(prop, 3);
412 RNA_def_property_ui_text(prop, "Driven", "");
413 RNA_def_property_update(prop, 0, "rna_userdef_update");
415 prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR);
416 RNA_def_property_array(prop, 3);
417 RNA_def_property_ui_text(prop, "Driven Selected", "");
418 RNA_def_property_update(prop, 0, "rna_userdef_update");
420 prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
421 RNA_def_property_ui_text(prop, "Blend", "");
422 RNA_def_property_update(prop, 0, "rna_userdef_update");
425 static void rna_def_userdef_theme_ui(BlenderRNA *brna)
430 rna_def_userdef_theme_ui_wcol(brna);
431 rna_def_userdef_theme_ui_wcol_state(brna);
433 srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
434 RNA_def_struct_sdna(srna, "ThemeUI");
435 RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements");
437 prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
438 RNA_def_property_flag(prop, PROP_NEVER_NULL);
439 RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
440 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
441 RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
442 RNA_def_property_update(prop, 0, "rna_userdef_update");
444 prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
445 RNA_def_property_flag(prop, PROP_NEVER_NULL);
446 RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
447 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
448 RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
449 RNA_def_property_update(prop, 0, "rna_userdef_update");
451 prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
452 RNA_def_property_flag(prop, PROP_NEVER_NULL);
453 RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
454 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
455 RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
456 RNA_def_property_update(prop, 0, "rna_userdef_update");
458 prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
459 RNA_def_property_flag(prop, PROP_NEVER_NULL);
460 RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
461 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
462 RNA_def_property_ui_text(prop, "Text Widget Colors", "");
463 RNA_def_property_update(prop, 0, "rna_userdef_update");
465 prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
466 RNA_def_property_flag(prop, PROP_NEVER_NULL);
467 RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
468 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
469 RNA_def_property_ui_text(prop, "Option Widget Colors", "");
470 RNA_def_property_update(prop, 0, "rna_userdef_update");
472 prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
473 RNA_def_property_flag(prop, PROP_NEVER_NULL);
474 RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
475 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
476 RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
477 RNA_def_property_update(prop, 0, "rna_userdef_update");
479 prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
480 RNA_def_property_flag(prop, PROP_NEVER_NULL);
481 RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
482 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
483 RNA_def_property_ui_text(prop, "Number Widget Colors", "");
484 RNA_def_property_update(prop, 0, "rna_userdef_update");
486 prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
487 RNA_def_property_flag(prop, PROP_NEVER_NULL);
488 RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
489 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
490 RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
491 RNA_def_property_update(prop, 0, "rna_userdef_update");
493 prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
494 RNA_def_property_flag(prop, PROP_NEVER_NULL);
495 RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
496 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
497 RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
498 RNA_def_property_update(prop, 0, "rna_userdef_update");
500 prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
501 RNA_def_property_flag(prop, PROP_NEVER_NULL);
502 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
503 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
504 RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
505 RNA_def_property_update(prop, 0, "rna_userdef_update");
507 prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
508 RNA_def_property_flag(prop, PROP_NEVER_NULL);
509 RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
510 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
511 RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
512 RNA_def_property_update(prop, 0, "rna_userdef_update");
514 prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
515 RNA_def_property_flag(prop, PROP_NEVER_NULL);
516 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
517 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
518 RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
519 RNA_def_property_update(prop, 0, "rna_userdef_update");
521 prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
522 RNA_def_property_flag(prop, PROP_NEVER_NULL);
523 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
524 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
525 RNA_def_property_ui_text(prop, "Menu Item Colors", "");
526 RNA_def_property_update(prop, 0, "rna_userdef_update");
528 prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
529 RNA_def_property_flag(prop, PROP_NEVER_NULL);
530 RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
531 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
532 RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
533 RNA_def_property_update(prop, 0, "rna_userdef_update");
535 prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
536 RNA_def_property_flag(prop, PROP_NEVER_NULL);
537 RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
538 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
539 RNA_def_property_ui_text(prop, "List Item Colors", "");
540 RNA_def_property_update(prop, 0, "rna_userdef_update");
542 prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
543 RNA_def_property_flag(prop, PROP_NEVER_NULL);
544 RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
545 RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
546 RNA_def_property_ui_text(prop, "State Colors", "");
547 RNA_def_property_update(prop, 0, "rna_userdef_update");
549 prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
550 RNA_def_property_string_sdna(prop, NULL, "iconfile");
551 RNA_def_property_ui_text(prop, "Icon File", "");
552 RNA_def_property_update(prop, 0, "rna_userdef_update");
555 static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype)
560 prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR);
561 RNA_def_property_array(prop, 3);
562 RNA_def_property_ui_text(prop, "Window Background", "");
563 RNA_def_property_update(prop, 0, "rna_userdef_update");
565 prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR);
566 RNA_def_property_array(prop, 3);
567 RNA_def_property_ui_text(prop, "Title", "");
568 RNA_def_property_update(prop, 0, "rna_userdef_update");
570 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR);
571 RNA_def_property_array(prop, 3);
572 RNA_def_property_ui_text(prop, "Text", "");
573 RNA_def_property_update(prop, 0, "rna_userdef_update");
575 prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR);
576 RNA_def_property_array(prop, 3);
577 RNA_def_property_ui_text(prop, "Text Highlight", "");
578 RNA_def_property_update(prop, 0, "rna_userdef_update");
581 prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR);
582 RNA_def_property_array(prop, 3);
583 RNA_def_property_ui_text(prop, "Header", "");
584 RNA_def_property_update(prop, 0, "rna_userdef_update");
586 prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR);
587 RNA_def_property_array(prop, 3);
588 RNA_def_property_ui_text(prop, "Header Text", "");
589 RNA_def_property_update(prop, 0, "rna_userdef_update");
591 prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR);
592 RNA_def_property_array(prop, 3);
593 RNA_def_property_ui_text(prop, "Header Text Highlight", "");
594 RNA_def_property_update(prop, 0, "rna_userdef_update");
597 // if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) {
598 prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR);
599 RNA_def_property_array(prop, 3);
600 RNA_def_property_ui_text(prop, "Region Background", "");
601 RNA_def_property_update(prop, 0, "rna_userdef_update");
603 prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR);
604 RNA_def_property_array(prop, 3);
605 RNA_def_property_ui_text(prop, "Region Text Titles", "");
606 RNA_def_property_update(prop, 0, "rna_userdef_update");
608 prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR);
609 RNA_def_property_array(prop, 3);
610 RNA_def_property_ui_text(prop, "Region Text", "");
611 RNA_def_property_update(prop, 0, "rna_userdef_update");
613 prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR);
614 RNA_def_property_array(prop, 3);
615 RNA_def_property_ui_text(prop, "Region Text Highlight", "");
616 RNA_def_property_update(prop, 0, "rna_userdef_update");
620 if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) {
621 prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR);
622 RNA_def_property_array(prop, 3);
623 RNA_def_property_ui_text(prop, "Source List", "");
624 RNA_def_property_update(prop, 0, "rna_userdef_update");
626 prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR);
627 RNA_def_property_array(prop, 3);
628 RNA_def_property_ui_text(prop, "Source List Title", "");
629 RNA_def_property_update(prop, 0, "rna_userdef_update");
631 prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR);
632 RNA_def_property_array(prop, 3);
633 RNA_def_property_ui_text(prop, "Source List Text", "");
634 RNA_def_property_update(prop, 0, "rna_userdef_update");
636 prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR);
637 RNA_def_property_array(prop, 3);
638 RNA_def_property_ui_text(prop, "Source List Text Highlight", "");
639 RNA_def_property_update(prop, 0, "rna_userdef_update");
643 static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna)
647 prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR);
648 RNA_def_property_array(prop, 3);
649 RNA_def_property_ui_text(prop, "Vertex", "");
650 RNA_def_property_update(prop, 0, "rna_userdef_update");
652 prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR);
653 RNA_def_property_array(prop, 3);
654 RNA_def_property_ui_text(prop, "Vertex Select", "");
655 RNA_def_property_update(prop, 0, "rna_userdef_update");
657 prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
658 RNA_def_property_range(prop, 1, 10);
659 RNA_def_property_ui_text(prop, "Vertex Size", "");
660 RNA_def_property_update(prop, 0, "rna_userdef_update");
663 static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
667 prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR);
668 RNA_def_property_array(prop, 3);
669 RNA_def_property_ui_text(prop, "Edge Select", "");
670 RNA_def_property_update(prop, 0, "rna_userdef_update");
672 prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR);
673 RNA_def_property_array(prop, 3);
674 RNA_def_property_ui_text(prop, "Edge Seam", "");
675 RNA_def_property_update(prop, 0, "rna_userdef_update");
677 prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR);
678 RNA_def_property_array(prop, 3);
679 RNA_def_property_ui_text(prop, "Edge Sharp", "");
680 RNA_def_property_update(prop, 0, "rna_userdef_update");
682 prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR);
683 RNA_def_property_array(prop, 3);
684 RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
685 RNA_def_property_update(prop, 0, "rna_userdef_update");
688 static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
692 prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR);
693 RNA_def_property_array(prop, 4);
694 RNA_def_property_ui_text(prop, "Face", "");
695 RNA_def_property_update(prop, 0, "rna_userdef_update");
697 prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR);
698 RNA_def_property_array(prop, 4);
699 RNA_def_property_ui_text(prop, "Face Selected", "");
700 RNA_def_property_update(prop, 0, "rna_userdef_update");
702 prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR);
703 RNA_def_property_array(prop, 3);
704 RNA_def_property_ui_text(prop, "Face Dot Selected", "");
705 RNA_def_property_update(prop, 0, "rna_userdef_update");
707 prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
708 RNA_def_property_range(prop, 1, 10);
709 RNA_def_property_ui_text(prop, "Face Dot Size", "");
710 RNA_def_property_update(prop, 0, "rna_userdef_update");
713 static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
720 srna= RNA_def_struct(brna, "ThemeView3D", NULL);
721 RNA_def_struct_sdna(srna, "ThemeSpace");
722 RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
724 rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D);
726 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
727 RNA_def_property_array(prop, 3);
728 RNA_def_property_ui_text(prop, "Grid", "");
729 RNA_def_property_update(prop, 0, "rna_userdef_update");
731 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
732 RNA_def_property_array(prop, 4);
733 RNA_def_property_ui_text(prop, "Panel", "");
734 RNA_def_property_update(prop, 0, "rna_userdef_update");
736 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR);
737 RNA_def_property_array(prop, 3);
738 RNA_def_property_ui_text(prop, "Wire", "");
739 RNA_def_property_update(prop, 0, "rna_userdef_update");
741 prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR);
742 RNA_def_property_array(prop, 4);
743 RNA_def_property_ui_text(prop, "Lamp", "");
744 RNA_def_property_update(prop, 0, "rna_userdef_update");
746 prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR);
747 RNA_def_property_float_sdna(prop, NULL, "select");
748 RNA_def_property_array(prop, 3);
749 RNA_def_property_ui_text(prop, "Object Selected", "");
750 RNA_def_property_update(prop, 0, "rna_userdef_update");
752 prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR);
753 RNA_def_property_float_sdna(prop, NULL, "active");
754 RNA_def_property_array(prop, 3);
755 RNA_def_property_ui_text(prop, "Active Object", "");
756 RNA_def_property_update(prop, 0, "rna_userdef_update");
758 prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR);
759 RNA_def_property_float_sdna(prop, NULL, "group");
760 RNA_def_property_array(prop, 3);
761 RNA_def_property_ui_text(prop, "Object Grouped", "");
762 RNA_def_property_update(prop, 0, "rna_userdef_update");
764 prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR);
765 RNA_def_property_float_sdna(prop, NULL, "group_active");
766 RNA_def_property_array(prop, 3);
767 RNA_def_property_ui_text(prop, "Object Grouped Active", "");
768 RNA_def_property_update(prop, 0, "rna_userdef_update");
770 prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR);
771 RNA_def_property_array(prop, 3);
772 RNA_def_property_ui_text(prop, "Transform", "");
773 RNA_def_property_update(prop, 0, "rna_userdef_update");
775 rna_def_userdef_theme_spaces_vertex(srna);
776 rna_def_userdef_theme_spaces_edge(srna);
777 rna_def_userdef_theme_spaces_face(srna);
779 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR);
780 RNA_def_property_array(prop, 4);
781 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
782 RNA_def_property_update(prop, 0, "rna_userdef_update");
784 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR);
785 RNA_def_property_array(prop, 3);
786 RNA_def_property_ui_text(prop, "Face Normal", "");
787 RNA_def_property_update(prop, 0, "rna_userdef_update");
789 prop= RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR);
790 RNA_def_property_array(prop, 3);
791 RNA_def_property_ui_text(prop, "Vertex Normal", "");
792 RNA_def_property_update(prop, 0, "rna_userdef_update");
794 prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR);
795 RNA_def_property_array(prop, 3);
796 RNA_def_property_ui_text(prop, "Bone Solid", "");
797 RNA_def_property_update(prop, 0, "rna_userdef_update");
799 prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR);
800 RNA_def_property_array(prop, 3);
801 RNA_def_property_ui_text(prop, "Bone Pose", "");
802 RNA_def_property_update(prop, 0, "rna_userdef_update");
804 prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR);
805 RNA_def_property_float_sdna(prop, NULL, "cframe");
806 RNA_def_property_array(prop, 3);
807 RNA_def_property_ui_text(prop, "Current Frame", "");
808 RNA_def_property_update(prop, 0, "rna_userdef_update");
811 static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
818 srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
819 RNA_def_struct_sdna(srna, "ThemeSpace");
820 RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
822 rna_def_userdef_theme_spaces_main(srna, SPACE_IPO);
824 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
825 RNA_def_property_array(prop, 3);
826 RNA_def_property_ui_text(prop, "Grid", "");
827 RNA_def_property_update(prop, 0, "rna_userdef_update");
829 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
830 RNA_def_property_array(prop, 3);
831 RNA_def_property_ui_text(prop, "Panel", "");
832 RNA_def_property_update(prop, 0, "rna_userdef_update");
834 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR);
835 RNA_def_property_float_sdna(prop, NULL, "shade1");
836 RNA_def_property_array(prop, 3);
837 RNA_def_property_ui_text(prop, "Window Sliders", "");
838 RNA_def_property_update(prop, 0, "rna_userdef_update");
840 prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR);
841 RNA_def_property_float_sdna(prop, NULL, "shade2");
842 RNA_def_property_array(prop, 3);
843 RNA_def_property_ui_text(prop, "Channels Region", "");
844 RNA_def_property_update(prop, 0, "rna_userdef_update");
846 rna_def_userdef_theme_spaces_vertex(srna);
848 prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR);
849 RNA_def_property_float_sdna(prop, NULL, "cframe");
850 RNA_def_property_array(prop, 3);
851 RNA_def_property_ui_text(prop, "Current Frame", "");
852 RNA_def_property_update(prop, 0, "rna_userdef_update");
854 prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR);
855 RNA_def_property_array(prop, 3);
856 RNA_def_property_ui_text(prop, "Handle Vertex", "");
857 RNA_def_property_update(prop, 0, "rna_userdef_update");
859 prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR);
860 RNA_def_property_array(prop, 3);
861 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
862 RNA_def_property_update(prop, 0, "rna_userdef_update");
864 prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
865 RNA_def_property_range(prop, 0, 255);
866 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
867 RNA_def_property_update(prop, 0, "rna_userdef_update");
869 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR);
870 RNA_def_property_float_sdna(prop, NULL, "group");
871 RNA_def_property_array(prop, 3);
872 RNA_def_property_ui_text(prop, "Channel Group", "");
873 RNA_def_property_update(prop, 0, "rna_userdef_update");
875 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR);
876 RNA_def_property_float_sdna(prop, NULL, "group_active");
877 RNA_def_property_array(prop, 3);
878 RNA_def_property_ui_text(prop, "Active Channel Group", "");
879 RNA_def_property_update(prop, 0, "rna_userdef_update");
881 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR);
882 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
883 RNA_def_property_array(prop, 3);
884 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
885 RNA_def_property_update(prop, 0, "rna_userdef_update");
887 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR);
888 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
889 RNA_def_property_array(prop, 3);
890 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
891 RNA_def_property_update(prop, 0, "rna_userdef_update");
894 static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
901 srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL);
902 RNA_def_struct_sdna(srna, "ThemeSpace");
903 RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
905 rna_def_userdef_theme_spaces_main(srna, SPACE_FILE);
907 prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR);
908 RNA_def_property_float_sdna(prop, NULL, "hilite");
909 RNA_def_property_array(prop, 3);
910 RNA_def_property_ui_text(prop, "Selected File", "");
911 RNA_def_property_update(prop, 0, "rna_userdef_update");
913 prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR);
914 RNA_def_property_float_sdna(prop, NULL, "panel");
915 RNA_def_property_array(prop, 3);
916 RNA_def_property_ui_text(prop, "Tiles", "");
917 RNA_def_property_update(prop, 0, "rna_userdef_update");
919 prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR);
920 RNA_def_property_float_sdna(prop, NULL, "shade1");
921 RNA_def_property_array(prop, 3);
922 RNA_def_property_ui_text(prop, "Scrollbar", "");
923 RNA_def_property_update(prop, 0, "rna_userdef_update");
925 prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR);
926 RNA_def_property_float_sdna(prop, NULL, "shade2");
927 RNA_def_property_array(prop, 3);
928 RNA_def_property_ui_text(prop, "Scroll Handle", "");
929 RNA_def_property_update(prop, 0, "rna_userdef_update");
931 prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR);
932 RNA_def_property_float_sdna(prop, NULL, "active");
933 RNA_def_property_array(prop, 3);
934 RNA_def_property_ui_text(prop, "Active File", "");
935 RNA_def_property_update(prop, 0, "rna_userdef_update");
937 prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR);
938 RNA_def_property_float_sdna(prop, NULL, "grid");
939 RNA_def_property_array(prop, 3);
940 RNA_def_property_ui_text(prop, "Active File Text", "");
941 RNA_def_property_update(prop, 0, "rna_userdef_update");
944 static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
950 srna= RNA_def_struct(brna, "ThemeOutliner", NULL);
951 RNA_def_struct_sdna(srna, "ThemeSpace");
952 RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
954 rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER);
957 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
963 srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
964 RNA_def_struct_sdna(srna, "ThemeSpace");
965 RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
967 rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
970 static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
977 srna= RNA_def_struct(brna, "ThemeConsole", NULL);
978 RNA_def_struct_sdna(srna, "ThemeSpace");
979 RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
981 rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE);
983 prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR);
984 RNA_def_property_float_sdna(prop, NULL, "console_output");
985 RNA_def_property_array(prop, 3);
986 RNA_def_property_ui_text(prop, "Line Output", "");
987 RNA_def_property_update(prop, 0, "rna_userdef_update");
989 prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR);
990 RNA_def_property_float_sdna(prop, NULL, "console_input");
991 RNA_def_property_array(prop, 3);
992 RNA_def_property_ui_text(prop, "Line Input", "");
993 RNA_def_property_update(prop, 0, "rna_userdef_update");
995 prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR);
996 RNA_def_property_float_sdna(prop, NULL, "console_info");
997 RNA_def_property_array(prop, 3);
998 RNA_def_property_ui_text(prop, "Line Info", "");
999 RNA_def_property_update(prop, 0, "rna_userdef_update");
1001 prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR);
1002 RNA_def_property_float_sdna(prop, NULL, "console_error");
1003 RNA_def_property_array(prop, 3);
1004 RNA_def_property_ui_text(prop, "Line Error", "");
1005 RNA_def_property_update(prop, 0, "rna_userdef_update");
1007 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR);
1008 RNA_def_property_float_sdna(prop, NULL, "console_cursor");
1009 RNA_def_property_array(prop, 3);
1010 RNA_def_property_ui_text(prop, "Cursor", "");
1011 RNA_def_property_update(prop, 0, "rna_userdef_update");
1014 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
1020 srna= RNA_def_struct(brna, "ThemeInfo", NULL);
1021 RNA_def_struct_sdna(srna, "ThemeSpace");
1022 RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
1024 rna_def_userdef_theme_spaces_main(srna, SPACE_INFO);
1028 static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
1035 srna= RNA_def_struct(brna, "ThemeTextEditor", NULL);
1036 RNA_def_struct_sdna(srna, "ThemeSpace");
1037 RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
1039 rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT);
1041 prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR);
1042 RNA_def_property_float_sdna(prop, NULL, "grid");
1043 RNA_def_property_array(prop, 3);
1044 RNA_def_property_ui_text(prop, "Line Numbers Background", "");
1045 RNA_def_property_update(prop, 0, "rna_userdef_update");
1047 prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR);
1048 RNA_def_property_float_sdna(prop, NULL, "shade1");
1049 RNA_def_property_array(prop, 3);
1050 RNA_def_property_ui_text(prop, "Scroll Bar", "");
1051 RNA_def_property_update(prop, 0, "rna_userdef_update");
1053 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR);
1054 RNA_def_property_float_sdna(prop, NULL, "shade2");
1055 RNA_def_property_array(prop, 3);
1056 RNA_def_property_ui_text(prop, "Selected Text", "");
1057 RNA_def_property_update(prop, 0, "rna_userdef_update");
1059 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR);
1060 RNA_def_property_float_sdna(prop, NULL, "hilite");
1061 RNA_def_property_array(prop, 3);
1062 RNA_def_property_ui_text(prop, "Cursor", "");
1063 RNA_def_property_update(prop, 0, "rna_userdef_update");
1065 prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR);
1066 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1067 RNA_def_property_array(prop, 3);
1068 RNA_def_property_ui_text(prop, "Syntax Builtin", "");
1069 RNA_def_property_update(prop, 0, "rna_userdef_update");
1071 prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR);
1072 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1073 RNA_def_property_array(prop, 3);
1074 RNA_def_property_ui_text(prop, "Syntax Special", "");
1075 RNA_def_property_update(prop, 0, "rna_userdef_update");
1077 prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR);
1078 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1079 RNA_def_property_array(prop, 3);
1080 RNA_def_property_ui_text(prop, "Syntax Comment", "");
1081 RNA_def_property_update(prop, 0, "rna_userdef_update");
1083 prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR);
1084 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1085 RNA_def_property_array(prop, 3);
1086 RNA_def_property_ui_text(prop, "Syntax String", "");
1087 RNA_def_property_update(prop, 0, "rna_userdef_update");
1089 prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR);
1090 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1091 RNA_def_property_array(prop, 3);
1092 RNA_def_property_ui_text(prop, "Syntax Numbers", "");
1093 RNA_def_property_update(prop, 0, "rna_userdef_update");
1096 static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
1103 srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL);
1104 RNA_def_struct_sdna(srna, "ThemeSpace");
1105 RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
1107 rna_def_userdef_theme_spaces_main(srna, SPACE_NODE);
1109 prop= RNA_def_property(srna, "wires", PROP_FLOAT, PROP_COLOR);
1110 RNA_def_property_float_sdna(prop, NULL, "wire");
1111 RNA_def_property_array(prop, 3);
1112 RNA_def_property_ui_text(prop, "Wires", "");
1113 RNA_def_property_update(prop, 0, "rna_userdef_update");
1115 prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR);
1116 RNA_def_property_float_sdna(prop, NULL, "edge_select");
1117 RNA_def_property_array(prop, 3);
1118 RNA_def_property_ui_text(prop, "Wire Select", "");
1119 RNA_def_property_update(prop, 0, "rna_userdef_update");
1121 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR);
1122 RNA_def_property_float_sdna(prop, NULL, "shade2");
1123 RNA_def_property_array(prop, 3);
1124 RNA_def_property_ui_text(prop, "Selected Text", "");
1125 RNA_def_property_update(prop, 0, "rna_userdef_update");
1127 prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR);
1128 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1129 RNA_def_property_array(prop, 4);
1130 RNA_def_property_ui_text(prop, "Node Backdrop", "");
1131 RNA_def_property_update(prop, 0, "rna_userdef_update");
1133 prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR);
1134 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1135 RNA_def_property_array(prop, 3);
1136 RNA_def_property_ui_text(prop, "In/Out Node", "");
1137 RNA_def_property_update(prop, 0, "rna_userdef_update");
1139 prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR);
1140 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1141 RNA_def_property_array(prop, 3);
1142 RNA_def_property_ui_text(prop, "Converter Node", "");
1143 RNA_def_property_update(prop, 0, "rna_userdef_update");
1145 prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR);
1146 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1147 RNA_def_property_array(prop, 3);
1148 RNA_def_property_ui_text(prop, "Operator Node", "");
1149 RNA_def_property_update(prop, 0, "rna_userdef_update");
1151 prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR);
1152 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1153 RNA_def_property_array(prop, 3);
1154 RNA_def_property_ui_text(prop, "Group Node", "");
1155 RNA_def_property_update(prop, 0, "rna_userdef_update");
1158 static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
1165 srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL);
1166 RNA_def_struct_sdna(srna, "ThemeSpace");
1167 RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor");
1169 rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC);
1171 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
1172 RNA_def_property_array(prop, 3);
1173 RNA_def_property_ui_text(prop, "Panel", "");
1174 RNA_def_property_update(prop, 0, "rna_userdef_update");
1178 static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
1185 srna= RNA_def_struct(brna, "ThemeProperties", NULL);
1186 RNA_def_struct_sdna(srna, "ThemeSpace");
1187 RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
1189 rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS);
1191 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
1192 RNA_def_property_array(prop, 3);
1193 RNA_def_property_ui_text(prop, "Panel", "");
1194 RNA_def_property_update(prop, 0, "rna_userdef_update");
1197 static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
1204 srna= RNA_def_struct(brna, "ThemeTimeline", NULL);
1205 RNA_def_struct_sdna(srna, "ThemeSpace");
1206 RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline");
1208 rna_def_userdef_theme_spaces_main(srna, SPACE_TIME);
1210 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1211 RNA_def_property_array(prop, 3);
1212 RNA_def_property_ui_text(prop, "Grid", "");
1213 RNA_def_property_update(prop, 0, "rna_userdef_update");
1215 prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR);
1216 RNA_def_property_float_sdna(prop, NULL, "cframe");
1217 RNA_def_property_array(prop, 3);
1218 RNA_def_property_ui_text(prop, "Current Frame", "");
1219 RNA_def_property_update(prop, 0, "rna_userdef_update");
1222 static void rna_def_userdef_theme_space_sound(BlenderRNA *brna)
1229 srna= RNA_def_struct(brna, "ThemeAudioWindow", NULL);
1230 RNA_def_struct_sdna(srna, "ThemeSpace");
1231 RNA_def_struct_ui_text(srna, "Theme Audio Window", "Theme settings for the Audio Window");
1233 rna_def_userdef_theme_spaces_main(srna, SPACE_SOUND);
1235 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1236 RNA_def_property_array(prop, 3);
1237 RNA_def_property_ui_text(prop, "Grid", "");
1238 RNA_def_property_update(prop, 0, "rna_userdef_update");
1240 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR);
1241 RNA_def_property_float_sdna(prop, NULL, "shade1");
1242 RNA_def_property_array(prop, 3);
1243 RNA_def_property_ui_text(prop, "Window Sliders", "");
1244 RNA_def_property_update(prop, 0, "rna_userdef_update");
1246 prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR);
1247 RNA_def_property_float_sdna(prop, NULL, "cframe");
1248 RNA_def_property_array(prop, 3);
1249 RNA_def_property_ui_text(prop, "Current Frame", "");
1250 RNA_def_property_update(prop, 0, "rna_userdef_update");
1253 static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
1260 srna= RNA_def_struct(brna, "ThemeImageEditor", NULL);
1261 RNA_def_struct_sdna(srna, "ThemeSpace");
1262 RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
1264 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1265 rna_def_userdef_theme_spaces_vertex(srna);
1266 rna_def_userdef_theme_spaces_face(srna);
1268 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR);
1269 RNA_def_property_array(prop, 4);
1270 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
1271 RNA_def_property_update(prop, 0, "rna_userdef_update");
1273 prop= RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR);
1274 RNA_def_property_float_sdna(prop, NULL, "preview_back");
1275 RNA_def_property_array(prop, 4);
1276 RNA_def_property_ui_text(prop, "Scope region background color", "");
1277 RNA_def_property_update(prop, 0, "rna_userdef_update");
1280 static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
1287 srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
1288 RNA_def_struct_sdna(srna, "ThemeSpace");
1289 RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
1291 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1293 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1294 RNA_def_property_array(prop, 3);
1295 RNA_def_property_ui_text(prop, "Grid", "");
1296 RNA_def_property_update(prop, 0, "rna_userdef_update");
1298 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR);
1299 RNA_def_property_float_sdna(prop, NULL, "shade1");
1300 RNA_def_property_array(prop, 3);
1301 RNA_def_property_ui_text(prop, "Window Sliders", "");
1302 RNA_def_property_update(prop, 0, "rna_userdef_update");
1304 prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR);
1305 RNA_def_property_float_sdna(prop, NULL, "movie");
1306 RNA_def_property_array(prop, 3);
1307 RNA_def_property_ui_text(prop, "Movie Strip", "");
1308 RNA_def_property_update(prop, 0, "rna_userdef_update");
1310 prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR);
1311 RNA_def_property_float_sdna(prop, NULL, "image");
1312 RNA_def_property_array(prop, 3);
1313 RNA_def_property_ui_text(prop, "Image Strip", "");
1314 RNA_def_property_update(prop, 0, "rna_userdef_update");
1316 prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR);
1317 RNA_def_property_float_sdna(prop, NULL, "scene");
1318 RNA_def_property_array(prop, 3);
1319 RNA_def_property_ui_text(prop, "Scene Strip", "");
1320 RNA_def_property_update(prop, 0, "rna_userdef_update");
1322 prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR);
1323 RNA_def_property_float_sdna(prop, NULL, "audio");
1324 RNA_def_property_array(prop, 3);
1325 RNA_def_property_ui_text(prop, "Audio Strip", "");
1326 RNA_def_property_update(prop, 0, "rna_userdef_update");
1328 prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR);
1329 RNA_def_property_float_sdna(prop, NULL, "effect");
1330 RNA_def_property_array(prop, 3);
1331 RNA_def_property_ui_text(prop, "Effect Strip", "");
1332 RNA_def_property_update(prop, 0, "rna_userdef_update");
1334 prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR);
1335 RNA_def_property_float_sdna(prop, NULL, "plugin");
1336 RNA_def_property_array(prop, 3);
1337 RNA_def_property_ui_text(prop, "Plugin Strip", "");
1338 RNA_def_property_update(prop, 0, "rna_userdef_update");
1340 prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR);
1341 RNA_def_property_float_sdna(prop, NULL, "transition");
1342 RNA_def_property_array(prop, 3);
1343 RNA_def_property_ui_text(prop, "Transition Strip", "");
1344 RNA_def_property_update(prop, 0, "rna_userdef_update");
1346 prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR);
1347 RNA_def_property_float_sdna(prop, NULL, "meta");
1348 RNA_def_property_array(prop, 3);
1349 RNA_def_property_ui_text(prop, "Meta Strip", "");
1350 RNA_def_property_update(prop, 0, "rna_userdef_update");
1352 prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR);
1353 RNA_def_property_float_sdna(prop, NULL, "cframe");
1354 RNA_def_property_array(prop, 3);
1355 RNA_def_property_ui_text(prop, "Current Frame", "");
1356 RNA_def_property_update(prop, 0, "rna_userdef_update");
1358 prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR);
1359 RNA_def_property_float_sdna(prop, NULL, "vertex_select");
1360 RNA_def_property_array(prop, 3);
1361 RNA_def_property_ui_text(prop, "Keyframe", "");
1362 RNA_def_property_update(prop, 0, "rna_userdef_update");
1364 prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR);
1365 RNA_def_property_float_sdna(prop, NULL, "bone_pose");
1366 RNA_def_property_array(prop, 3);
1367 RNA_def_property_ui_text(prop, "Draw Action", "");
1368 RNA_def_property_update(prop, 0, "rna_userdef_update");
1371 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
1378 srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL);
1379 RNA_def_struct_sdna(srna, "ThemeSpace");
1380 RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet");
1382 rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION);
1384 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1385 RNA_def_property_array(prop, 3);
1386 RNA_def_property_ui_text(prop, "Grid", "");
1387 RNA_def_property_update(prop, 0, "rna_userdef_update");
1389 prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR);
1390 RNA_def_property_float_sdna(prop, NULL, "face");
1391 RNA_def_property_array(prop, 3);
1392 RNA_def_property_ui_text(prop, "Value Sliders", "");
1393 RNA_def_property_update(prop, 0, "rna_userdef_update");
1395 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR);
1396 RNA_def_property_float_sdna(prop, NULL, "shade1");
1397 RNA_def_property_array(prop, 3);
1398 RNA_def_property_ui_text(prop, "View Sliders", "");
1399 RNA_def_property_update(prop, 0, "rna_userdef_update");
1401 prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR);
1402 RNA_def_property_float_sdna(prop, NULL, "shade2");
1403 RNA_def_property_array(prop, 3);
1404 RNA_def_property_ui_text(prop, "Channels", "");
1405 RNA_def_property_update(prop, 0, "rna_userdef_update");
1407 prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR);
1408 RNA_def_property_float_sdna(prop, NULL, "hilite");
1409 RNA_def_property_array(prop, 3);
1410 RNA_def_property_ui_text(prop, "Channels Selected", "");
1411 RNA_def_property_update(prop, 0, "rna_userdef_update");
1413 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR);
1414 RNA_def_property_float_sdna(prop, NULL, "group");
1415 RNA_def_property_array(prop, 3);
1416 RNA_def_property_ui_text(prop, "Channel Group", "");
1417 RNA_def_property_update(prop, 0, "rna_userdef_update");
1419 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR);
1420 RNA_def_property_float_sdna(prop, NULL, "group_active");
1421 RNA_def_property_array(prop, 3);
1422 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1423 RNA_def_property_update(prop, 0, "rna_userdef_update");
1425 prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR);
1426 RNA_def_property_float_sdna(prop, NULL, "strip");
1427 RNA_def_property_array(prop, 3);
1428 RNA_def_property_ui_text(prop, "Long Key", "");
1429 RNA_def_property_update(prop, 0, "rna_userdef_update");
1431 prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR);
1432 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1433 RNA_def_property_array(prop, 3);
1434 RNA_def_property_ui_text(prop, "Long Key Selected", "");
1435 RNA_def_property_update(prop, 0, "rna_userdef_update");
1437 prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR);
1438 RNA_def_property_float_sdna(prop, NULL, "cframe");
1439 RNA_def_property_array(prop, 3);
1440 RNA_def_property_ui_text(prop, "Current Frame", "");
1441 RNA_def_property_update(prop, 0, "rna_userdef_update");
1443 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR);
1444 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1445 RNA_def_property_array(prop, 3);
1446 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1447 RNA_def_property_update(prop, 0, "rna_userdef_update");
1449 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR);
1450 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1451 RNA_def_property_array(prop, 3);
1452 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1453 RNA_def_property_update(prop, 0, "rna_userdef_update");
1456 static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
1463 srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL);
1464 RNA_def_struct_sdna(srna, "ThemeSpace");
1465 RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor");
1467 rna_def_userdef_theme_spaces_main(srna, SPACE_NLA);
1469 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1470 RNA_def_property_array(prop, 3);
1471 RNA_def_property_ui_text(prop, "Grid", "");
1472 RNA_def_property_update(prop, 0, "rna_userdef_update");
1474 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR);
1475 RNA_def_property_float_sdna(prop, NULL, "shade1");
1476 RNA_def_property_array(prop, 3);
1477 RNA_def_property_ui_text(prop, "View Sliders", "");
1478 RNA_def_property_update(prop, 0, "rna_userdef_update");
1480 prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR);
1481 RNA_def_property_float_sdna(prop, NULL, "shade2");
1482 RNA_def_property_array(prop, 3);
1483 RNA_def_property_ui_text(prop, "Bars", "");
1484 RNA_def_property_update(prop, 0, "rna_userdef_update");
1486 prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR);
1487 RNA_def_property_float_sdna(prop, NULL, "hilite");
1488 RNA_def_property_array(prop, 3);
1489 RNA_def_property_ui_text(prop, "Bars Selected", "");
1490 RNA_def_property_update(prop, 0, "rna_userdef_update");
1492 prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR);
1493 RNA_def_property_float_sdna(prop, NULL, "strip");
1494 RNA_def_property_array(prop, 3);
1495 RNA_def_property_ui_text(prop, "Strips", "");
1496 RNA_def_property_update(prop, 0, "rna_userdef_update");
1498 prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR);
1499 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1500 RNA_def_property_array(prop, 3);
1501 RNA_def_property_ui_text(prop, "Strips Selected", "");
1502 RNA_def_property_update(prop, 0, "rna_userdef_update");
1504 prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR);
1505 RNA_def_property_float_sdna(prop, NULL, "cframe");
1506 RNA_def_property_array(prop, 3);
1507 RNA_def_property_ui_text(prop, "Current Frame", "");
1508 RNA_def_property_update(prop, 0, "rna_userdef_update");
1511 static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
1516 srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
1517 RNA_def_struct_sdna(srna, "ThemeWireColor");
1518 RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
1520 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR);
1521 RNA_def_property_float_sdna(prop, NULL, "solid");
1522 RNA_def_property_array(prop, 3);
1523 RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
1524 RNA_def_property_update(prop, 0, "rna_userdef_update");
1526 prop= RNA_def_property(srna, "selected", PROP_FLOAT, PROP_COLOR);
1527 RNA_def_property_float_sdna(prop, NULL, "select");
1528 RNA_def_property_array(prop, 3);
1529 RNA_def_property_ui_text(prop, "Selected", "Color used for selected bones");
1530 RNA_def_property_update(prop, 0, "rna_userdef_update");
1532 prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR);
1533 RNA_def_property_array(prop, 3);
1534 RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
1535 RNA_def_property_update(prop, 0, "rna_userdef_update");
1537 prop= RNA_def_property(srna, "colored_constraints", PROP_BOOLEAN, PROP_NONE);
1538 RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
1539 RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
1540 RNA_def_property_update(prop, 0, "rna_userdef_update");
1543 static void rna_def_userdef_themes(BlenderRNA *brna)
1548 static EnumPropertyItem active_theme_area[] = {
1549 {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
1550 {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
1551 {2, "TIMELINE", ICON_TIME, "Timeline", ""},
1552 {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
1553 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
1554 {5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
1555 {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
1556 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
1557 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
1558 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
1559 {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
1560 {11, "PROPERTIES", ICON_BUTS, "Properties", ""},
1561 {12, "OUTLINER", ICON_OOPS, "Outliner", ""},
1562 {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
1563 {15, "INFO", ICON_INFO, "Info", ""},
1564 {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
1565 {17, "CONSOLE", ICON_CONSOLE, "Console", ""},
1566 {0, NULL, 0, NULL, NULL}};
1568 srna= RNA_def_struct(brna, "Theme", NULL);
1569 RNA_def_struct_sdna(srna, "bTheme");
1570 RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface");
1572 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1573 RNA_def_property_ui_text(prop, "Name", "Name of the theme");
1574 RNA_def_struct_name_property(srna, prop);
1576 prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
1577 RNA_def_property_enum_sdna(prop, NULL, "active_theme_area");
1578 RNA_def_property_enum_items(prop, active_theme_area);
1579 RNA_def_property_ui_text(prop, "Active Theme Area", "");
1581 prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
1582 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1583 RNA_def_property_pointer_sdna(prop, NULL, "tui");
1584 RNA_def_property_struct_type(prop, "ThemeUserInterface");
1585 RNA_def_property_ui_text(prop, "User Interface", "");
1587 prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
1588 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1589 RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
1590 RNA_def_property_struct_type(prop, "ThemeView3D");
1591 RNA_def_property_ui_text(prop, "3D View", "");
1593 prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
1594 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1595 RNA_def_property_pointer_sdna(prop, NULL, "tipo");
1596 RNA_def_property_struct_type(prop, "ThemeGraphEditor");
1597 RNA_def_property_ui_text(prop, "Graph Editor", "");
1599 prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
1600 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1601 RNA_def_property_pointer_sdna(prop, NULL, "tfile");
1602 RNA_def_property_struct_type(prop, "ThemeFileBrowser");
1603 RNA_def_property_ui_text(prop, "File Browser", "");
1605 prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
1606 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1607 RNA_def_property_pointer_sdna(prop, NULL, "tnla");
1608 RNA_def_property_struct_type(prop, "ThemeNLAEditor");
1609 RNA_def_property_ui_text(prop, "NLA Editor", "");
1611 prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
1612 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1613 RNA_def_property_pointer_sdna(prop, NULL, "tact");
1614 RNA_def_property_struct_type(prop, "ThemeDopeSheet");
1615 RNA_def_property_ui_text(prop, "DopeSheet", "");
1617 prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
1618 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1619 RNA_def_property_pointer_sdna(prop, NULL, "tima");
1620 RNA_def_property_struct_type(prop, "ThemeImageEditor");
1621 RNA_def_property_ui_text(prop, "Image Editor", "");
1623 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
1624 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1625 RNA_def_property_pointer_sdna(prop, NULL, "tseq");
1626 RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
1627 RNA_def_property_ui_text(prop, "Sequence Editor", "");
1629 prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
1630 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1631 RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
1632 RNA_def_property_struct_type(prop, "ThemeProperties");
1633 RNA_def_property_ui_text(prop, "Properties", "");
1635 prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
1636 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1637 RNA_def_property_pointer_sdna(prop, NULL, "text");
1638 RNA_def_property_struct_type(prop, "ThemeTextEditor");
1639 RNA_def_property_ui_text(prop, "Text Editor", "");
1641 prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
1642 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1643 RNA_def_property_pointer_sdna(prop, NULL, "ttime");
1644 RNA_def_property_struct_type(prop, "ThemeTimeline");
1645 RNA_def_property_ui_text(prop, "Timeline", "");
1647 prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
1648 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1649 RNA_def_property_pointer_sdna(prop, NULL, "tnode");
1650 RNA_def_property_struct_type(prop, "ThemeNodeEditor");
1651 RNA_def_property_ui_text(prop, "Node Editor", "");
1653 prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
1654 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1655 RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
1656 RNA_def_property_struct_type(prop, "ThemeLogicEditor");
1657 RNA_def_property_ui_text(prop, "Logic Editor", "");
1659 prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
1660 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1661 RNA_def_property_pointer_sdna(prop, NULL, "toops");
1662 RNA_def_property_struct_type(prop, "ThemeOutliner");
1663 RNA_def_property_ui_text(prop, "Outliner", "");
1665 prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
1666 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1667 RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
1668 RNA_def_property_struct_type(prop, "ThemeInfo");
1669 RNA_def_property_ui_text(prop, "Info", "");
1671 prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
1672 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1673 RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
1674 RNA_def_property_struct_type(prop, "ThemeUserPreferences");
1675 RNA_def_property_ui_text(prop, "User Preferences", "");
1677 prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
1678 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1679 RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
1680 RNA_def_property_struct_type(prop, "ThemeConsole");
1681 RNA_def_property_ui_text(prop, "Console", "");
1683 prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
1684 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1685 RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
1686 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
1687 RNA_def_property_ui_text(prop, "Bone Color Sets", "");
1690 static void rna_def_userdef_extensions(BlenderRNA *brna)
1695 srna= RNA_def_struct(brna, "Extension", NULL);
1696 RNA_def_struct_sdna(srna, "bExtension");
1697 RNA_def_struct_ui_text(srna, "Extension", "Python extensions to be loaded automatically");
1699 prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
1700 RNA_def_property_ui_text(prop, "Module", "Module name");
1701 RNA_def_struct_name_property(srna, prop);
1705 static void rna_def_userdef_dothemes(BlenderRNA *brna)
1708 rna_def_userdef_theme_ui_style(brna);
1709 rna_def_userdef_theme_ui(brna);
1711 rna_def_userdef_theme_space_view3d(brna);
1712 rna_def_userdef_theme_space_graph(brna);
1713 rna_def_userdef_theme_space_file(brna);
1714 rna_def_userdef_theme_space_nla(brna);
1715 rna_def_userdef_theme_space_action(brna);
1716 rna_def_userdef_theme_space_image(brna);
1717 rna_def_userdef_theme_space_seq(brna);
1718 rna_def_userdef_theme_space_buts(brna);
1719 rna_def_userdef_theme_space_text(brna);
1720 rna_def_userdef_theme_space_time(brna);
1721 rna_def_userdef_theme_space_node(brna);
1722 rna_def_userdef_theme_space_outliner(brna);
1723 rna_def_userdef_theme_space_info(brna);
1724 rna_def_userdef_theme_space_userpref(brna);
1725 rna_def_userdef_theme_space_console(brna);
1726 rna_def_userdef_theme_space_sound(brna);
1727 rna_def_userdef_theme_space_logic(brna);
1728 rna_def_userdef_theme_colorset(brna);
1729 rna_def_userdef_themes(brna);
1730 rna_def_userdef_extensions(brna);
1733 static void rna_def_userdef_solidlight(BlenderRNA *brna)
1738 srna= RNA_def_struct(brna, "UserSolidLight", NULL);
1739 RNA_def_struct_sdna(srna, "SolidLight");
1740 RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
1742 prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
1743 RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
1744 RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
1745 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1747 prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
1748 RNA_def_property_float_sdna(prop, NULL, "vec");
1749 RNA_def_property_array(prop, 3);
1750 RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining");
1751 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1753 prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
1754 RNA_def_property_float_sdna(prop, NULL, "col");
1755 RNA_def_property_array(prop, 3);
1756 RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light");
1757 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1759 prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
1760 RNA_def_property_float_sdna(prop, NULL, "spec");
1761 RNA_def_property_array(prop, 3);
1762 RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight");
1763 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1766 static void rna_def_userdef_view(BlenderRNA *brna)
1768 static EnumPropertyItem timecode_styles[] = {
1769 {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"},
1770 {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode. Format is HH:MM:SS:FF"},
1771 {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"},
1772 {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", "Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead"},
1773 {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
1774 {0, NULL, 0, NULL, NULL}};
1779 srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
1780 RNA_def_struct_sdna(srna, "UserDef");
1781 RNA_def_struct_nested(brna, srna, "UserPreferences");
1782 RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
1787 prop= RNA_def_property(srna, "tooltips", PROP_BOOLEAN, PROP_NONE);
1788 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
1789 RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
1791 prop= RNA_def_property(srna, "display_object_info", PROP_BOOLEAN, PROP_NONE);
1792 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
1793 RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
1794 RNA_def_property_update(prop, 0, "rna_userdef_update");
1796 prop= RNA_def_property(srna, "global_scene", PROP_BOOLEAN, PROP_NONE);
1797 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
1798 RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens");
1799 RNA_def_property_update(prop, 0, "rna_userdef_update");
1801 prop= RNA_def_property(srna, "use_large_cursors", PROP_BOOLEAN, PROP_NONE);
1802 RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
1803 RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
1804 RNA_def_property_update(prop, 0, "rna_userdef_update");
1806 prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
1807 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME);
1808 RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
1809 RNA_def_property_update(prop, 0, "rna_userdef_update");
1811 prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
1812 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
1813 RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back");
1814 RNA_def_property_update(prop, 0, "rna_userdef_update");
1817 prop= RNA_def_property(srna, "open_mouse_over", PROP_BOOLEAN, PROP_NONE);
1818 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
1819 RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering");
1821 prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
1822 RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
1823 RNA_def_property_range(prop, 1, 40);
1824 RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening top level menus");
1826 prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
1827 RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
1828 RNA_def_property_range(prop, 1, 40);
1829 RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening sub level menus");
1831 /* Toolbox click-hold delay */
1832 prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
1833 RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
1834 RNA_def_property_range(prop, 1, 40);
1835 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");
1837 prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
1838 RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
1839 RNA_def_property_range(prop, 1, 40);
1840 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");
1842 prop= RNA_def_property(srna, "pin_floating_panels", PROP_BOOLEAN, PROP_NONE);
1843 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PANELPINNED);
1844 RNA_def_property_ui_text(prop, "Pin Floating Panels", "Make floating panels invoked by a hotkey (eg. N Key) open at the previous location");
1846 prop= RNA_def_property(srna, "use_column_layout", PROP_BOOLEAN, PROP_NONE);
1847 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
1848 RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
1850 prop= RNA_def_property(srna, "directional_menus", PROP_BOOLEAN, PROP_NONE);
1851 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
1852 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");
1854 prop= RNA_def_property(srna, "global_pivot", PROP_BOOLEAN, PROP_NONE);
1855 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
1856 RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
1858 prop= RNA_def_property(srna, "auto_depth", PROP_BOOLEAN, PROP_NONE);
1859 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
1860 RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
1863 prop= RNA_def_property(srna, "zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
1864 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
1865 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");
1868 prop= RNA_def_property(srna, "auto_perspective", PROP_BOOLEAN, PROP_NONE);
1869 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
1870 RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views");
1872 prop= RNA_def_property(srna, "rotate_around_selection", PROP_BOOLEAN, PROP_NONE);
1873 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
1874 RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
1877 prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
1878 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
1879 RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View");
1880 RNA_def_property_update(prop, 0, "rna_userdef_update");
1882 prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
1883 RNA_def_property_int_sdna(prop, NULL, "rvisize");
1884 RNA_def_property_range(prop, 10, 64);
1885 RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size");
1886 RNA_def_property_update(prop, 0, "rna_userdef_update");
1888 prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
1889 RNA_def_property_int_sdna(prop, NULL, "rvibright");
1890 RNA_def_property_range(prop, 0, 10);
1891 RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon");
1892 RNA_def_property_update(prop, 0, "rna_userdef_update");
1894 /* middle mouse button */
1895 prop= RNA_def_property(srna, "use_middle_mouse_paste", PROP_BOOLEAN, PROP_NONE);
1896 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
1897 RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
1899 prop= RNA_def_property(srna, "wheel_invert_zoom", PROP_BOOLEAN, PROP_NONE);
1900 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
1901 RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
1903 prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
1904 RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
1905 RNA_def_property_range(prop, 0, 32);
1906 RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
1908 prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
1909 RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
1910 RNA_def_property_range(prop, 0, 1000);
1911 RNA_def_property_ui_text(prop, "Smooth View", "The time to animate the view in milliseconds, zero to disable");
1913 prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
1914 RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
1915 RNA_def_property_range(prop, 0, 90);
1916 RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)");
1918 /* 3D transform widget */
1919 prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE);
1920 RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1);
1921 RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
1922 RNA_def_property_update(prop, 0, "rna_userdef_update");
1924 prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
1925 RNA_def_property_int_sdna(prop, NULL, "tw_size");
1926 RNA_def_property_range(prop, 2, 40);
1927 RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units");
1928 RNA_def_property_update(prop, 0, "rna_userdef_update");
1930 prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
1931 RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
1932 RNA_def_property_range(prop, 2, 40);
1933 RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius");
1934 RNA_def_property_update(prop, 0, "rna_userdef_update");
1936 prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
1937 RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
1938 RNA_def_property_range(prop, 4, 40);
1939 RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Hotspot in pixels for clicking widget handles");
1941 prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
1942 RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
1943 RNA_def_property_range(prop, 4, 10);
1944 RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display");
1945 RNA_def_property_update(prop, 0, "rna_userdef_update");
1947 /* View2D Grid Displays */
1948 prop= RNA_def_property(srna, "view2d_grid_minimum_spacing", PROP_INT, PROP_NONE);
1949 RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
1950 RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
1951 RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports");
1952 RNA_def_property_update(prop, 0, "rna_userdef_update");
1954 // TODO: add a setter for this, so that we can bump up the minimum size as necessary...
1955 prop= RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
1956 RNA_def_property_enum_items(prop, timecode_styles);
1957 RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
1958 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
1959 RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
1960 RNA_def_property_update(prop, 0, "rna_userdef_update");
1963 static void rna_def_userdef_edit(BlenderRNA *brna)
1968 static EnumPropertyItem auto_key_modes[] = {
1969 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
1970 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
1971 {0, NULL, 0, NULL, NULL}};
1973 // XXX: we could just use the one that is defined in rna_curve.h
1974 static EnumPropertyItem new_interpolation_types[] = {
1975 {BEZT_IPO_CONST, "CONSTANT", 0, "Constant", ""},
1976 {BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""},
1977 {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""},
1978 {0, NULL, 0, NULL, NULL}};
1980 static const EnumPropertyItem material_link_items[]= {
1981 {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
1982 {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"},
1983 {0, NULL, 0, NULL, NULL}};
1985 static const EnumPropertyItem object_align_items[]= {
1986 {0, "WORLD", 0, "World", "Align newly added objects facing the 3D View direction"},
1987 {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects to the world coordinates"},
1988 {0, NULL, 0, NULL, NULL}};
1990 srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
1991 RNA_def_struct_sdna(srna, "UserDef");
1992 RNA_def_struct_nested(brna, srna, "UserPreferences");
1993 RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
1997 prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
1998 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
1999 RNA_def_property_enum_items(prop, material_link_items);
2000 RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
2002 prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
2003 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2004 RNA_def_property_enum_items(prop, object_align_items);
2005 RNA_def_property_ui_text(prop, "Align Object To", "Align newly added objects facing the 3D View direction or the world coordinates");
2007 prop= RNA_def_property(srna, "enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
2008 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
2009 RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object");
2011 prop= RNA_def_property(srna, "drag_immediately", PROP_BOOLEAN, PROP_NONE);
2012 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DRAGIMMEDIATE);
2013 RNA_def_property_ui_text(prop, "Drag Immediately", "Moving things with a mouse drag doesn't require a click to confirm (Best for tablet users)");
2016 prop= RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
2017 RNA_def_property_int_sdna(prop, NULL, "undosteps");
2018 RNA_def_property_range(prop, 0, 64);
2019 RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
2021 prop= RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
2022 RNA_def_property_int_sdna(prop, NULL, "undomemory");
2023 RNA_def_property_range(prop, 0, 32767);
2024 RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
2026 prop= RNA_def_property(srna, "global_undo", PROP_BOOLEAN, PROP_NONE);
2027 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
2028 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");
2031 prop= RNA_def_property(srna, "snap_translate", PROP_BOOLEAN, PROP_NONE);
2032 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOGRABGRID);
2033 RNA_def_property_ui_text(prop, "Enable Translation Snap", "Snap objects and sub-objects to grid units when moving");
2035 prop= RNA_def_property(srna, "snap_rotate", PROP_BOOLEAN, PROP_NONE);
2036 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOROTGRID);
2037 RNA_def_property_ui_text(prop, "Enable Rotation Snap", "Snap objects and sub-objects to grid units when rotating");
2039 prop= RNA_def_property(srna, "snap_scale", PROP_BOOLEAN, PROP_NONE);
2040 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSIZEGRID);
2041 RNA_def_property_ui_text(prop, "Enable Scaling Snap", "Snap objects and sub-objects to grid units when scaling");
2043 /* auto keyframing */
2044 prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
2045 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
2046 RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones");
2048 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
2049 RNA_def_property_enum_items(prop, auto_key_modes);
2050 RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
2051 RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
2053 prop= RNA_def_property(srna, "auto_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
2054 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
2055 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves");
2057 prop= RNA_def_property(srna, "auto_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
2058 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
2059 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set");
2061 /* keyframing settings */
2062 prop= RNA_def_property(srna, "keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
2063 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
2064 RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
2066 prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
2067 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
2068 RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
2070 prop= RNA_def_property(srna, "insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
2071 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
2072 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");
2074 prop= RNA_def_property(srna, "new_interpolation_type", PROP_ENUM, PROP_NONE);
2075 RNA_def_property_enum_items(prop, new_interpolation_types);
2076 RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
2077 RNA_def_property_ui_text(prop, "New Interpolation Type", "");
2080 prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
2081 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
2082 RNA_def_property_ui_text(prop, "Allow Negative Frames", "Current frame number can be manually set to a negative value");
2085 prop= RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
2086 RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist");
2087 RNA_def_property_range(prop, 0, 100);
2088 RNA_def_property_ui_text(prop, "Grease Pencil Manhattan Distance", "Pixels moved by mouse per axis when drawing stroke");
2090 prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
2091 RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
2092 RNA_def_property_range(prop, 0, 100);
2093 RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include");
2095 prop= RNA_def_property(srna, "grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
2096 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
2097 RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
2099 prop= RNA_def_property(srna, "grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
2100 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
2101 RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
2103 prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
2104 RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
2105 RNA_def_property_range(prop, 0, 100);
2106 RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
2108 /* duplication linking */
2109 prop= RNA_def_property(srna, "duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
2110 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
2111 RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
2113 prop= RNA_def_property(srna, "duplicate_surface", PROP_BOOLEAN, PROP_NONE);
2114 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
2115 RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
2117 prop= RNA_def_property(srna, "duplicate_curve", PROP_BOOLEAN, PROP_NONE);
2118 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
2119 RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
2121 prop= RNA_def_property(srna, "duplicate_text", PROP_BOOLEAN, PROP_NONE);
2122 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
2123 RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
2125 prop= RNA_def_property(srna, "duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
2126 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
2127 RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
2129 prop= RNA_def_property(srna, "duplicate_armature", PROP_BOOLEAN, PROP_NONE);
2130 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
2131 RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
2133 prop= RNA_def_property(srna, "duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
2134 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
2135 RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
2137 prop= RNA_def_property(srna, "duplicate_material", PROP_BOOLEAN, PROP_NONE);
2138 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
2139 RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
2141 prop= RNA_def_property(srna, "duplicate_texture", PROP_BOOLEAN, PROP_NONE);
2142 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
2143 RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
2146 prop= RNA_def_property(srna, "duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
2147 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
2148 RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
2150 prop= RNA_def_property(srna, "duplicate_action", PROP_BOOLEAN, PROP_NONE);
2151 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
2152 RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
2154 prop= RNA_def_property(srna, "duplicate_particle", PROP_BOOLEAN, PROP_NONE);
2155 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
2156 RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
2159 static void rna_def_userdef_system(BlenderRNA *brna)
2164 static EnumPropertyItem gl_texture_clamp_items[] = {
2165 {0, "CLAMP_OFF", 0, "Off", ""},
2166 {8192, "CLAMP_8192", 0, "8192", ""},
2167 {4096, "CLAMP_4096", 0, "4096", ""},
2168 {2048, "CLAMP_2048", 0, "2048", ""},
2169 {1024, "CLAMP_1024", 0, "1024", ""},
2170 {512, "CLAMP_512", 0, "512", ""},
2171 {256, "CLAMP_256", 0, "256", ""},
2172 {128, "CLAMP_128", 0, "128", ""},
2173 {0, NULL, 0, NULL, NULL}};
2175 static EnumPropertyItem audio_mixing_samples_items[] = {
2176 {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
2177 {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
2178 {1024, "SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
2179 {2048, "SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
2180 {4096, "SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
2181 {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
2182 {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
2183 {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
2184 {0, NULL, 0, NULL, NULL}};
2186 static EnumPropertyItem audio_device_items[] = {
2187 {0, "NONE", 0, "None", "Null device - there will be no audio output"},
2189 {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage"},
2192 {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"},
2195 {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"},
2197 {0, NULL, 0, NULL, NULL}};
2199 static EnumPropertyItem audio_rate_items[] = {
2200 // {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
2201 // {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
2202 // {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
2203 // {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
2204 // {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
2205 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
2206 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
2207 // {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
2208 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
2209 {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
2210 {0, NULL, 0, NULL, NULL}};
2212 static EnumPropertyItem audio_format_items[] = {
2213 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
2214 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer"},
2215 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer"},
2216 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
2217 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
2218 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
2219 {0, NULL, 0, NULL, NULL}};
2221 static EnumPropertyItem audio_channel_items[] = {
2222 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2223 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
2224 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2225 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2226 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2227 {0, NULL, 0, NULL, NULL}};
2229 static EnumPropertyItem draw_method_items[] = {
2230 {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
2231 {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory"},
2232 {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
2233 {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)"},
2234 {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails"},
2235 {0, NULL, 0, NULL, NULL}};
2237 static EnumPropertyItem color_picker_types[] = {
2238 {USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
2239 {USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
2240 {USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
2241 {USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
2242 {0, NULL, 0, NULL, NULL}};
2244 /* hardcoded here, could become dynamic somehow */
2245 static EnumPropertyItem language_items[] = {
2246 {0, "ENGLISH", 0, "English", ""},
2247 {1, "JAPANESE", 0, "Japanese", ""},
2248 {2, "DUTCH", 0, "Dutch", ""},
2249 {3, "ITALIAN", 0, "Italian", ""},
2250 {4, "GERMAN", 0, "German", ""},
2251 {5, "FINNISH", 0, "Finnish", ""},
2252 {6, "SWEDISH", 0, "Swedish", ""},
2253 {7, "FRENCH", 0, "French", ""},
2254 {8, "SPANISH", 0, "Spanish", ""},
2255 {9, "CATALAN", 0, "Catalan", ""},
2256 {10, "CZECH", 0, "Czech", ""},
2257 {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""},
2258 {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""},
2259 {13, "RUSSIAN", 0, "Russian", ""},
2260 {14, "CROATIAN", 0, "Croatian", ""},
2261 {15, "SERBIAN", 0, "Serbian", ""},
2262 {16, "UKRAINIAN", 0, "Ukrainian", ""},
2263 {17, "POLISH", 0, "Polish", ""},
2264 {18, "ROMANIAN", 0, "Romanian", ""},
2265 {19, "ARABIC", 0, "Arabic", ""},
2266 {20, "BULGARIAN", 0, "Bulgarian", ""},
2267 {21, "GREEK", 0, "Greek", ""},
2268 {22, "KOREAN", 0, "Korean", ""},
2269 {0, NULL, 0, NULL, NULL}};
2271 srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
2272 RNA_def_struct_sdna(srna, "UserDef");
2273 RNA_def_struct_nested(brna, srna, "UserPreferences");
2274 RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
2278 prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE);
2279 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
2280 RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
2281 RNA_def_property_update(prop, 0, "rna_userdef_update");
2283 prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
2284 RNA_def_property_int_sdna(prop, NULL, "dpi");
2285 RNA_def_property_range(prop, 48, 128);
2286 RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
2287 RNA_def_property_update(prop, 0, "rna_userdef_update");
2289 prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
2290 RNA_def_property_int_sdna(prop, NULL, "scrollback");
2291 RNA_def_property_range(prop, 32, 32768);
2292 RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
2294 /* Language Selection */
2296 prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
2297 RNA_def_property_enum_items(prop, language_items);
2298 RNA_def_property_ui_text(prop, "Language", "Language use for translation");
2299 RNA_def_property_update(prop, 0, "rna_userdef_update");
2301 prop= RNA_def_property(srna, "translate_tooltips", PROP_BOOLEAN, PROP_NONE);
2302 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
2303 RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
2304 RNA_def_property_update(prop, 0, "rna_userdef_update");
2306 prop= RNA_def_property(srna, "translate_buttons", PROP_BOOLEAN, PROP_NONE);
2307 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS);
2308 RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels");
2309 RNA_def_property_update(prop, 0, "rna_userdef_update");
2311 prop= RNA_def_property(srna, "translate_toolbox", PROP_BOOLEAN, PROP_NONE);
2312 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS);
2313 RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu");
2314 RNA_def_property_update(prop, 0, "rna_userdef_update");
2316 prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
2317 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
2318 RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts");
2319 RNA_def_property_update(prop, 0, "rna_userdef_update");
2321 /* System & OpenGL */
2323 prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
2324 RNA_def_property_collection_sdna(prop, NULL, "light", "");
2325 RNA_def_property_struct_type(prop, "UserSolidLight");
2326 RNA_def_property_ui_text(prop, "Solid Lights", "Lights user to display objects in solid draw mode");
2328 prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
2329 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
2330 RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode");
2331 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2333 prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
2334 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2335 RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
2336 RNA_def_property_struct_type(prop, "ColorRamp");
2337 RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode");
2338 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2340 prop= RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
2341 RNA_def_property_enum_items(prop, color_picker_types);
2342 RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
2343 RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
2345 prop= RNA_def_property(srna, "enable_all_codecs", PROP_BOOLEAN, PROP_NONE);
2346 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
2347 RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)");
2349 prop= RNA_def_property(srna, "auto_run_python_scripts", PROP_BOOLEAN, PROP_NONE);
2350 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DONT_DOSCRIPTLINKS);
2351 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)");
2353 prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
2354 RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
2355 RNA_def_property_range(prop, 0, 500);
2356 RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
2358 prop= RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
2359 RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
2360 RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
2361 RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
2363 prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
2364 RNA_def_property_int_sdna(prop, NULL, "frameserverport");
2365 RNA_def_property_range(prop, 0, 32727);
2366 RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Framserver-Rendering");
2368 prop= RNA_def_property(srna, "clip_alpha", PROP_FLOAT, PROP_NONE);
2369 RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
2370 RNA_def_property_range(prop, 0.0f, 1.0f);
2371 RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
2372 RNA_def_property_update(prop, 0, "rna_userdef_update");
2374 prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
2375 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
2376 RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
2377 RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
2379 prop= RNA_def_property(srna, "use_vbos", PROP_BOOLEAN, PROP_NONE);
2380 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
2381 RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
2383 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2384 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
2385 RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)");
2387 prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
2388 RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
2389 RNA_def_property_enum_items(prop, gl_texture_clamp_items);
2390 RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
2391 RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
2393 prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
2394 RNA_def_property_int_sdna(prop, NULL, "textimeout");
2395 RNA_def_property_range(prop, 0, 3600);
2396 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.)");
2398 prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
2399 RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
2400 RNA_def_property_range(prop, 1, 3600);
2401 RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector");
2403 prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
2404 RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
2405 RNA_def_property_enum_items(prop, draw_method_items);
2406 RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
2407 RNA_def_property_update(prop, 0, "rna_userdef_update");
2409 prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
2410 RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
2411 RNA_def_property_enum_items(prop, audio_mixing_samples_items);
2412 RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer");
2413 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2415 prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
2416 RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
2417 RNA_def_property_enum_items(prop, audio_device_items);
2418 RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device");
2419 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2421 prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
2422 RNA_def_property_enum_sdna(prop, NULL, "audiorate");
2423 RNA_def_property_enum_items(prop, audio_rate_items);
2424 RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate");
2425 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2427 prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
2428 RNA_def_property_enum_sdna(prop, NULL, "audioformat");
2429 RNA_def_property_enum_items(prop, audio_format_items);
2430 RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format");
2431 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2433 prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
2434 RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
2435 RNA_def_property_enum_items(prop, audio_channel_items);
2436 RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
2437 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2439 prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
2440 RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
2441 RNA_def_property_range(prop, 10, 50);
2442 RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back");
2444 prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
2445 RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
2446 RNA_def_property_range(prop, 50, 1000);
2447 RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast");
2450 prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
2451 RNA_def_property_string_sdna(prop, NULL, "versemaster");
2452 RNA_def_property_ui_text(prop, "Verse Master", "The Verse Master-server IP");
2454 prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE);
2455 RNA_def_property_string_sdna(prop, NULL, "verseuser");
2456 RNA_def_property_ui_text(prop, "Verse Username", "The Verse user name");
2460 static void rna_def_userdef_input(BlenderRNA *brna)
2465 static EnumPropertyItem select_mouse_items[] = {
2466 {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
2467 {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
2468 {0, NULL, 0, NULL, NULL}};
2470 static EnumPropertyItem view_rotation_items[] = {
2471 {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
2472 {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
2473 {0, NULL, 0, NULL, NULL}};
2475 static EnumPropertyItem view_zoom_styles[] = {
2476 {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
2477 {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement"},
2478 {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center"},
2479 {0, NULL, 0, NULL, NULL}};
2481 static EnumPropertyItem view_zoom_axes[] = {
2482 {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"},
2483 {USER_ZOOM_DOLLY_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"},
2484 {0, NULL, 0, NULL, NULL}};
2486 srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
2487 RNA_def_struct_sdna(srna, "UserDef");
2488 RNA_def_struct_nested(brna, srna, "UserPreferences");
2489 RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
2491 prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
2492 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2493 RNA_def_property_enum_items(prop, select_mouse_items);
2494 RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection");
2496 prop= RNA_def_property(srna, "viewport_zoom_style", PROP_ENUM, PROP_NONE);
2497 RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
2498 RNA_def_property_enum_items(prop, view_zoom_styles);
2499 RNA_def_property_ui_text(prop, "Viewport Zoom Style", "Which style to use for viewport scaling");
2501 prop= RNA_def_property(srna, "zoom_axis", PROP_ENUM, PROP_NONE);
2502 RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
2503 RNA_def_property_enum_items(prop, view_zoom_axes);
2504 RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
2506 prop= RNA_def_property(srna, "invert_zoom_direction", PROP_BOOLEAN, PROP_NONE);
2507 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
2508 RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
2510 prop= RNA_def_property(srna, "view_rotation", PROP_ENUM, PROP_NONE);
2511 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2512 RNA_def_property_enum_items(prop, view_rotation_items);
2513 RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
2515 prop= RNA_def_property(srna, "continuous_mouse", PROP_BOOLEAN, PROP_NONE);
2516 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
2517 RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
2519 prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE);
2520 RNA_def_property_int_sdna(prop, NULL, "ndof_pan");
2521 RNA_def_property_range(prop, 0, 200);
2522 RNA_def_property_ui_text(prop, "NDof Pan Speed", "The overall panning speed of an NDOF device, as percent of standard");
2524 prop= RNA_def_property(srna, "ndof_rotate_speed", PROP_INT, PROP_NONE);
2525 RNA_def_property_int_sdna(prop, NULL, "ndof_rotate");
2526 RNA_def_property_range(prop, 0, 200);
2527 RNA_def_property_ui_text(prop, "NDof Rotation Speed", "The overall rotation speed of an NDOF device, as percent of standard");
2529 prop= RNA_def_property(srna, "double_click_time", PROP_INT, PROP_NONE);
2530 RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
2531 RNA_def_property_range(prop, 1, 1000);
2532 RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click");
2534 prop= RNA_def_property(srna, "emulate_3_button_mouse", PROP_BOOLEAN, PROP_NONE);
2535 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
2536 RNA_def_property_boolean_funcs(prop, NULL, "rna_userdef_emulate_set");
2537 RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)");
2539 prop= RNA_def_property(srna, "emulate_numpad", PROP_BOOLEAN, PROP_NONE);
2540 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
2541 RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
2544 static void rna_def_userdef_filepaths(BlenderRNA *brna)
2549 static EnumPropertyItem anim_player_presets[] = {
2550 //{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, // doesn't work yet!
2551 {1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
2552 {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
2553 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
2554 {4, "RV", 0, "rv", "Frame player from Tweak Software"},
2555 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
2556 {0, NULL, 0, NULL, NULL}};
2558 srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
2559 RNA_def_struct_sdna(srna, "UserDef");
2560 RNA_def_struct_nested(brna, srna, "UserPreferences");
2561 RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
2563 prop= RNA_def_property(srna, "hide_dot_files_datablocks", PROP_BOOLEAN, PROP_NONE);
2564 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
2565 RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
2567 prop= RNA_def_property(srna, "filter_file_extensions", PROP_BOOLEAN, PROP_NONE);
2568 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
2569 RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
2571 prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
2572 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
2573 RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
2575 prop= RNA_def_property(srna, "compress_file", PROP_BOOLEAN, PROP_NONE);
2576 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
2577 RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
2579 prop= RNA_def_property(srna, "load_ui", PROP_BOOLEAN, PROP_NONE);
2580 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
2581 RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
2583 prop= RNA_def_property(srna, "fonts_directory", PROP_STRING, PROP_DIRPATH);
2584 RNA_def_property_string_sdna(prop, NULL, "fontdir");
2585 RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
2587 prop= RNA_def_property(srna, "textures_directory", PROP_STRING, PROP_DIRPATH);
2588 RNA_def_property_string_sdna(prop, NULL, "textudir");
2589 RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
2591 prop= RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
2592 RNA_def_property_string_sdna(prop, NULL, "plugtexdir");
2593 RNA_def_property_ui_text(prop, "Texture Plugin Directory", "The default directory to search for texture plugins");
2595 prop= RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
2596 RNA_def_property_string_sdna(prop, NULL, "plugseqdir");
2597 RNA_def_property_ui_text(prop, "Sequence Plugin Directory", "The default directory to search for sequence plugins");
2599 prop= RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
2600 RNA_def_property_string_sdna(prop, NULL, "renderdir");
2601 RNA_def_property_ui_text(prop, "Render Output Directory", "The default directory for rendering output");
2603 prop= RNA_def_property(srna, "python_scripts_directory", PROP_STRING, PROP_DIRPATH);
2604 RNA_def_property_string_sdna(prop, NULL, "pythondir");
2605 RNA_def_property_ui_text(prop, "Python Scripts Directory", "The default directory to search for Python scripts (resets python module search path: sys.path)");
2607 prop= RNA_def_property(srna, "sounds_directory", PROP_STRING, PROP_DIRPATH);
2608 RNA_def_property_string_sdna(prop, NULL, "sounddir");
2609 RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
2611 prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
2612 RNA_def_property_string_sdna(prop, NULL, "tempdir");
2613 RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
2615 prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_DIRPATH);
2616 RNA_def_property_string_sdna(prop, NULL, "anim_player");
2617 RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player");
2619 prop= RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
2620 RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
2621 RNA_def_property_enum_items(prop, anim_player_presets);
2622 RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
2623 RNA_def_property_enum_default(prop, 1); /* set default to blender 2.4 player until an internal one is back */
2627 prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
2628 RNA_def_property_int_sdna(prop, NULL, "versions");
2629 RNA_def_property_range(prop, 0, 32);
2630 RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving");
2632 prop= RNA_def_property(srna, "auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
2633 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
2634 RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files");
2635 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2637 prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
2638 RNA_def_property_int_sdna(prop, NULL, "savetime");
2639 RNA_def_property_range(prop, 1, 60);
2640 RNA_def_property_ui_text(prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
2641 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2643 prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
2644 RNA_def_property_range(prop, 0, 30);
2645 RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
2647 prop= RNA_def_property(srna, "save_preview_images", PROP_BOOLEAN, PROP_NONE);
2648 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
2649 RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");
2652 void rna_def_userdef_extension_collection(BlenderRNA *brna, PropertyRNA *cprop)
2658 RNA_def_property_srna(cprop, "UserExtensions");
2659 srna= RNA_def_struct(brna, "UserExtensions", NULL);
2660 RNA_def_struct_ui_text(srna, "User Extensions", "Collection of extensions");
2662 func= RNA_def_function(srna, "new", "rna_userdef_extension_new");
2663 RNA_def_function_flag(func, FUNC_NO_SELF);
2664 RNA_def_function_ui_description(func, "Add a new camera to the main database");
2666 parm= RNA_def_pointer(func, "extension", "Extension", "", "Extension datablock.");
2667 RNA_def_function_return(func, parm);
2669 func= RNA_def_function(srna, "remove", "rna_userdef_extension_remove");
2670 RNA_def_function_flag(func, FUNC_NO_SELF);
2671 RNA_def_function_ui_description(func, "Remove a camera from the current blendfile.");
2672 parm= RNA_def_pointer(func, "extension", "Extension", "", "Extension to remove.");
2673 RNA_def_property_flag(parm, PROP_REQUIRED);
2676 void RNA_def_userdef(BlenderRNA *brna)
2681 static EnumPropertyItem user_pref_sections[] = {
2682 {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
2683 {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
2684 {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
2685 {USER_SECTION_EXTENSIONS, "EXTENSIONS", 0, "Extensions", ""},
2686 {USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
2687 {USER_SECTION_FILE, "FILES", 0, "File", ""},
2688 {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
2689 {0, NULL, 0, NULL, NULL}};
2691 rna_def_userdef_dothemes(brna);
2692 rna_def_userdef_solidlight(brna);
2694 srna= RNA_def_struct(brna, "UserPreferences", NULL);
2695 RNA_def_struct_sdna(srna, "UserDef");
2696 RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences");
2698 prop= RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
2699 RNA_def_property_enum_sdna(prop, NULL, "userpref");
2700 RNA_def_property_enum_items(prop, user_pref_sections);
2701 RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface");
2702 RNA_def_property_update(prop, 0, "rna_userdef_update");
2704 prop= RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
2705 RNA_def_property_collection_sdna(prop, NULL, "themes", NULL);
2706 RNA_def_property_struct_type(prop, "Theme");
2707 RNA_def_property_ui_text(prop, "Themes", "");
2709 prop= RNA_def_property(srna, "uistyles", PROP_COLLECTION, PROP_NONE);
2710 RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL);
2711 RNA_def_property_struct_type(prop, "ThemeStyle");
2712 RNA_def_property_ui_text(prop, "Styles", "");
2714 prop= RNA_def_property(srna, "extensions", PROP_COLLECTION, PROP_NONE);
2715 RNA_def_property_collection_sdna(prop, NULL, "extensions", NULL);
2716 RNA_def_property_struct_type(prop, "Extension");
2717 RNA_def_property_ui_text(prop, "Extension", "");
2718 rna_def_userdef_extension_collection(brna, prop);
2721 /* nested structs */
2722 prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
2723 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2724 RNA_def_property_struct_type(prop, "UserPreferencesView");
2725 RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL);
2726 RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
2728 prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
2729 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2730 RNA_def_property_struct_type(prop, "UserPreferencesEdit");
2731 RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL);
2732 RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
2734 prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
2735 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2736 RNA_def_property_struct_type(prop, "UserPreferencesInput");
2737 RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL);
2738 RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
2740 prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
2741 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2742 RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
2743 RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL);
2744 RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
2746 prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
2747 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2748 RNA_def_property_struct_type(prop, "UserPreferencesSystem");
2749 RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL);
2750 RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings");
2752 rna_def_userdef_view(brna);
2753 rna_def_userdef_edit(brna);
2754 rna_def_userdef_input(brna);
2755 rna_def_userdef_filepaths(brna);
2756 rna_def_userdef_system(brna);