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_enum_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"
35 #include "DNA_brush_types.h"
40 #include "BKE_utildefines.h"
42 #include "BKE_sound.h"
47 #include "BKE_DerivedMesh.h"
48 #include "BKE_depsgraph.h"
49 #include "DNA_object_types.h"
51 #include "BKE_global.h"
53 #include "MEM_guardedalloc.h"
54 #include "MEM_CacheLimiterC-Api.h"
56 static void rna_userdef_update(Main *bmain, Scene *scene, PointerRNA *ptr)
58 WM_main_add_notifier(NC_WINDOW, NULL);
61 static void rna_userdef_script_autoexec_update(Main *bmain, Scene *scene, PointerRNA *ptr)
63 UserDef *userdef = (UserDef*)ptr->data;
64 if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
65 else G.f |= G_SCRIPT_AUTOEXEC;
68 static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
70 GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
71 rna_userdef_update(bmain, scene, ptr);
74 static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
76 UserDef *userdef = (UserDef*)ptr->data;
79 userdef->flag |= USER_LMOUSESELECT;
80 userdef->flag &= ~USER_TWOBUTTONMOUSE;
83 userdef->flag &= ~USER_LMOUSESELECT;
86 static int rna_userdef_autokeymode_get(PointerRNA *ptr)
88 UserDef *userdef = (UserDef*)ptr->data;
89 short retval = userdef->autokey_mode;
91 if(!(userdef->autokey_mode & AUTOKEY_ON))
97 static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
99 UserDef *userdef = (UserDef*)ptr->data;
101 if(value == AUTOKEY_MODE_NORMAL) {
102 userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
103 userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
105 else if(value == AUTOKEY_MODE_EDITKEYS) {
106 userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
107 userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
111 static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
113 UserDef *userdef = (UserDef*)ptr->data;
114 int required_size = userdef->v2d_min_gridsize;
116 /* set the timecode style */
117 userdef->timecode_style= value;
119 /* adjust the v2d gridsize if needed so that timecodes don't overlap
120 * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
121 * things from getting too blown out
124 case USER_TIMECODE_MINIMAL:
125 case USER_TIMECODE_SECONDS_ONLY:
126 /* 35 is great most of the time, but not that great for full-blown */
129 case USER_TIMECODE_SMPTE_MSF:
132 case USER_TIMECODE_SMPTE_FULL:
133 /* the granddaddy! */
136 case USER_TIMECODE_MILLISECONDS:
141 if (U.v2d_min_gridsize < required_size)
142 U.v2d_min_gridsize= required_size;
145 static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
147 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesView, ptr->data);
150 static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
152 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
155 static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
157 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data);
160 static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
162 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
165 static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
167 return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
170 static void rna_UserDef_audio_update(Main *bmain, Scene *scene, PointerRNA *ptr)
175 static void rna_Userdef_memcache_update(Main *bmain, Scene *scene, PointerRNA *ptr)
177 MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
180 static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
184 vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
186 for(ob= bmain->object.first; ob; ob= ob->id.next) {
187 if(ob->mode & OB_MODE_WEIGHT_PAINT)
188 DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
191 rna_userdef_update(bmain, scene, ptr);
194 static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
196 WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
197 rna_userdef_update(bmain, scene, ptr);
200 static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
202 wmWindowManager *wm= bmain->wm.first;
205 WM_autosave_init(wm);
206 rna_userdef_update(bmain, scene, ptr);
209 static bAddon *rna_userdef_addon_new(void)
211 bAddon *bext= MEM_callocN(sizeof(bAddon), "bAddon");
212 BLI_addtail(&U.addons, bext);
216 static void rna_userdef_addon_remove(bAddon *bext)
218 BLI_freelinkN(&U.addons, bext);
221 static void rna_userdef_temp_update(Main *bmain, Scene *scene, PointerRNA *ptr)
223 extern char btempdir[];
224 UserDef *userdef = (UserDef*)ptr->data;
225 strncpy(btempdir, userdef->tempdir, FILE_MAXDIR+FILE_MAXFILE);
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, "shadow_offset_x", PROP_INT, PROP_NONE);
261 RNA_def_property_int_sdna(prop, NULL, "shadx");
262 RNA_def_property_range(prop, -10, 10);
263 RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
264 RNA_def_property_update(prop, 0, "rna_userdef_update");
266 prop= RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
267 RNA_def_property_int_sdna(prop, NULL, "shady");
268 RNA_def_property_range(prop, -10, 10);
269 RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
270 RNA_def_property_update(prop, 0, "rna_userdef_update");
272 prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
273 RNA_def_property_range(prop, 0.0f, 1.0f);
274 RNA_def_property_ui_text(prop, "Shadow Alpha", "");
275 RNA_def_property_update(prop, 0, "rna_userdef_update");
277 prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
278 RNA_def_property_range(prop, 0.0f, 1.0f);
279 RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
280 RNA_def_property_update(prop, 0, "rna_userdef_update");
283 static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
288 rna_def_userdef_theme_ui_font_style(brna);
290 srna= RNA_def_struct(brna, "ThemeStyle", NULL);
291 RNA_def_struct_sdna(srna, "uiStyle");
292 RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
294 prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
295 RNA_def_property_range(prop, 0.5, 2.0);
296 RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
298 prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
299 RNA_def_property_flag(prop, PROP_NEVER_NULL);
300 RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
301 RNA_def_property_struct_type(prop, "ThemeFontStyle");
302 RNA_def_property_ui_text(prop, "Panel Font", "");
303 RNA_def_property_update(prop, 0, "rna_userdef_update");
305 prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
306 RNA_def_property_flag(prop, PROP_NEVER_NULL);
307 RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
308 RNA_def_property_struct_type(prop, "ThemeFontStyle");
309 RNA_def_property_ui_text(prop, "Group Label Font", "");
310 RNA_def_property_update(prop, 0, "rna_userdef_update");
312 prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
313 RNA_def_property_flag(prop, PROP_NEVER_NULL);
314 RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
315 RNA_def_property_struct_type(prop, "ThemeFontStyle");
316 RNA_def_property_ui_text(prop, "Widget Label Font", "");
317 RNA_def_property_update(prop, 0, "rna_userdef_update");
319 prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
320 RNA_def_property_flag(prop, PROP_NEVER_NULL);
321 RNA_def_property_pointer_sdna(prop, NULL, "widget");
322 RNA_def_property_struct_type(prop, "ThemeFontStyle");
323 RNA_def_property_ui_text(prop, "Widget Font", "");
324 RNA_def_property_update(prop, 0, "rna_userdef_update");
328 static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
333 srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL);
334 RNA_def_struct_sdna(srna, "uiWidgetColors");
335 RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
337 prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR);
338 RNA_def_property_array(prop, 3);
339 RNA_def_property_ui_text(prop, "Outline", "");
340 RNA_def_property_update(prop, 0, "rna_userdef_update");
342 prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR);
343 RNA_def_property_array(prop, 4);
344 RNA_def_property_ui_text(prop, "Inner", "");
345 RNA_def_property_update(prop, 0, "rna_userdef_update");
347 prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR);
348 RNA_def_property_array(prop, 4);
349 RNA_def_property_ui_text(prop, "Inner Selected", "");
350 RNA_def_property_update(prop, 0, "rna_userdef_update");
352 prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR);
353 RNA_def_property_array(prop, 4);
354 RNA_def_property_ui_text(prop, "Item", "");
355 RNA_def_property_update(prop, 0, "rna_userdef_update");
357 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR);
358 RNA_def_property_array(prop, 3);
359 RNA_def_property_ui_text(prop, "Text", "");
360 RNA_def_property_update(prop, 0, "rna_userdef_update");
362 prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR);
363 RNA_def_property_array(prop, 3);
364 RNA_def_property_ui_text(prop, "Text Selected", "");
365 RNA_def_property_update(prop, 0, "rna_userdef_update");
367 prop= RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
368 RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
369 RNA_def_property_ui_text(prop, "Shaded", "");
370 RNA_def_property_update(prop, 0, "rna_userdef_update");
372 prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
373 RNA_def_property_range(prop, -100, 100);
374 RNA_def_property_ui_text(prop, "Shade Top", "");
375 RNA_def_property_update(prop, 0, "rna_userdef_update");
377 prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
378 RNA_def_property_range(prop, -100, 100);
379 RNA_def_property_ui_text(prop, "Shade Down", "");
380 RNA_def_property_update(prop, 0, "rna_userdef_update");
383 static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
388 srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
389 RNA_def_struct_sdna(srna, "uiWidgetStateColors");
390 RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors");
392 prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR);
393 RNA_def_property_array(prop, 3);
394 RNA_def_property_ui_text(prop, "Animated", "");
395 RNA_def_property_update(prop, 0, "rna_userdef_update");
397 prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR);
398 RNA_def_property_array(prop, 3);
399 RNA_def_property_ui_text(prop, "Animated Selected", "");
400 RNA_def_property_update(prop, 0, "rna_userdef_update");
402 prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR);
403 RNA_def_property_array(prop, 3);
404 RNA_def_property_ui_text(prop, "Keyframe", "");
405 RNA_def_property_update(prop, 0, "rna_userdef_update");
407 prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR);
408 RNA_def_property_array(prop, 3);
409 RNA_def_property_ui_text(prop, "Keyframe Selected", "");
410 RNA_def_property_update(prop, 0, "rna_userdef_update");
412 prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR);
413 RNA_def_property_array(prop, 3);
414 RNA_def_property_ui_text(prop, "Driven", "");
415 RNA_def_property_update(prop, 0, "rna_userdef_update");
417 prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR);
418 RNA_def_property_array(prop, 3);
419 RNA_def_property_ui_text(prop, "Driven Selected", "");
420 RNA_def_property_update(prop, 0, "rna_userdef_update");
422 prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
423 RNA_def_property_ui_text(prop, "Blend", "");
424 RNA_def_property_update(prop, 0, "rna_userdef_update");
427 static void rna_def_userdef_theme_ui(BlenderRNA *brna)
432 rna_def_userdef_theme_ui_wcol(brna);
433 rna_def_userdef_theme_ui_wcol_state(brna);
435 srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
436 RNA_def_struct_sdna(srna, "ThemeUI");
437 RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements");
439 prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
440 RNA_def_property_flag(prop, PROP_NEVER_NULL);
441 RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
442 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
443 RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
444 RNA_def_property_update(prop, 0, "rna_userdef_update");
446 prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
447 RNA_def_property_flag(prop, PROP_NEVER_NULL);
448 RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
449 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
450 RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
451 RNA_def_property_update(prop, 0, "rna_userdef_update");
453 prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
454 RNA_def_property_flag(prop, PROP_NEVER_NULL);
455 RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
456 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
457 RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
458 RNA_def_property_update(prop, 0, "rna_userdef_update");
460 prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
461 RNA_def_property_flag(prop, PROP_NEVER_NULL);
462 RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
463 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
464 RNA_def_property_ui_text(prop, "Text Widget Colors", "");
465 RNA_def_property_update(prop, 0, "rna_userdef_update");
467 prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
468 RNA_def_property_flag(prop, PROP_NEVER_NULL);
469 RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
470 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
471 RNA_def_property_ui_text(prop, "Option Widget Colors", "");
472 RNA_def_property_update(prop, 0, "rna_userdef_update");
474 prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
475 RNA_def_property_flag(prop, PROP_NEVER_NULL);
476 RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
477 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
478 RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
479 RNA_def_property_update(prop, 0, "rna_userdef_update");
481 prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
482 RNA_def_property_flag(prop, PROP_NEVER_NULL);
483 RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
484 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
485 RNA_def_property_ui_text(prop, "Number Widget Colors", "");
486 RNA_def_property_update(prop, 0, "rna_userdef_update");
488 prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
489 RNA_def_property_flag(prop, PROP_NEVER_NULL);
490 RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
491 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
492 RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
493 RNA_def_property_update(prop, 0, "rna_userdef_update");
495 prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
496 RNA_def_property_flag(prop, PROP_NEVER_NULL);
497 RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
498 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
499 RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
500 RNA_def_property_update(prop, 0, "rna_userdef_update");
502 prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
503 RNA_def_property_flag(prop, PROP_NEVER_NULL);
504 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
505 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
506 RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
507 RNA_def_property_update(prop, 0, "rna_userdef_update");
509 prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
510 RNA_def_property_flag(prop, PROP_NEVER_NULL);
511 RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
512 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
513 RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
514 RNA_def_property_update(prop, 0, "rna_userdef_update");
516 prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
517 RNA_def_property_flag(prop, PROP_NEVER_NULL);
518 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
519 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
520 RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
521 RNA_def_property_update(prop, 0, "rna_userdef_update");
523 prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
524 RNA_def_property_flag(prop, PROP_NEVER_NULL);
525 RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
526 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
527 RNA_def_property_ui_text(prop, "Menu Item Colors", "");
528 RNA_def_property_update(prop, 0, "rna_userdef_update");
530 prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
531 RNA_def_property_flag(prop, PROP_NEVER_NULL);
532 RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
533 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
534 RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
535 RNA_def_property_update(prop, 0, "rna_userdef_update");
537 prop= RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
538 RNA_def_property_flag(prop, PROP_NEVER_NULL);
539 RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress");
540 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
541 RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
542 RNA_def_property_update(prop, 0, "rna_userdef_update");
544 prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
545 RNA_def_property_flag(prop, PROP_NEVER_NULL);
546 RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
547 RNA_def_property_struct_type(prop, "ThemeWidgetColors");
548 RNA_def_property_ui_text(prop, "List Item Colors", "");
549 RNA_def_property_update(prop, 0, "rna_userdef_update");
551 prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
552 RNA_def_property_flag(prop, PROP_NEVER_NULL);
553 RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
554 RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
555 RNA_def_property_ui_text(prop, "State Colors", "");
556 RNA_def_property_update(prop, 0, "rna_userdef_update");
558 prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
559 RNA_def_property_string_sdna(prop, NULL, "iconfile");
560 RNA_def_property_ui_text(prop, "Icon File", "");
561 RNA_def_property_update(prop, 0, "rna_userdef_update");
564 static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype)
569 prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR);
570 RNA_def_property_array(prop, 3);
571 RNA_def_property_ui_text(prop, "Window Background", "");
572 RNA_def_property_update(prop, 0, "rna_userdef_update");
574 prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR);
575 RNA_def_property_array(prop, 3);
576 RNA_def_property_ui_text(prop, "Title", "");
577 RNA_def_property_update(prop, 0, "rna_userdef_update");
579 prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR);
580 RNA_def_property_array(prop, 3);
581 RNA_def_property_ui_text(prop, "Text", "");
582 RNA_def_property_update(prop, 0, "rna_userdef_update");
584 prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR);
585 RNA_def_property_array(prop, 3);
586 RNA_def_property_ui_text(prop, "Text Highlight", "");
587 RNA_def_property_update(prop, 0, "rna_userdef_update");
590 prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR);
591 RNA_def_property_array(prop, 3);
592 RNA_def_property_ui_text(prop, "Header", "");
593 RNA_def_property_update(prop, 0, "rna_userdef_update");
595 prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR);
596 RNA_def_property_array(prop, 3);
597 RNA_def_property_ui_text(prop, "Header Text", "");
598 RNA_def_property_update(prop, 0, "rna_userdef_update");
600 prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR);
601 RNA_def_property_array(prop, 3);
602 RNA_def_property_ui_text(prop, "Header Text Highlight", "");
603 RNA_def_property_update(prop, 0, "rna_userdef_update");
606 // if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) {
607 prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR);
608 RNA_def_property_array(prop, 3);
609 RNA_def_property_ui_text(prop, "Region Background", "");
610 RNA_def_property_update(prop, 0, "rna_userdef_update");
612 prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR);
613 RNA_def_property_array(prop, 3);
614 RNA_def_property_ui_text(prop, "Region Text Titles", "");
615 RNA_def_property_update(prop, 0, "rna_userdef_update");
617 prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR);
618 RNA_def_property_array(prop, 3);
619 RNA_def_property_ui_text(prop, "Region Text", "");
620 RNA_def_property_update(prop, 0, "rna_userdef_update");
622 prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR);
623 RNA_def_property_array(prop, 3);
624 RNA_def_property_ui_text(prop, "Region Text Highlight", "");
625 RNA_def_property_update(prop, 0, "rna_userdef_update");
629 if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) {
630 prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR);
631 RNA_def_property_array(prop, 3);
632 RNA_def_property_ui_text(prop, "Source List", "");
633 RNA_def_property_update(prop, 0, "rna_userdef_update");
635 prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR);
636 RNA_def_property_array(prop, 3);
637 RNA_def_property_ui_text(prop, "Source List Title", "");
638 RNA_def_property_update(prop, 0, "rna_userdef_update");
640 prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR);
641 RNA_def_property_array(prop, 3);
642 RNA_def_property_ui_text(prop, "Source List Text", "");
643 RNA_def_property_update(prop, 0, "rna_userdef_update");
645 prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR);
646 RNA_def_property_array(prop, 3);
647 RNA_def_property_ui_text(prop, "Source List Text Highlight", "");
648 RNA_def_property_update(prop, 0, "rna_userdef_update");
652 static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna)
656 prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR);
657 RNA_def_property_array(prop, 3);
658 RNA_def_property_ui_text(prop, "Vertex", "");
659 RNA_def_property_update(prop, 0, "rna_userdef_update");
661 prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR);
662 RNA_def_property_array(prop, 3);
663 RNA_def_property_ui_text(prop, "Vertex Select", "");
664 RNA_def_property_update(prop, 0, "rna_userdef_update");
666 prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
667 RNA_def_property_range(prop, 1, 10);
668 RNA_def_property_ui_text(prop, "Vertex Size", "");
669 RNA_def_property_update(prop, 0, "rna_userdef_update");
672 static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
676 prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR);
677 RNA_def_property_array(prop, 3);
678 RNA_def_property_ui_text(prop, "Edge Select", "");
679 RNA_def_property_update(prop, 0, "rna_userdef_update");
681 prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR);
682 RNA_def_property_array(prop, 3);
683 RNA_def_property_ui_text(prop, "Edge Seam", "");
684 RNA_def_property_update(prop, 0, "rna_userdef_update");
686 prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR);
687 RNA_def_property_array(prop, 3);
688 RNA_def_property_ui_text(prop, "Edge Sharp", "");
689 RNA_def_property_update(prop, 0, "rna_userdef_update");
691 prop= RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR);
692 RNA_def_property_array(prop, 3);
693 RNA_def_property_ui_text(prop, "Edge Crease", "");
694 RNA_def_property_update(prop, 0, "rna_userdef_update");
696 prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR);
697 RNA_def_property_array(prop, 3);
698 RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
699 RNA_def_property_update(prop, 0, "rna_userdef_update");
702 static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
706 prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR);
707 RNA_def_property_array(prop, 4);
708 RNA_def_property_ui_text(prop, "Face", "");
709 RNA_def_property_update(prop, 0, "rna_userdef_update");
711 prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR);
712 RNA_def_property_array(prop, 4);
713 RNA_def_property_ui_text(prop, "Face Selected", "");
714 RNA_def_property_update(prop, 0, "rna_userdef_update");
716 prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR);
717 RNA_def_property_array(prop, 3);
718 RNA_def_property_ui_text(prop, "Face Dot Selected", "");
719 RNA_def_property_update(prop, 0, "rna_userdef_update");
721 prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
722 RNA_def_property_range(prop, 1, 10);
723 RNA_def_property_ui_text(prop, "Face Dot Size", "");
724 RNA_def_property_update(prop, 0, "rna_userdef_update");
727 static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurbs)
732 prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR);
733 RNA_def_property_float_sdna(prop, NULL, "nurb_uline");
734 RNA_def_property_array(prop, 3);
735 RNA_def_property_ui_text(prop, "Nurb U-lines", "");
736 RNA_def_property_update(prop, 0, "rna_userdef_update");
738 prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR);
739 RNA_def_property_float_sdna(prop, NULL, "nurb_vline");
740 RNA_def_property_array(prop, 3);
741 RNA_def_property_ui_text(prop, "Nurb V-lines", "");
742 RNA_def_property_update(prop, 0, "rna_userdef_update");
744 prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR);
745 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline");
746 RNA_def_property_array(prop, 3);
747 RNA_def_property_ui_text(prop, "Nurb active U-lines", "");
748 RNA_def_property_update(prop, 0, "rna_userdef_update");
750 prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR);
751 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline");
752 RNA_def_property_array(prop, 3);
753 RNA_def_property_ui_text(prop, "Nurb active V-lines", "");
754 RNA_def_property_update(prop, 0, "rna_userdef_update");
756 prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR);
757 RNA_def_property_float_sdna(prop, NULL, "act_spline");
758 RNA_def_property_array(prop, 3);
759 RNA_def_property_ui_text(prop, "Active spline", "");
760 RNA_def_property_update(prop, 0, "rna_userdef_update");
763 prop= RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR);
764 RNA_def_property_float_sdna(prop, NULL, "handle_free");
765 RNA_def_property_array(prop, 3);
766 RNA_def_property_ui_text(prop, "Free handle color", "");
767 RNA_def_property_update(prop, 0, "rna_userdef_update");
769 prop= RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR);
770 RNA_def_property_float_sdna(prop, NULL, "handle_auto");
771 RNA_def_property_array(prop, 3);
772 RNA_def_property_ui_text(prop, "Auto handle color", "");
773 RNA_def_property_update(prop, 0, "rna_userdef_update");
775 prop= RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR);
776 RNA_def_property_float_sdna(prop, NULL, "handle_vect");
777 RNA_def_property_array(prop, 3);
778 RNA_def_property_ui_text(prop, "Vector handle color", "");
779 RNA_def_property_update(prop, 0, "rna_userdef_update");
781 prop= RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR);
782 RNA_def_property_float_sdna(prop, NULL, "handle_align");
783 RNA_def_property_array(prop, 3);
784 RNA_def_property_ui_text(prop, "Align handle color", "");
785 RNA_def_property_update(prop, 0, "rna_userdef_update");
787 prop= RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR);
788 RNA_def_property_float_sdna(prop, NULL, "handle_sel_free");
789 RNA_def_property_array(prop, 3);
790 RNA_def_property_ui_text(prop, "Free handle selected color", "");
791 RNA_def_property_update(prop, 0, "rna_userdef_update");
793 prop= RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR);
794 RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto");
795 RNA_def_property_array(prop, 3);
796 RNA_def_property_ui_text(prop, "Auto handle selected color", "");
797 RNA_def_property_update(prop, 0, "rna_userdef_update");
799 prop= RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR);
800 RNA_def_property_float_sdna(prop, NULL, "handle_sel_vect");
801 RNA_def_property_array(prop, 3);
802 RNA_def_property_ui_text(prop, "Vector handle selected color", "");
803 RNA_def_property_update(prop, 0, "rna_userdef_update");
805 prop= RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR);
806 RNA_def_property_float_sdna(prop, NULL, "handle_sel_align");
807 RNA_def_property_array(prop, 3);
808 RNA_def_property_ui_text(prop, "Align handle selected color", "");
809 RNA_def_property_update(prop, 0, "rna_userdef_update");
811 prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR);
812 RNA_def_property_float_sdna(prop, NULL, "lastsel_point");
813 RNA_def_property_array(prop, 3);
814 RNA_def_property_ui_text(prop, "Last selected point", "");
815 RNA_def_property_update(prop, 0, "rna_userdef_update");
818 static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
825 srna= RNA_def_struct(brna, "ThemeView3D", NULL);
826 RNA_def_struct_sdna(srna, "ThemeSpace");
827 RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
829 rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D);
831 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
832 RNA_def_property_array(prop, 3);
833 RNA_def_property_ui_text(prop, "Grid", "");
834 RNA_def_property_update(prop, 0, "rna_userdef_update");
836 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
837 RNA_def_property_array(prop, 4);
838 RNA_def_property_ui_text(prop, "Panel", "");
839 RNA_def_property_update(prop, 0, "rna_userdef_update");
841 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR);
842 RNA_def_property_array(prop, 3);
843 RNA_def_property_ui_text(prop, "Wire", "");
844 RNA_def_property_update(prop, 0, "rna_userdef_update");
846 prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR);
847 RNA_def_property_array(prop, 4);
848 RNA_def_property_ui_text(prop, "Lamp", "");
849 RNA_def_property_update(prop, 0, "rna_userdef_update");
851 prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR);
852 RNA_def_property_float_sdna(prop, NULL, "select");
853 RNA_def_property_array(prop, 3);
854 RNA_def_property_ui_text(prop, "Object Selected", "");
855 RNA_def_property_update(prop, 0, "rna_userdef_update");
857 prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR);
858 RNA_def_property_float_sdna(prop, NULL, "active");
859 RNA_def_property_array(prop, 3);
860 RNA_def_property_ui_text(prop, "Active Object", "");
861 RNA_def_property_update(prop, 0, "rna_userdef_update");
863 prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR);
864 RNA_def_property_float_sdna(prop, NULL, "group");
865 RNA_def_property_array(prop, 3);
866 RNA_def_property_ui_text(prop, "Object Grouped", "");
867 RNA_def_property_update(prop, 0, "rna_userdef_update");
869 prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR);
870 RNA_def_property_float_sdna(prop, NULL, "group_active");
871 RNA_def_property_array(prop, 3);
872 RNA_def_property_ui_text(prop, "Object Grouped Active", "");
873 RNA_def_property_update(prop, 0, "rna_userdef_update");
875 prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR);
876 RNA_def_property_array(prop, 3);
877 RNA_def_property_ui_text(prop, "Transform", "");
878 RNA_def_property_update(prop, 0, "rna_userdef_update");
880 rna_def_userdef_theme_spaces_vertex(srna);
881 rna_def_userdef_theme_spaces_edge(srna);
882 rna_def_userdef_theme_spaces_face(srna);
883 rna_def_userdef_theme_spaces_curves(srna, 1);
885 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR);
886 RNA_def_property_array(prop, 4);
887 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
888 RNA_def_property_update(prop, 0, "rna_userdef_update");
890 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR);
891 RNA_def_property_array(prop, 3);
892 RNA_def_property_ui_text(prop, "Face Normal", "");
893 RNA_def_property_update(prop, 0, "rna_userdef_update");
895 prop= RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR);
896 RNA_def_property_array(prop, 3);
897 RNA_def_property_ui_text(prop, "Vertex Normal", "");
898 RNA_def_property_update(prop, 0, "rna_userdef_update");
900 prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR);
901 RNA_def_property_array(prop, 3);
902 RNA_def_property_ui_text(prop, "Bone Solid", "");
903 RNA_def_property_update(prop, 0, "rna_userdef_update");
905 prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR);
906 RNA_def_property_array(prop, 3);
907 RNA_def_property_ui_text(prop, "Bone Pose", "");
908 RNA_def_property_update(prop, 0, "rna_userdef_update");
910 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR);
911 RNA_def_property_float_sdna(prop, NULL, "cframe");
912 RNA_def_property_array(prop, 3);
913 RNA_def_property_ui_text(prop, "Current Frame", "");
914 RNA_def_property_update(prop, 0, "rna_userdef_update");
917 static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
924 srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
925 RNA_def_struct_sdna(srna, "ThemeSpace");
926 RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
928 rna_def_userdef_theme_spaces_main(srna, SPACE_IPO);
930 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
931 RNA_def_property_array(prop, 3);
932 RNA_def_property_ui_text(prop, "Grid", "");
933 RNA_def_property_update(prop, 0, "rna_userdef_update");
935 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
936 RNA_def_property_array(prop, 3);
937 RNA_def_property_ui_text(prop, "Panel", "");
938 RNA_def_property_update(prop, 0, "rna_userdef_update");
940 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR);
941 RNA_def_property_float_sdna(prop, NULL, "shade1");
942 RNA_def_property_array(prop, 3);
943 RNA_def_property_ui_text(prop, "Window Sliders", "");
944 RNA_def_property_update(prop, 0, "rna_userdef_update");
946 prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR);
947 RNA_def_property_float_sdna(prop, NULL, "shade2");
948 RNA_def_property_array(prop, 3);
949 RNA_def_property_ui_text(prop, "Channels Region", "");
950 RNA_def_property_update(prop, 0, "rna_userdef_update");
952 rna_def_userdef_theme_spaces_vertex(srna);
953 rna_def_userdef_theme_spaces_curves(srna, 0);
955 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR);
956 RNA_def_property_float_sdna(prop, NULL, "cframe");
957 RNA_def_property_array(prop, 3);
958 RNA_def_property_ui_text(prop, "Current Frame", "");
959 RNA_def_property_update(prop, 0, "rna_userdef_update");
961 prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR);
962 RNA_def_property_array(prop, 3);
963 RNA_def_property_ui_text(prop, "Handle Vertex", "");
964 RNA_def_property_update(prop, 0, "rna_userdef_update");
966 prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR);
967 RNA_def_property_array(prop, 3);
968 RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
969 RNA_def_property_update(prop, 0, "rna_userdef_update");
971 prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
972 RNA_def_property_range(prop, 0, 255);
973 RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
974 RNA_def_property_update(prop, 0, "rna_userdef_update");
976 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR);
977 RNA_def_property_float_sdna(prop, NULL, "group");
978 RNA_def_property_array(prop, 3);
979 RNA_def_property_ui_text(prop, "Channel Group", "");
980 RNA_def_property_update(prop, 0, "rna_userdef_update");
982 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR);
983 RNA_def_property_float_sdna(prop, NULL, "group_active");
984 RNA_def_property_array(prop, 3);
985 RNA_def_property_ui_text(prop, "Active Channel Group", "");
986 RNA_def_property_update(prop, 0, "rna_userdef_update");
988 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR);
989 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
990 RNA_def_property_array(prop, 3);
991 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
992 RNA_def_property_update(prop, 0, "rna_userdef_update");
994 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR);
995 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
996 RNA_def_property_array(prop, 3);
997 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
998 RNA_def_property_update(prop, 0, "rna_userdef_update");
1001 static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
1008 srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL);
1009 RNA_def_struct_sdna(srna, "ThemeSpace");
1010 RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
1012 rna_def_userdef_theme_spaces_main(srna, SPACE_FILE);
1014 prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR);
1015 RNA_def_property_float_sdna(prop, NULL, "hilite");
1016 RNA_def_property_array(prop, 3);
1017 RNA_def_property_ui_text(prop, "Selected File", "");
1018 RNA_def_property_update(prop, 0, "rna_userdef_update");
1020 prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR);
1021 RNA_def_property_float_sdna(prop, NULL, "panel");
1022 RNA_def_property_array(prop, 3);
1023 RNA_def_property_ui_text(prop, "Tiles", "");
1024 RNA_def_property_update(prop, 0, "rna_userdef_update");
1026 prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR);
1027 RNA_def_property_float_sdna(prop, NULL, "shade1");
1028 RNA_def_property_array(prop, 3);
1029 RNA_def_property_ui_text(prop, "Scrollbar", "");
1030 RNA_def_property_update(prop, 0, "rna_userdef_update");
1032 prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR);
1033 RNA_def_property_float_sdna(prop, NULL, "shade2");
1034 RNA_def_property_array(prop, 3);
1035 RNA_def_property_ui_text(prop, "Scroll Handle", "");
1036 RNA_def_property_update(prop, 0, "rna_userdef_update");
1038 prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR);
1039 RNA_def_property_float_sdna(prop, NULL, "active");
1040 RNA_def_property_array(prop, 3);
1041 RNA_def_property_ui_text(prop, "Active File", "");
1042 RNA_def_property_update(prop, 0, "rna_userdef_update");
1044 prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR);
1045 RNA_def_property_float_sdna(prop, NULL, "grid");
1046 RNA_def_property_array(prop, 3);
1047 RNA_def_property_ui_text(prop, "Active File Text", "");
1048 RNA_def_property_update(prop, 0, "rna_userdef_update");
1051 static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
1055 /* space_outliner */
1057 srna= RNA_def_struct(brna, "ThemeOutliner", NULL);
1058 RNA_def_struct_sdna(srna, "ThemeSpace");
1059 RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
1061 rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER);
1064 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
1068 /* space_userpref */
1070 srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
1071 RNA_def_struct_sdna(srna, "ThemeSpace");
1072 RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
1074 rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
1077 static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
1084 srna= RNA_def_struct(brna, "ThemeConsole", NULL);
1085 RNA_def_struct_sdna(srna, "ThemeSpace");
1086 RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
1088 rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE);
1090 prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR);
1091 RNA_def_property_float_sdna(prop, NULL, "console_output");
1092 RNA_def_property_array(prop, 3);
1093 RNA_def_property_ui_text(prop, "Line Output", "");
1094 RNA_def_property_update(prop, 0, "rna_userdef_update");
1096 prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR);
1097 RNA_def_property_float_sdna(prop, NULL, "console_input");
1098 RNA_def_property_array(prop, 3);
1099 RNA_def_property_ui_text(prop, "Line Input", "");
1100 RNA_def_property_update(prop, 0, "rna_userdef_update");
1102 prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR);
1103 RNA_def_property_float_sdna(prop, NULL, "console_info");
1104 RNA_def_property_array(prop, 3);
1105 RNA_def_property_ui_text(prop, "Line Info", "");
1106 RNA_def_property_update(prop, 0, "rna_userdef_update");
1108 prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR);
1109 RNA_def_property_float_sdna(prop, NULL, "console_error");
1110 RNA_def_property_array(prop, 3);
1111 RNA_def_property_ui_text(prop, "Line Error", "");
1112 RNA_def_property_update(prop, 0, "rna_userdef_update");
1114 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR);
1115 RNA_def_property_float_sdna(prop, NULL, "console_cursor");
1116 RNA_def_property_array(prop, 3);
1117 RNA_def_property_ui_text(prop, "Cursor", "");
1118 RNA_def_property_update(prop, 0, "rna_userdef_update");
1121 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
1127 srna= RNA_def_struct(brna, "ThemeInfo", NULL);
1128 RNA_def_struct_sdna(srna, "ThemeSpace");
1129 RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
1131 rna_def_userdef_theme_spaces_main(srna, SPACE_INFO);
1135 static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
1142 srna= RNA_def_struct(brna, "ThemeTextEditor", NULL);
1143 RNA_def_struct_sdna(srna, "ThemeSpace");
1144 RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
1146 rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT);
1148 prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR);
1149 RNA_def_property_float_sdna(prop, NULL, "grid");
1150 RNA_def_property_array(prop, 3);
1151 RNA_def_property_ui_text(prop, "Line Numbers Background", "");
1152 RNA_def_property_update(prop, 0, "rna_userdef_update");
1154 prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR);
1155 RNA_def_property_float_sdna(prop, NULL, "shade1");
1156 RNA_def_property_array(prop, 3);
1157 RNA_def_property_ui_text(prop, "Scroll Bar", "");
1158 RNA_def_property_update(prop, 0, "rna_userdef_update");
1160 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR);
1161 RNA_def_property_float_sdna(prop, NULL, "shade2");
1162 RNA_def_property_array(prop, 3);
1163 RNA_def_property_ui_text(prop, "Selected Text", "");
1164 RNA_def_property_update(prop, 0, "rna_userdef_update");
1166 prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR);
1167 RNA_def_property_float_sdna(prop, NULL, "hilite");
1168 RNA_def_property_array(prop, 3);
1169 RNA_def_property_ui_text(prop, "Cursor", "");
1170 RNA_def_property_update(prop, 0, "rna_userdef_update");
1172 prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR);
1173 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1174 RNA_def_property_array(prop, 3);
1175 RNA_def_property_ui_text(prop, "Syntax Built-in", "");
1176 RNA_def_property_update(prop, 0, "rna_userdef_update");
1178 prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR);
1179 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1180 RNA_def_property_array(prop, 3);
1181 RNA_def_property_ui_text(prop, "Syntax Special", "");
1182 RNA_def_property_update(prop, 0, "rna_userdef_update");
1184 prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR);
1185 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1186 RNA_def_property_array(prop, 3);
1187 RNA_def_property_ui_text(prop, "Syntax Comment", "");
1188 RNA_def_property_update(prop, 0, "rna_userdef_update");
1190 prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR);
1191 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1192 RNA_def_property_array(prop, 3);
1193 RNA_def_property_ui_text(prop, "Syntax String", "");
1194 RNA_def_property_update(prop, 0, "rna_userdef_update");
1196 prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR);
1197 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1198 RNA_def_property_array(prop, 3);
1199 RNA_def_property_ui_text(prop, "Syntax Numbers", "");
1200 RNA_def_property_update(prop, 0, "rna_userdef_update");
1203 static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
1210 srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL);
1211 RNA_def_struct_sdna(srna, "ThemeSpace");
1212 RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
1214 rna_def_userdef_theme_spaces_main(srna, SPACE_NODE);
1216 prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR);
1217 RNA_def_property_float_sdna(prop, NULL, "wire");
1218 RNA_def_property_array(prop, 3);
1219 RNA_def_property_ui_text(prop, "Wires", "");
1220 RNA_def_property_update(prop, 0, "rna_userdef_update");
1222 prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR);
1223 RNA_def_property_float_sdna(prop, NULL, "edge_select");
1224 RNA_def_property_array(prop, 3);
1225 RNA_def_property_ui_text(prop, "Wire Select", "");
1226 RNA_def_property_update(prop, 0, "rna_userdef_update");
1228 prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR);
1229 RNA_def_property_float_sdna(prop, NULL, "shade2");
1230 RNA_def_property_array(prop, 3);
1231 RNA_def_property_ui_text(prop, "Selected Text", "");
1232 RNA_def_property_update(prop, 0, "rna_userdef_update");
1234 prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR);
1235 RNA_def_property_float_sdna(prop, NULL, "syntaxl");
1236 RNA_def_property_array(prop, 4);
1237 RNA_def_property_ui_text(prop, "Node Backdrop", "");
1238 RNA_def_property_update(prop, 0, "rna_userdef_update");
1240 prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR);
1241 RNA_def_property_float_sdna(prop, NULL, "syntaxn");
1242 RNA_def_property_array(prop, 3);
1243 RNA_def_property_ui_text(prop, "In/Out Node", "");
1244 RNA_def_property_update(prop, 0, "rna_userdef_update");
1246 prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR);
1247 RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1248 RNA_def_property_array(prop, 3);
1249 RNA_def_property_ui_text(prop, "Converter Node", "");
1250 RNA_def_property_update(prop, 0, "rna_userdef_update");
1252 prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR);
1253 RNA_def_property_float_sdna(prop, NULL, "syntaxb");
1254 RNA_def_property_array(prop, 3);
1255 RNA_def_property_ui_text(prop, "Operator Node", "");
1256 RNA_def_property_update(prop, 0, "rna_userdef_update");
1258 prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR);
1259 RNA_def_property_float_sdna(prop, NULL, "syntaxc");
1260 RNA_def_property_array(prop, 3);
1261 RNA_def_property_ui_text(prop, "Group Node", "");
1262 RNA_def_property_update(prop, 0, "rna_userdef_update");
1265 static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
1272 srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL);
1273 RNA_def_struct_sdna(srna, "ThemeSpace");
1274 RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor");
1276 rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC);
1278 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
1279 RNA_def_property_array(prop, 3);
1280 RNA_def_property_ui_text(prop, "Panel", "");
1281 RNA_def_property_update(prop, 0, "rna_userdef_update");
1285 static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
1292 srna= RNA_def_struct(brna, "ThemeProperties", NULL);
1293 RNA_def_struct_sdna(srna, "ThemeSpace");
1294 RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
1296 rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS);
1298 prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR);
1299 RNA_def_property_array(prop, 3);
1300 RNA_def_property_ui_text(prop, "Panel", "");
1301 RNA_def_property_update(prop, 0, "rna_userdef_update");
1304 static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
1311 srna= RNA_def_struct(brna, "ThemeTimeline", NULL);
1312 RNA_def_struct_sdna(srna, "ThemeSpace");
1313 RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline");
1315 rna_def_userdef_theme_spaces_main(srna, SPACE_TIME);
1317 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1318 RNA_def_property_array(prop, 3);
1319 RNA_def_property_ui_text(prop, "Grid", "");
1320 RNA_def_property_update(prop, 0, "rna_userdef_update");
1322 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR);
1323 RNA_def_property_float_sdna(prop, NULL, "cframe");
1324 RNA_def_property_array(prop, 3);
1325 RNA_def_property_ui_text(prop, "Current Frame", "");
1326 RNA_def_property_update(prop, 0, "rna_userdef_update");
1329 static void rna_def_userdef_theme_space_sound(BlenderRNA *brna)
1336 srna= RNA_def_struct(brna, "ThemeAudioWindow", NULL);
1337 RNA_def_struct_sdna(srna, "ThemeSpace");
1338 RNA_def_struct_ui_text(srna, "Theme Audio Window", "Theme settings for the Audio Window");
1340 rna_def_userdef_theme_spaces_main(srna, SPACE_SOUND);
1342 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1343 RNA_def_property_array(prop, 3);
1344 RNA_def_property_ui_text(prop, "Grid", "");
1345 RNA_def_property_update(prop, 0, "rna_userdef_update");
1347 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR);
1348 RNA_def_property_float_sdna(prop, NULL, "shade1");
1349 RNA_def_property_array(prop, 3);
1350 RNA_def_property_ui_text(prop, "Window Sliders", "");
1351 RNA_def_property_update(prop, 0, "rna_userdef_update");
1353 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR);
1354 RNA_def_property_float_sdna(prop, NULL, "cframe");
1355 RNA_def_property_array(prop, 3);
1356 RNA_def_property_ui_text(prop, "Current Frame", "");
1357 RNA_def_property_update(prop, 0, "rna_userdef_update");
1360 static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
1367 srna= RNA_def_struct(brna, "ThemeImageEditor", NULL);
1368 RNA_def_struct_sdna(srna, "ThemeSpace");
1369 RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
1371 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1372 rna_def_userdef_theme_spaces_vertex(srna);
1373 rna_def_userdef_theme_spaces_face(srna);
1375 prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR);
1376 RNA_def_property_array(prop, 4);
1377 RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
1378 RNA_def_property_update(prop, 0, "rna_userdef_update");
1380 prop= RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR);
1381 RNA_def_property_float_sdna(prop, NULL, "preview_back");
1382 RNA_def_property_array(prop, 4);
1383 RNA_def_property_ui_text(prop, "Scope region background color", "");
1384 RNA_def_property_update(prop, 0, "rna_userdef_update");
1387 static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
1394 srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
1395 RNA_def_struct_sdna(srna, "ThemeSpace");
1396 RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
1398 rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
1400 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1401 RNA_def_property_array(prop, 3);
1402 RNA_def_property_ui_text(prop, "Grid", "");
1403 RNA_def_property_update(prop, 0, "rna_userdef_update");
1405 prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR);
1406 RNA_def_property_float_sdna(prop, NULL, "shade1");
1407 RNA_def_property_array(prop, 3);
1408 RNA_def_property_ui_text(prop, "Window Sliders", "");
1409 RNA_def_property_update(prop, 0, "rna_userdef_update");
1411 prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR);
1412 RNA_def_property_float_sdna(prop, NULL, "movie");
1413 RNA_def_property_array(prop, 3);
1414 RNA_def_property_ui_text(prop, "Movie Strip", "");
1415 RNA_def_property_update(prop, 0, "rna_userdef_update");
1417 prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR);
1418 RNA_def_property_float_sdna(prop, NULL, "image");
1419 RNA_def_property_array(prop, 3);
1420 RNA_def_property_ui_text(prop, "Image Strip", "");
1421 RNA_def_property_update(prop, 0, "rna_userdef_update");
1423 prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR);
1424 RNA_def_property_float_sdna(prop, NULL, "scene");
1425 RNA_def_property_array(prop, 3);
1426 RNA_def_property_ui_text(prop, "Scene Strip", "");
1427 RNA_def_property_update(prop, 0, "rna_userdef_update");
1429 prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR);
1430 RNA_def_property_float_sdna(prop, NULL, "audio");
1431 RNA_def_property_array(prop, 3);
1432 RNA_def_property_ui_text(prop, "Audio Strip", "");
1433 RNA_def_property_update(prop, 0, "rna_userdef_update");
1435 prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR);
1436 RNA_def_property_float_sdna(prop, NULL, "effect");
1437 RNA_def_property_array(prop, 3);
1438 RNA_def_property_ui_text(prop, "Effect Strip", "");
1439 RNA_def_property_update(prop, 0, "rna_userdef_update");
1441 prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR);
1442 RNA_def_property_float_sdna(prop, NULL, "plugin");
1443 RNA_def_property_array(prop, 3);
1444 RNA_def_property_ui_text(prop, "Plugin Strip", "");
1445 RNA_def_property_update(prop, 0, "rna_userdef_update");
1447 prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR);
1448 RNA_def_property_float_sdna(prop, NULL, "transition");
1449 RNA_def_property_array(prop, 3);
1450 RNA_def_property_ui_text(prop, "Transition Strip", "");
1451 RNA_def_property_update(prop, 0, "rna_userdef_update");
1453 prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR);
1454 RNA_def_property_float_sdna(prop, NULL, "meta");
1455 RNA_def_property_array(prop, 3);
1456 RNA_def_property_ui_text(prop, "Meta Strip", "");
1457 RNA_def_property_update(prop, 0, "rna_userdef_update");
1459 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR);
1460 RNA_def_property_float_sdna(prop, NULL, "cframe");
1461 RNA_def_property_array(prop, 3);
1462 RNA_def_property_ui_text(prop, "Current Frame", "");
1463 RNA_def_property_update(prop, 0, "rna_userdef_update");
1465 prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR);
1466 RNA_def_property_float_sdna(prop, NULL, "vertex_select");
1467 RNA_def_property_array(prop, 3);
1468 RNA_def_property_ui_text(prop, "Keyframe", "");
1469 RNA_def_property_update(prop, 0, "rna_userdef_update");
1471 prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR);
1472 RNA_def_property_float_sdna(prop, NULL, "bone_pose");
1473 RNA_def_property_array(prop, 3);
1474 RNA_def_property_ui_text(prop, "Draw Action", "");
1475 RNA_def_property_update(prop, 0, "rna_userdef_update");
1478 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
1485 srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL);
1486 RNA_def_struct_sdna(srna, "ThemeSpace");
1487 RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet");
1489 rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION);
1491 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1492 RNA_def_property_array(prop, 3);
1493 RNA_def_property_ui_text(prop, "Grid", "");
1494 RNA_def_property_update(prop, 0, "rna_userdef_update");
1496 prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR);
1497 RNA_def_property_float_sdna(prop, NULL, "face");
1498 RNA_def_property_array(prop, 3);
1499 RNA_def_property_ui_text(prop, "Value Sliders", "");
1500 RNA_def_property_update(prop, 0, "rna_userdef_update");
1502 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR);
1503 RNA_def_property_float_sdna(prop, NULL, "shade1");
1504 RNA_def_property_array(prop, 3);
1505 RNA_def_property_ui_text(prop, "View Sliders", "");
1506 RNA_def_property_update(prop, 0, "rna_userdef_update");
1508 prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR);
1509 RNA_def_property_float_sdna(prop, NULL, "shade2");
1510 RNA_def_property_array(prop, 3);
1511 RNA_def_property_ui_text(prop, "Channels", "");
1512 RNA_def_property_update(prop, 0, "rna_userdef_update");
1514 prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR);
1515 RNA_def_property_float_sdna(prop, NULL, "hilite");
1516 RNA_def_property_array(prop, 3);
1517 RNA_def_property_ui_text(prop, "Channels Selected", "");
1518 RNA_def_property_update(prop, 0, "rna_userdef_update");
1520 prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR);
1521 RNA_def_property_float_sdna(prop, NULL, "group");
1522 RNA_def_property_array(prop, 3);
1523 RNA_def_property_ui_text(prop, "Channel Group", "");
1524 RNA_def_property_update(prop, 0, "rna_userdef_update");
1526 prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR);
1527 RNA_def_property_float_sdna(prop, NULL, "group_active");
1528 RNA_def_property_array(prop, 3);
1529 RNA_def_property_ui_text(prop, "Active Channel Group", "");
1530 RNA_def_property_update(prop, 0, "rna_userdef_update");
1532 prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR);
1533 RNA_def_property_float_sdna(prop, NULL, "strip");
1534 RNA_def_property_array(prop, 3);
1535 RNA_def_property_ui_text(prop, "Long Key", "");
1536 RNA_def_property_update(prop, 0, "rna_userdef_update");
1538 prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR);
1539 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1540 RNA_def_property_array(prop, 3);
1541 RNA_def_property_ui_text(prop, "Long Key Selected", "");
1542 RNA_def_property_update(prop, 0, "rna_userdef_update");
1544 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR);
1545 RNA_def_property_float_sdna(prop, NULL, "cframe");
1546 RNA_def_property_array(prop, 3);
1547 RNA_def_property_ui_text(prop, "Current Frame", "");
1548 RNA_def_property_update(prop, 0, "rna_userdef_update");
1550 prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR);
1551 RNA_def_property_float_sdna(prop, NULL, "ds_channel");
1552 RNA_def_property_array(prop, 3);
1553 RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
1554 RNA_def_property_update(prop, 0, "rna_userdef_update");
1556 prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR);
1557 RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
1558 RNA_def_property_array(prop, 3);
1559 RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1560 RNA_def_property_update(prop, 0, "rna_userdef_update");
1563 static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
1570 srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL);
1571 RNA_def_struct_sdna(srna, "ThemeSpace");
1572 RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor");
1574 rna_def_userdef_theme_spaces_main(srna, SPACE_NLA);
1576 prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR);
1577 RNA_def_property_array(prop, 3);
1578 RNA_def_property_ui_text(prop, "Grid", "");
1579 RNA_def_property_update(prop, 0, "rna_userdef_update");
1581 prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR);
1582 RNA_def_property_float_sdna(prop, NULL, "shade1");
1583 RNA_def_property_array(prop, 3);
1584 RNA_def_property_ui_text(prop, "View Sliders", "");
1585 RNA_def_property_update(prop, 0, "rna_userdef_update");
1587 prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR);
1588 RNA_def_property_float_sdna(prop, NULL, "shade2");
1589 RNA_def_property_array(prop, 3);
1590 RNA_def_property_ui_text(prop, "Bars", "");
1591 RNA_def_property_update(prop, 0, "rna_userdef_update");
1593 prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR);
1594 RNA_def_property_float_sdna(prop, NULL, "hilite");
1595 RNA_def_property_array(prop, 3);
1596 RNA_def_property_ui_text(prop, "Bars Selected", "");
1597 RNA_def_property_update(prop, 0, "rna_userdef_update");
1599 prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR);
1600 RNA_def_property_float_sdna(prop, NULL, "strip");
1601 RNA_def_property_array(prop, 3);
1602 RNA_def_property_ui_text(prop, "Strips", "");
1603 RNA_def_property_update(prop, 0, "rna_userdef_update");
1605 prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR);
1606 RNA_def_property_float_sdna(prop, NULL, "strip_select");
1607 RNA_def_property_array(prop, 3);
1608 RNA_def_property_ui_text(prop, "Strips Selected", "");
1609 RNA_def_property_update(prop, 0, "rna_userdef_update");
1611 prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR);
1612 RNA_def_property_float_sdna(prop, NULL, "cframe");
1613 RNA_def_property_array(prop, 3);
1614 RNA_def_property_ui_text(prop, "Current Frame", "");
1615 RNA_def_property_update(prop, 0, "rna_userdef_update");
1618 static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
1623 srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
1624 RNA_def_struct_sdna(srna, "ThemeWireColor");
1625 RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
1627 prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR);
1628 RNA_def_property_float_sdna(prop, NULL, "solid");
1629 RNA_def_property_array(prop, 3);
1630 RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
1631 RNA_def_property_update(prop, 0, "rna_userdef_update");
1633 prop= RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR);
1634 RNA_def_property_float_sdna(prop, NULL, "select");
1635 RNA_def_property_array(prop, 3);
1636 RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
1637 RNA_def_property_update(prop, 0, "rna_userdef_update");
1639 prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR);
1640 RNA_def_property_array(prop, 3);
1641 RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
1642 RNA_def_property_update(prop, 0, "rna_userdef_update");
1644 prop= RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
1645 RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
1646 RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
1647 RNA_def_property_update(prop, 0, "rna_userdef_update");
1650 static void rna_def_userdef_themes(BlenderRNA *brna)
1655 static EnumPropertyItem active_theme_area[] = {
1656 {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
1657 {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
1658 {2, "TIMELINE", ICON_TIME, "Timeline", ""},
1659 {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
1660 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
1661 {5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
1662 {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
1663 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
1664 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
1665 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
1666 {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
1667 {11, "PROPERTIES", ICON_BUTS, "Properties", ""},
1668 {12, "OUTLINER", ICON_OOPS, "Outliner", ""},
1669 {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
1670 {15, "INFO", ICON_INFO, "Info", ""},
1671 {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
1672 {17, "CONSOLE", ICON_CONSOLE, "Console", ""},
1673 {0, NULL, 0, NULL, NULL}};
1675 srna= RNA_def_struct(brna, "Theme", NULL);
1676 RNA_def_struct_sdna(srna, "bTheme");
1677 RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface");
1679 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1680 RNA_def_property_ui_text(prop, "Name", "Name of the theme");
1681 RNA_def_struct_name_property(srna, prop);
1683 prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
1684 RNA_def_property_enum_sdna(prop, NULL, "active_theme_area");
1685 RNA_def_property_enum_items(prop, active_theme_area);
1686 RNA_def_property_ui_text(prop, "Active Theme Area", "");
1688 prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
1689 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1690 RNA_def_property_pointer_sdna(prop, NULL, "tui");
1691 RNA_def_property_struct_type(prop, "ThemeUserInterface");
1692 RNA_def_property_ui_text(prop, "User Interface", "");
1694 prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
1695 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1696 RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
1697 RNA_def_property_struct_type(prop, "ThemeView3D");
1698 RNA_def_property_ui_text(prop, "3D View", "");
1700 prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
1701 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1702 RNA_def_property_pointer_sdna(prop, NULL, "tipo");
1703 RNA_def_property_struct_type(prop, "ThemeGraphEditor");
1704 RNA_def_property_ui_text(prop, "Graph Editor", "");
1706 prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
1707 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1708 RNA_def_property_pointer_sdna(prop, NULL, "tfile");
1709 RNA_def_property_struct_type(prop, "ThemeFileBrowser");
1710 RNA_def_property_ui_text(prop, "File Browser", "");
1712 prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
1713 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1714 RNA_def_property_pointer_sdna(prop, NULL, "tnla");
1715 RNA_def_property_struct_type(prop, "ThemeNLAEditor");
1716 RNA_def_property_ui_text(prop, "NLA Editor", "");
1718 prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
1719 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1720 RNA_def_property_pointer_sdna(prop, NULL, "tact");
1721 RNA_def_property_struct_type(prop, "ThemeDopeSheet");
1722 RNA_def_property_ui_text(prop, "DopeSheet", "");
1724 prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
1725 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1726 RNA_def_property_pointer_sdna(prop, NULL, "tima");
1727 RNA_def_property_struct_type(prop, "ThemeImageEditor");
1728 RNA_def_property_ui_text(prop, "Image Editor", "");
1730 prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
1731 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1732 RNA_def_property_pointer_sdna(prop, NULL, "tseq");
1733 RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
1734 RNA_def_property_ui_text(prop, "Sequence Editor", "");
1736 prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
1737 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1738 RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
1739 RNA_def_property_struct_type(prop, "ThemeProperties");
1740 RNA_def_property_ui_text(prop, "Properties", "");
1742 prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
1743 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1744 RNA_def_property_pointer_sdna(prop, NULL, "text");
1745 RNA_def_property_struct_type(prop, "ThemeTextEditor");
1746 RNA_def_property_ui_text(prop, "Text Editor", "");
1748 prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
1749 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1750 RNA_def_property_pointer_sdna(prop, NULL, "ttime");
1751 RNA_def_property_struct_type(prop, "ThemeTimeline");
1752 RNA_def_property_ui_text(prop, "Timeline", "");
1754 prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
1755 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1756 RNA_def_property_pointer_sdna(prop, NULL, "tnode");
1757 RNA_def_property_struct_type(prop, "ThemeNodeEditor");
1758 RNA_def_property_ui_text(prop, "Node Editor", "");
1760 prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
1761 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1762 RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
1763 RNA_def_property_struct_type(prop, "ThemeLogicEditor");
1764 RNA_def_property_ui_text(prop, "Logic Editor", "");
1766 prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
1767 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1768 RNA_def_property_pointer_sdna(prop, NULL, "toops");
1769 RNA_def_property_struct_type(prop, "ThemeOutliner");
1770 RNA_def_property_ui_text(prop, "Outliner", "");
1772 prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
1773 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1774 RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
1775 RNA_def_property_struct_type(prop, "ThemeInfo");
1776 RNA_def_property_ui_text(prop, "Info", "");
1778 prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
1779 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1780 RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
1781 RNA_def_property_struct_type(prop, "ThemeUserPreferences");
1782 RNA_def_property_ui_text(prop, "User Preferences", "");
1784 prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
1785 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1786 RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
1787 RNA_def_property_struct_type(prop, "ThemeConsole");
1788 RNA_def_property_ui_text(prop, "Console", "");
1790 prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
1791 RNA_def_property_flag(prop, PROP_NEVER_NULL);
1792 RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
1793 RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
1794 RNA_def_property_ui_text(prop, "Bone Color Sets", "");
1797 static void rna_def_userdef_addon(BlenderRNA *brna)
1802 srna= RNA_def_struct(brna, "Addon", NULL);
1803 RNA_def_struct_sdna(srna, "bAddon");
1804 RNA_def_struct_ui_text(srna, "Addon", "Python addons to be loaded automatically");
1806 prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
1807 RNA_def_property_ui_text(prop, "Module", "Module name");
1808 RNA_def_struct_name_property(srna, prop);
1812 static void rna_def_userdef_dothemes(BlenderRNA *brna)
1815 rna_def_userdef_theme_ui_style(brna);
1816 rna_def_userdef_theme_ui(brna);
1818 rna_def_userdef_theme_space_view3d(brna);
1819 rna_def_userdef_theme_space_graph(brna);
1820 rna_def_userdef_theme_space_file(brna);
1821 rna_def_userdef_theme_space_nla(brna);
1822 rna_def_userdef_theme_space_action(brna);
1823 rna_def_userdef_theme_space_image(brna);
1824 rna_def_userdef_theme_space_seq(brna);
1825 rna_def_userdef_theme_space_buts(brna);
1826 rna_def_userdef_theme_space_text(brna);
1827 rna_def_userdef_theme_space_time(brna);
1828 rna_def_userdef_theme_space_node(brna);
1829 rna_def_userdef_theme_space_outliner(brna);
1830 rna_def_userdef_theme_space_info(brna);
1831 rna_def_userdef_theme_space_userpref(brna);
1832 rna_def_userdef_theme_space_console(brna);
1833 rna_def_userdef_theme_space_sound(brna);
1834 rna_def_userdef_theme_space_logic(brna);
1835 rna_def_userdef_theme_colorset(brna);
1836 rna_def_userdef_themes(brna);
1839 static void rna_def_userdef_solidlight(BlenderRNA *brna)
1844 srna= RNA_def_struct(brna, "UserSolidLight", NULL);
1845 RNA_def_struct_sdna(srna, "SolidLight");
1846 RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
1848 prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
1849 RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
1850 RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
1851 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1853 prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
1854 RNA_def_property_float_sdna(prop, NULL, "vec");
1855 RNA_def_property_array(prop, 3);
1856 RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining");
1857 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1859 prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
1860 RNA_def_property_float_sdna(prop, NULL, "col");
1861 RNA_def_property_array(prop, 3);
1862 RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light");
1863 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1865 prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
1866 RNA_def_property_float_sdna(prop, NULL, "spec");
1867 RNA_def_property_array(prop, 3);
1868 RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight");
1869 RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
1872 static void rna_def_userdef_view(BlenderRNA *brna)
1874 static EnumPropertyItem timecode_styles[] = {
1875 {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"},
1876 {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode. Format is HH:MM:SS:FF"},
1877 {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"},
1878 {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", "Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead"},
1879 {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
1880 {0, NULL, 0, NULL, NULL}};
1885 srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
1886 RNA_def_struct_sdna(srna, "UserDef");
1887 RNA_def_struct_nested(brna, srna, "UserPreferences");
1888 RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
1893 prop= RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
1894 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
1895 RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
1897 prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
1898 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
1899 RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
1900 RNA_def_property_update(prop, 0, "rna_userdef_update");
1902 prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
1903 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
1904 RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens");
1905 RNA_def_property_update(prop, 0, "rna_userdef_update");
1907 prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
1908 RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
1909 RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
1910 RNA_def_property_update(prop, 0, "rna_userdef_update");
1912 prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
1913 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME);
1914 RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
1915 RNA_def_property_update(prop, 0, "rna_userdef_update");
1917 prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
1918 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
1919 RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
1921 prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
1922 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
1923 RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back");
1924 RNA_def_property_update(prop, 0, "rna_userdef_update");
1927 prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
1928 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
1929 RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering");
1931 prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
1932 RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
1933 RNA_def_property_range(prop, 1, 40);
1934 RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening top level menus");
1936 prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
1937 RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
1938 RNA_def_property_range(prop, 1, 40);
1939 RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening sub level menus");
1941 /* Toolbox click-hold delay */
1942 prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
1943 RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
1944 RNA_def_property_range(prop, 1, 40);
1945 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");
1947 prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
1948 RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
1949 RNA_def_property_range(prop, 1, 40);
1950 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");
1952 prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
1953 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
1954 RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
1956 prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
1957 RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
1958 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");
1960 prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
1961 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
1962 RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
1964 prop= RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
1965 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
1966 RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
1969 prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
1970 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
1971 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");
1974 prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
1975 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
1976 RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views");
1978 prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
1979 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
1980 RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
1983 prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
1984 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
1985 RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View");
1986 RNA_def_property_update(prop, 0, "rna_userdef_update");
1988 prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
1989 RNA_def_property_int_sdna(prop, NULL, "rvisize");
1990 RNA_def_property_range(prop, 10, 64);
1991 RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size");
1992 RNA_def_property_update(prop, 0, "rna_userdef_update");
1994 prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
1995 RNA_def_property_int_sdna(prop, NULL, "rvibright");
1996 RNA_def_property_range(prop, 0, 10);
1997 RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon");
1998 RNA_def_property_update(prop, 0, "rna_userdef_update");
2000 prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
2001 RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
2002 RNA_def_property_range(prop, 0, 1000);
2003 RNA_def_property_ui_text(prop, "Smooth View", "The time to animate the view in milliseconds, zero to disable");
2005 prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
2006 RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
2007 RNA_def_property_range(prop, 0, 90);
2008 RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)");
2010 /* 3D transform widget */
2011 prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
2012 RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1);
2013 RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
2014 RNA_def_property_update(prop, 0, "rna_userdef_update");
2016 prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
2017 RNA_def_property_int_sdna(prop, NULL, "tw_size");
2018 RNA_def_property_range(prop, 2, 40);
2019 RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units");
2020 RNA_def_property_update(prop, 0, "rna_userdef_update");
2022 prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
2023 RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
2024 RNA_def_property_range(prop, 2, 40);
2025 RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius");
2026 RNA_def_property_update(prop, 0, "rna_userdef_update");
2028 prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
2029 RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
2030 RNA_def_property_range(prop, 4, 40);
2031 RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Hotspot in pixels for clicking widget handles");
2033 prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
2034 RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
2035 RNA_def_property_range(prop, 4, 10);
2036 RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display");
2037 RNA_def_property_update(prop, 0, "rna_userdef_update");
2039 /* View2D Grid Displays */
2040 prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
2041 RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
2042 RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
2043 RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports");
2044 RNA_def_property_update(prop, 0, "rna_userdef_update");
2046 // TODO: add a setter for this, so that we can bump up the minimum size as necessary...
2047 prop= RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
2048 RNA_def_property_enum_items(prop, timecode_styles);
2049 RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
2050 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
2051 RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
2052 RNA_def_property_update(prop, 0, "rna_userdef_update");
2055 static void rna_def_userdef_edit(BlenderRNA *brna)
2060 static EnumPropertyItem auto_key_modes[] = {
2061 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
2062 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
2063 {0, NULL, 0, NULL, NULL}};
2065 static const EnumPropertyItem material_link_items[]= {
2066 {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
2067 {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"},
2068 {0, NULL, 0, NULL, NULL}};
2070 static const EnumPropertyItem object_align_items[]= {
2071 {0, "WORLD", 0, "World", "Align newly added objects to the world coordinates"},
2072 {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
2073 {0, NULL, 0, NULL, NULL}};
2075 srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
2076 RNA_def_struct_sdna(srna, "UserDef");
2077 RNA_def_struct_nested(brna, srna, "UserPreferences");
2078 RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
2082 prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
2083 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2084 RNA_def_property_enum_items(prop, material_link_items);
2085 RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
2087 prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
2088 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2089 RNA_def_property_enum_items(prop, object_align_items);
2090 RNA_def_property_ui_text(prop, "Align Object To", "When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates");
2092 prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
2093 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
2094 RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object");
2096 prop= RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
2097 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM);
2098 RNA_def_property_ui_text(prop, "Release confirm", "Moving things with a mouse drag confirms when releasing the button");
2101 prop= RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
2102 RNA_def_property_int_sdna(prop, NULL, "undosteps");
2103 RNA_def_property_range(prop, 0, 64);
2104 RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
2106 prop= RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
2107 RNA_def_property_int_sdna(prop, NULL, "undomemory");
2108 RNA_def_property_range(prop, 0, 32767);
2109 RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
2111 prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
2112 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
2113 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");
2115 /* auto keyframing */
2116 prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
2117 RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
2118 RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones");
2119 RNA_def_property_ui_icon(prop, ICON_REC, 0);
2121 prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
2122 RNA_def_property_enum_items(prop, auto_key_modes);
2123 RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
2124 RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
2126 prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
2127 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
2128 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves");
2130 prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
2131 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
2132 RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set");
2134 /* keyframing settings */
2135 prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
2136 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
2137 RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
2139 prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
2140 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
2141 RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
2143 prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
2144 RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
2145 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");
2147 prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
2148 RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
2149 RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
2150 RNA_def_property_ui_text(prop, "New Interpolation Type", "");
2152 prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
2153 RNA_def_property_enum_items(prop, beztriple_handle_type_items);
2154 RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new");
2155 RNA_def_property_ui_text(prop, "New Handles Type", "");
2158 prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
2159 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
2160 RNA_def_property_ui_text(prop, "Allow Negative Frames", "Current frame number can be manually set to a negative value");
2163 prop= RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
2164 RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist");
2165 RNA_def_property_range(prop, 0, 100);
2166 RNA_def_property_ui_text(prop, "Grease Pencil Manhattan Distance", "Pixels moved by mouse per axis when drawing stroke");
2168 prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
2169 RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
2170 RNA_def_property_range(prop, 0, 100);
2171 RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include");
2173 prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
2174 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
2175 RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
2177 prop= RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
2178 RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
2179 RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
2181 prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
2182 RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
2183 RNA_def_property_range(prop, 0, 100);
2184 RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
2186 /* sculpt and paint */
2188 prop= RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR);
2189 RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_overlay_col");
2190 RNA_def_property_array(prop, 3);
2191 RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
2193 /* duplication linking */
2194 prop= RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
2195 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
2196 RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
2198 prop= RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
2199 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
2200 RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
2202 prop= RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
2203 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
2204 RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
2206 prop= RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
2207 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
2208 RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
2210 prop= RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
2211 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
2212 RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
2214 prop= RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
2215 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
2216 RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
2218 prop= RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
2219 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
2220 RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
2222 prop= RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
2223 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
2224 RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
2226 prop= RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
2227 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
2228 RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
2231 prop= RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
2232 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
2233 RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
2235 prop= RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
2236 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
2237 RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
2239 prop= RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
2240 RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
2241 RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
2244 static void rna_def_userdef_system(BlenderRNA *brna)
2249 static EnumPropertyItem gl_texture_clamp_items[] = {
2250 {0, "CLAMP_OFF", 0, "Off", ""},
2251 {8192, "CLAMP_8192", 0, "8192", ""},
2252 {4096, "CLAMP_4096", 0, "4096", ""},
2253 {2048, "CLAMP_2048", 0, "2048", ""},
2254 {1024, "CLAMP_1024", 0, "1024", ""},
2255 {512, "CLAMP_512", 0, "512", ""},
2256 {256, "CLAMP_256", 0, "256", ""},
2257 {128, "CLAMP_128", 0, "128", ""},
2258 {0, NULL, 0, NULL, NULL}};
2260 static EnumPropertyItem audio_mixing_samples_items[] = {
2261 {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
2262 {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
2263 {1024, "SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
2264 {2048, "SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
2265 {4096, "SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
2266 {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
2267 {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
2268 {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
2269 {0, NULL, 0, NULL, NULL}};
2271 static EnumPropertyItem audio_device_items[] = {
2272 {0, "NONE", 0, "None", "Null device - there will be no audio output"},
2274 {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage"},
2277 {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"},
2280 {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"},
2282 {0, NULL, 0, NULL, NULL}};
2284 static EnumPropertyItem audio_rate_items[] = {
2285 // {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
2286 // {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
2287 // {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
2288 // {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
2289 // {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
2290 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
2291 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
2292 // {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
2293 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
2294 {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
2295 {0, NULL, 0, NULL, NULL}};
2297 static EnumPropertyItem audio_format_items[] = {
2298 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
2299 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer"},
2300 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer"},
2301 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
2302 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
2303 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
2304 {0, NULL, 0, NULL, NULL}};
2306 static EnumPropertyItem audio_channel_items[] = {
2307 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2308 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
2309 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2310 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2311 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2312 {0, NULL, 0, NULL, NULL}};
2314 static EnumPropertyItem draw_method_items[] = {
2315 {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
2316 {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory"},
2317 {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
2318 {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)"},
2319 {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails"},
2320 {0, NULL, 0, NULL, NULL}};
2322 static EnumPropertyItem color_picker_types[] = {
2323 {USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
2324 {USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
2325 {USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
2326 {USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
2327 {0, NULL, 0, NULL, NULL}};
2329 /* hardcoded here, could become dynamic somehow */
2330 static EnumPropertyItem language_items[] = {
2331 {0, "ENGLISH", 0, "English", ""},
2332 {1, "JAPANESE", 0, "Japanese", ""},
2333 {2, "DUTCH", 0, "Dutch", ""},
2334 {3, "ITALIAN", 0, "Italian", ""},
2335 {4, "GERMAN", 0, "German", ""},
2336 {5, "FINNISH", 0, "Finnish", ""},
2337 {6, "SWEDISH", 0, "Swedish", ""},
2338 {7, "FRENCH", 0, "French", ""},
2339 {8, "SPANISH", 0, "Spanish", ""},
2340 {9, "CATALAN", 0, "Catalan", ""},
2341 {10, "CZECH", 0, "Czech", ""},
2342 {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""},
2343 {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""},
2344 {13, "RUSSIAN", 0, "Russian", ""},
2345 {14, "CROATIAN", 0, "Croatian", ""},
2346 {15, "SERBIAN", 0, "Serbian", ""},
2347 {16, "UKRAINIAN", 0, "Ukrainian", ""},
2348 {17, "POLISH", 0, "Polish", ""},
2349 {18, "ROMANIAN", 0, "Romanian", ""},
2350 {19, "ARABIC", 0, "Arabic", ""},
2351 {20, "BULGARIAN", 0, "Bulgarian", ""},
2352 {21, "GREEK", 0, "Greek", ""},
2353 {22, "KOREAN", 0, "Korean", ""},
2354 {0, NULL, 0, NULL, NULL}};
2356 srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
2357 RNA_def_struct_sdna(srna, "UserDef");
2358 RNA_def_struct_nested(brna, srna, "UserPreferences");
2359 RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
2363 prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
2364 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
2365 RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
2366 RNA_def_property_update(prop, 0, "rna_userdef_update");
2368 prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
2369 RNA_def_property_int_sdna(prop, NULL, "dpi");
2370 RNA_def_property_range(prop, 48, 128);
2371 RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
2372 RNA_def_property_update(prop, 0, "rna_userdef_update");
2374 prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
2375 RNA_def_property_int_sdna(prop, NULL, "scrollback");
2376 RNA_def_property_range(prop, 32, 32768);
2377 RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
2379 prop= RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
2380 RNA_def_property_string_sdna(prop, NULL, "author");
2381 RNA_def_property_string_maxlength(prop, 80);
2382 RNA_def_property_ui_text(prop, "Author", "Name that will be used in exported files when format supports such feature");
2384 /* Language Selection */
2386 prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
2387 RNA_def_property_enum_items(prop, language_items);
2388 RNA_def_property_ui_text(prop, "Language", "Language use for translation");
2389 RNA_def_property_update(prop, 0, "rna_userdef_update");
2391 prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
2392 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
2393 RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
2394 RNA_def_property_update(prop, 0, "rna_userdef_update");
2396 prop= RNA_def_property(srna, "use_translate_buttons", PROP_BOOLEAN, PROP_NONE);
2397 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS);
2398 RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels");
2399 RNA_def_property_update(prop, 0, "rna_userdef_update");
2401 prop= RNA_def_property(srna, "use_translate_toolbox", PROP_BOOLEAN, PROP_NONE);
2402 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS);
2403 RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu");
2404 RNA_def_property_update(prop, 0, "rna_userdef_update");
2406 prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
2407 RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
2408 RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts");
2409 RNA_def_property_update(prop, 0, "rna_userdef_update");
2411 /* System & OpenGL */
2413 prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
2414 RNA_def_property_collection_sdna(prop, NULL, "light", "");
2415 RNA_def_property_struct_type(prop, "UserSolidLight");
2416 RNA_def_property_ui_text(prop, "Solid Lights", "Lights user to display objects in solid draw mode");
2418 prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
2419 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
2420 RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode");
2421 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2423 prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
2424 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2425 RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
2426 RNA_def_property_struct_type(prop, "ColorRamp");
2427 RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode");
2428 RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
2430 prop= RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
2431 RNA_def_property_enum_items(prop, color_picker_types);
2432 RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
2433 RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
2435 prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
2436 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
2437 RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)");
2439 prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
2440 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
2441 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)");
2442 RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
2444 prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
2445 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
2446 RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces for new and loaded text files");
2448 prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
2449 RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
2450 RNA_def_property_range(prop, 0, 500);
2451 RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
2453 prop= RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
2454 RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
2455 RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
2456 RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
2457 RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
2459 prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
2460 RNA_def_property_int_sdna(prop, NULL, "frameserverport");
2461 RNA_def_property_range(prop, 0, 32727);
2462 RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering");
2464 prop= RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
2465 RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
2466 RNA_def_property_range(prop, 0.0f, 1.0f);
2467 RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
2468 RNA_def_property_update(prop, 0, "rna_userdef_update");
2470 prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
2471 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
2472 RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
2473 RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
2475 prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
2476 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
2477 RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
2479 prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
2480 RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
2481 RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)");
2483 prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
2484 RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
2485 RNA_def_property_enum_items(prop, gl_texture_clamp_items);
2486 RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
2487 RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
2489 prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
2490 RNA_def_property_int_sdna(prop, NULL, "textimeout");
2491 RNA_def_property_range(prop, 0, 3600);
2492 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.)");
2494 prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
2495 RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
2496 RNA_def_property_range(prop, 1, 3600);
2497 RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector");
2499 prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
2500 RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
2501 RNA_def_property_enum_items(prop, draw_method_items);
2502 RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
2503 RNA_def_property_update(prop, 0, "rna_userdef_update");
2505 prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
2506 RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
2507 RNA_def_property_enum_items(prop, audio_mixing_samples_items);
2508 RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer");
2509 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2511 prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
2512 RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
2513 RNA_def_property_enum_items(prop, audio_device_items);
2514 RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device");
2515 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2517 prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
2518 RNA_def_property_enum_sdna(prop, NULL, "audiorate");
2519 RNA_def_property_enum_items(prop, audio_rate_items);
2520 RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate");
2521 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2523 prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
2524 RNA_def_property_enum_sdna(prop, NULL, "audioformat");
2525 RNA_def_property_enum_items(prop, audio_format_items);
2526 RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format");
2527 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2529 prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
2530 RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
2531 RNA_def_property_enum_items(prop, audio_channel_items);
2532 RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
2533 RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
2535 prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
2536 RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
2537 RNA_def_property_range(prop, 10, 50);
2538 RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back");
2540 prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
2541 RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
2542 RNA_def_property_range(prop, 50, 1000);
2543 RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast");
2546 prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
2547 RNA_def_property_string_sdna(prop, NULL, "versemaster");
2548 RNA_def_property_ui_text(prop, "Verse Master", "The Verse Master-server IP");
2550 prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE);
2551 RNA_def_property_string_sdna(prop, NULL, "verseuser");
2552 RNA_def_property_ui_text(prop, "Verse Username", "The Verse user name");
2556 static void rna_def_userdef_input(BlenderRNA *brna)
2561 static EnumPropertyItem select_mouse_items[] = {
2562 {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
2563 {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
2564 {0, NULL, 0, NULL, NULL}};
2566 static EnumPropertyItem view_rotation_items[] = {
2567 {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
2568 {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
2569 {0, NULL, 0, NULL, NULL}};
2571 static EnumPropertyItem view_zoom_styles[] = {
2572 {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
2573 {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement"},
2574 {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center"},
2575 {0, NULL, 0, NULL, NULL}};
2577 static EnumPropertyItem view_zoom_axes[] = {
2578 {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"},
2579 {USER_ZOOM_DOLLY_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"},
2580 {0, NULL, 0, NULL, NULL}};
2582 srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
2583 RNA_def_struct_sdna(srna, "UserDef");
2584 RNA_def_struct_nested(brna, srna, "UserPreferences");
2585 RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
2587 prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
2588 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2589 RNA_def_property_enum_items(prop, select_mouse_items);
2590 RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
2591 RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection");
2593 prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
2594 RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
2595 RNA_def_property_enum_items(prop, view_zoom_styles);
2596 RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
2598 prop= RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
2599 RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
2600 RNA_def_property_enum_items(prop, view_zoom_axes);
2601 RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
2603 prop= RNA_def_property(srna, "invert_mouse_wheel_zoom", PROP_BOOLEAN, PROP_NONE);
2604 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
2605 RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
2607 prop= RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
2608 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
2609 RNA_def_property_enum_items(prop, view_rotation_items);
2610 RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
2612 prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
2613 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
2614 RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
2616 prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE);
2617 RNA_def_property_int_sdna(prop, NULL, "ndof_pan");
2618 RNA_def_property_range(prop, 0, 200);
2619 RNA_def_property_ui_text(prop, "NDof Pan Speed", "The overall panning speed of an NDOF device, as percent of standard");
2621 prop= RNA_def_property(srna, "ndof_rotate_speed", PROP_INT, PROP_NONE);
2622 RNA_def_property_int_sdna(prop, NULL, "ndof_rotate");
2623 RNA_def_property_range(prop, 0, 200);
2624 RNA_def_property_ui_text(prop, "NDof Rotation Speed", "The overall rotation speed of an NDOF device, as percent of standard");
2626 prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
2627 RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
2628 RNA_def_property_range(prop, 1, 1000);
2629 RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click");
2631 prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
2632 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
2633 RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+LeftMouse (doesn't work with Left Mouse Select option)");
2635 prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
2636 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
2637 RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
2639 /* middle mouse button */
2640 prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
2641 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
2642 RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
2644 prop= RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
2645 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
2646 RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
2648 prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
2649 RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
2650 RNA_def_property_range(prop, 0, 32);
2651 RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
2653 /* U.keymaps - custom keymaps that have been edited from default configs */
2654 prop= RNA_def_property(srna, "edited_keymaps", PROP_COLLECTION, PROP_NONE);
2655 RNA_def_property_collection_sdna(prop, NULL, "keymaps", NULL);
2656 RNA_def_property_struct_type(prop, "KeyMap");
2657 RNA_def_property_ui_text(prop, "Edited Keymaps", "");
2659 prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
2660 RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
2661 RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
2664 static void rna_def_userdef_filepaths(BlenderRNA *brna)
2669 static EnumPropertyItem anim_player_presets[] = {
2670 //{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, // doesn't work yet!
2671 {1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
2672 {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
2673 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
2674 {4, "RV", 0, "rv", "Frame player from Tweak Software"},
2675 {5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"},
2676 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
2677 {0, NULL, 0, NULL, NULL}};
2679 srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
2680 RNA_def_struct_sdna(srna, "UserDef");
2681 RNA_def_struct_nested(brna, srna, "UserPreferences");
2682 RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
2684 prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
2685 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
2686 RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
2688 prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
2689 RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
2690 RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
2692 prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
2693 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
2694 RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
2696 prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
2697 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
2698 RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
2700 prop= RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
2701 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
2702 RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
2704 prop= RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
2705 RNA_def_property_string_sdna(prop, NULL, "fontdir");
2706 RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
2708 prop= RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
2709 RNA_def_property_string_sdna(prop, NULL, "textudir");
2710 RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
2712 prop= RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
2713 RNA_def_property_string_sdna(prop, NULL, "plugtexdir");
2714 RNA_def_property_ui_text(prop, "Texture Plugin Directory", "The default directory to search for texture plugins");
2716 prop= RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
2717 RNA_def_property_string_sdna(prop, NULL, "plugseqdir");
2718 RNA_def_property_ui_text(prop, "Sequence Plugin Directory", "The default directory to search for sequence plugins");
2720 prop= RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
2721 RNA_def_property_string_sdna(prop, NULL, "renderdir");
2722 RNA_def_property_ui_text(prop, "Render Output Directory", "The default directory for rendering output");
2724 prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
2725 RNA_def_property_string_sdna(prop, NULL, "pythondir");
2726 RNA_def_property_ui_text(prop, "Python Scripts Directory", "The default directory to search for Python scripts (resets python module search path: sys.path)");
2728 prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
2729 RNA_def_property_string_sdna(prop, NULL, "sounddir");
2730 RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
2732 prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
2733 RNA_def_property_string_sdna(prop, NULL, "tempdir");
2734 RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
2735 RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
2737 prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_DIRPATH);
2738 RNA_def_property_string_sdna(prop, NULL, "image_editor");
2739 RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
2741 prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_DIRPATH);
2742 RNA_def_property_string_sdna(prop, NULL, "anim_player");
2743 RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player");
2745 prop= RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
2746 RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
2747 RNA_def_property_enum_items(prop, anim_player_presets);
2748 RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
2749 RNA_def_property_enum_default(prop, 1); /* set default to blender 2.4 player until an internal one is back */
2753 prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
2754 RNA_def_property_int_sdna(prop, NULL, "versions");
2755 RNA_def_property_range(prop, 0, 32);
2756 RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving");
2758 prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
2759 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
2760 RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files");
2761 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2763 prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
2764 RNA_def_property_int_sdna(prop, NULL, "savetime");
2765 RNA_def_property_range(prop, 1, 60);
2766 RNA_def_property_ui_text(prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
2767 RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
2769 prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
2770 RNA_def_property_range(prop, 0, 30);
2771 RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
2773 prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
2774 RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
2775 RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");
2778 void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
2784 RNA_def_property_srna(cprop, "Addons");
2785 srna= RNA_def_struct(brna, "Addons", NULL);
2786 RNA_def_struct_ui_text(srna, "User Add-Ons", "Collection of add-ons");
2788 func= RNA_def_function(srna, "new", "rna_userdef_addon_new");
2789 RNA_def_function_flag(func, FUNC_NO_SELF);
2790 RNA_def_function_ui_description(func, "Add a new addon");
2792 parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock.");
2793 RNA_def_function_return(func, parm);
2795 func= RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
2796 RNA_def_function_flag(func, FUNC_NO_SELF);
2797 RNA_def_function_ui_description(func, "Remove addon.");
2798 parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove.");
2799 RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
2802 void RNA_def_userdef(BlenderRNA *brna)
2807 static EnumPropertyItem user_pref_sections[] = {
2808 {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
2809 {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
2810 {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
2811 {USER_SECTION_ADDONS, "ADDONS", 0, "Add-Ons", ""},
2812 {USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
2813 {USER_SECTION_FILE, "FILES", 0, "File", ""},
2814 {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
2815 {0, NULL, 0, NULL, NULL}};
2817 rna_def_userdef_dothemes(brna);
2818 rna_def_userdef_solidlight(brna);
2820 srna= RNA_def_struct(brna, "UserPreferences", NULL);
2821 RNA_def_struct_sdna(srna, "UserDef");
2822 RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences");
2824 prop= RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
2825 RNA_def_property_enum_sdna(prop, NULL, "userpref");
2826 RNA_def_property_enum_items(prop, user_pref_sections);
2827 RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface");
2828 RNA_def_property_update(prop, 0, "rna_userdef_update");
2830 prop= RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
2831 RNA_def_property_collection_sdna(prop, NULL, "themes", NULL);
2832 RNA_def_property_struct_type(prop, "Theme");
2833 RNA_def_property_ui_text(prop, "Themes", "");
2835 prop= RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
2836 RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL);
2837 RNA_def_property_struct_type(prop, "ThemeStyle");
2838 RNA_def_property_ui_text(prop, "Styles", "");
2840 prop= RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
2841 RNA_def_property_collection_sdna(prop, NULL, "addons", NULL);
2842 RNA_def_property_struct_type(prop, "Addon");
2843 RNA_def_property_ui_text(prop, "Addon", "");
2844 rna_def_userdef_addon_collection(brna, prop);
2847 /* nested structs */
2848 prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
2849 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2850 RNA_def_property_struct_type(prop, "UserPreferencesView");
2851 RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL);
2852 RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
2854 prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
2855 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2856 RNA_def_property_struct_type(prop, "UserPreferencesEdit");
2857 RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL);
2858 RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
2860 prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
2861 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2862 RNA_def_property_struct_type(prop, "UserPreferencesInput");
2863 RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL);
2864 RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
2866 prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
2867 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2868 RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
2869 RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL);
2870 RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
2872 prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
2873 RNA_def_property_flag(prop, PROP_NEVER_NULL);
2874 RNA_def_property_struct_type(prop, "UserPreferencesSystem");
2875 RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL);
2876 RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings");
2878 rna_def_userdef_view(brna);
2879 rna_def_userdef_edit(brna);
2880 rna_def_userdef_input(brna);
2881 rna_def_userdef_filepaths(brna);
2882 rna_def_userdef_system(brna);
2883 rna_def_userdef_addon(brna);