436
#ifdef WITH_INTERNATIONAL
437
static EnumPropertyItem *rna_lang_enum_properties_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
438
PropertyRNA *UNUSED(prop), int *free)
440
*free = 0; /* These items are handled by BLF code! */
441
return BLF_RNA_lang_enum_properties();
445
static IDProperty *rna_AddonPref_idprops(PointerRNA *ptr, int create)
447
if (create && !ptr->data) {
448
IDPropertyTemplate val = {0};
449
ptr->data = IDP_New(IDP_GROUP, &val, "RNA_AddonPreferences group");
455
static PointerRNA rna_Addon_preferences_get(PointerRNA *ptr)
457
bAddon *addon = (bAddon *)ptr->data;
458
bAddonPrefType *apt = BKE_addon_pref_type_find(addon->module, TRUE);
460
if (addon->prop == NULL) {
461
IDPropertyTemplate val = {0};
462
addon->prop = IDP_New(IDP_GROUP, &val, addon->module); /* name is unimportant */
464
return rna_pointer_inherit_refine(ptr, apt->ext.srna, addon->prop);
467
return PointerRNA_NULL;
471
static void rna_AddonPref_unregister(Main *UNUSED(bmain), StructRNA *type)
473
bAddonPrefType *apt = RNA_struct_blender_type_get(type);
478
RNA_struct_free_extension(type, &apt->ext);
480
BKE_addon_pref_type_remove(apt);
481
RNA_struct_free(&BLENDER_RNA, type);
483
/* update while blender is running */
484
WM_main_add_notifier(NC_WINDOW, NULL);
487
static StructRNA *rna_AddonPref_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
488
StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
490
bAddonPrefType *apt, dummyapt = {{'\0'}};
491
bAddon dummyaddon = {NULL};
493
// int have_function[1];
495
/* setup dummy header & header type to store static properties in */
496
RNA_pointer_create(NULL, &RNA_AddonPreferences, &dummyaddon, &dummyhtr);
498
/* validate the python class */
499
if (validate(&dummyhtr, data, NULL /* have_function */ ) != 0)
502
BLI_strncpy(dummyapt.idname, dummyaddon.module, sizeof(dummyapt.idname));
503
if (strlen(identifier) >= sizeof(dummyapt.idname)) {
504
BKE_reportf(reports, RPT_ERROR, "Registering addon-prefs class: '%s' is too long, maximum length is %d",
505
identifier, (int)sizeof(dummyapt.idname));
509
/* check if we have registered this header type before, and remove it */
510
apt = BKE_addon_pref_type_find(dummyaddon.module, TRUE);
513
rna_AddonPref_unregister(bmain, apt->ext.srna);
517
/* create a new header type */
518
apt = MEM_mallocN(sizeof(bAddonPrefType), "addonpreftype");
519
memcpy(apt, &dummyapt, sizeof(dummyapt));
520
BKE_addon_pref_type_add(apt);
522
apt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_AddonPreferences);
523
apt->ext.data = data;
524
apt->ext.call = call;
525
apt->ext.free = free;
526
RNA_struct_blender_type_set(apt->ext.srna, apt);
528
// apt->draw = (have_function[0]) ? header_draw : NULL;
530
/* update while blender is running */
531
WM_main_add_notifier(NC_WINDOW, NULL);
533
return apt->ext.srna;
536
/* placeholder, doesn't do anything useful yet */
537
static StructRNA *rna_AddonPref_refine(PointerRNA *ptr)
539
return (ptr->type) ? ptr->type : &RNA_AddonPreferences;
408
544
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
471
608
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
472
609
RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
475
prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
476
RNA_def_property_range(prop, 0.5, 2.0);
477
RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
479
612
prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
480
613
RNA_def_property_flag(prop, PROP_NEVER_NULL);
481
614
RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
482
615
RNA_def_property_struct_type(prop, "ThemeFontStyle");
483
RNA_def_property_ui_text(prop, "Panel Style", "");
484
RNA_def_property_update(prop, 0, "rna_userdef_update");
487
prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
488
RNA_def_property_flag(prop, PROP_NEVER_NULL);
489
RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
490
RNA_def_property_struct_type(prop, "ThemeFontStyle");
491
RNA_def_property_ui_text(prop, "Group Label Font", "");
492
RNA_def_property_update(prop, 0, "rna_userdef_update");
616
RNA_def_property_ui_text(prop, "Panel Title Font", "");
617
RNA_def_property_update(prop, 0, "rna_userdef_update");
494
619
prop = RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
495
620
RNA_def_property_flag(prop, PROP_NEVER_NULL);
496
621
RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
621
746
prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
622
747
RNA_def_property_ui_text(prop, "Header", "");
623
748
RNA_def_property_update(prop, 0, "rna_userdef_update");
750
prop = RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
751
RNA_def_property_ui_text(prop, "Background", "");
752
RNA_def_property_update(prop, 0, "rna_userdef_update");
625
754
prop = RNA_def_property(srna, "show_header", PROP_BOOLEAN, PROP_NONE);
626
755
RNA_def_property_ui_text(prop, "Show Header", "");
627
756
RNA_def_property_update(prop, 0, "rna_userdef_update");
758
prop = RNA_def_property(srna, "show_back", PROP_BOOLEAN, PROP_NONE);
759
RNA_def_property_ui_text(prop, "Show Background", "");
760
RNA_def_property_update(prop, 0, "rna_userdef_update");
763
static void rna_def_userdef_theme_ui_gradient(BlenderRNA *brna)
768
srna = RNA_def_struct(brna, "ThemeGradientColors", NULL);
769
RNA_def_struct_sdna(srna, "uiGradientColors");
770
RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
771
RNA_def_struct_ui_text(srna, "Theme Background Color", "Theme settings for background colors and gradient");
773
prop = RNA_def_property(srna, "show_grad", PROP_BOOLEAN, PROP_NONE);
774
RNA_def_property_ui_text(prop, "Use Gradient",
775
"Do a gradient for the background of the viewport working area");
776
RNA_def_property_update(prop, 0, "rna_userdef_update");
778
prop = RNA_def_property(srna, "gradient", PROP_FLOAT, PROP_COLOR_GAMMA);
779
RNA_def_property_array(prop, 3);
780
RNA_def_property_ui_text(prop, "Gradient Low", "");
781
RNA_def_property_update(prop, 0, "rna_userdef_update");
783
prop = RNA_def_property(srna, "high_gradient", PROP_FLOAT, PROP_COLOR_GAMMA);
784
RNA_def_property_array(prop, 3);
785
RNA_def_property_ui_text(prop, "Gradient High/Off", "");
786
RNA_def_property_update(prop, 0, "rna_userdef_update");
630
789
static void rna_def_userdef_theme_ui(BlenderRNA *brna)
743
908
prop = RNA_def_property(srna, "icon_alpha", PROP_FLOAT, PROP_FACTOR);
744
909
RNA_def_property_ui_text(prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast");
745
910
RNA_def_property_update(prop, 0, "rna_userdef_update");
913
prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_COLOR_GAMMA);
914
RNA_def_property_float_sdna(prop, NULL, "xaxis");
915
RNA_def_property_array(prop, 3);
916
RNA_def_property_ui_text(prop, "X Axis", "");
917
RNA_def_property_update(prop, 0, "rna_userdef_update");
919
prop = RNA_def_property(srna, "axis_y", PROP_FLOAT, PROP_COLOR_GAMMA);
920
RNA_def_property_float_sdna(prop, NULL, "yaxis");
921
RNA_def_property_array(prop, 3);
922
RNA_def_property_ui_text(prop, "Y Axis", "");
923
RNA_def_property_update(prop, 0, "rna_userdef_update");
925
prop = RNA_def_property(srna, "axis_z", PROP_FLOAT, PROP_COLOR_GAMMA);
926
RNA_def_property_float_sdna(prop, NULL, "zaxis");
927
RNA_def_property_array(prop, 3);
928
RNA_def_property_ui_text(prop, "Z Axis", "");
929
RNA_def_property_update(prop, 0, "rna_userdef_update");
748
932
static void rna_def_userdef_theme_space_generic(BlenderRNA *brna)
791
975
RNA_def_property_ui_text(prop, "Header Text Highlight", "");
792
976
RNA_def_property_update(prop, 0, "rna_userdef_update");
795
/* if (! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) { */
796
prop = RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
797
RNA_def_property_array(prop, 3);
979
prop = RNA_def_property(srna, "panelcolors", PROP_POINTER, PROP_NONE);
980
RNA_def_property_flag(prop, PROP_NEVER_NULL);
981
RNA_def_property_ui_text(prop, "Panel Colors", "");
982
RNA_def_property_update(prop, 0, "rna_userdef_update");
985
/* if (! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) { */
986
prop = RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
987
RNA_def_property_array(prop, 4);
988
RNA_def_property_ui_text(prop, "Region Background", "");
989
RNA_def_property_update(prop, 0, "rna_userdef_update");
991
prop = RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA);
992
RNA_def_property_array(prop, 3);
993
RNA_def_property_ui_text(prop, "Region Text Titles", "");
994
RNA_def_property_update(prop, 0, "rna_userdef_update");
996
prop = RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA);
997
RNA_def_property_array(prop, 3);
998
RNA_def_property_ui_text(prop, "Region Text", "");
999
RNA_def_property_update(prop, 0, "rna_userdef_update");
1001
prop = RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
1002
RNA_def_property_array(prop, 3);
1003
RNA_def_property_ui_text(prop, "Region Text Highlight", "");
1004
RNA_def_property_update(prop, 0, "rna_userdef_update");
1008
static void rna_def_userdef_theme_space_gradient(BlenderRNA *brna)
1013
srna = RNA_def_struct(brna, "ThemeSpaceGradient", NULL);
1014
RNA_def_struct_sdna(srna, "ThemeSpace");
1015
RNA_def_struct_ui_text(srna, "Theme Space Settings", "");
1018
prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
1019
RNA_def_property_array(prop, 3);
1020
RNA_def_property_ui_text(prop, "Title", "");
1021
RNA_def_property_update(prop, 0, "rna_userdef_update");
1023
prop = RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
1024
RNA_def_property_array(prop, 3);
1025
RNA_def_property_ui_text(prop, "Text", "");
1026
RNA_def_property_update(prop, 0, "rna_userdef_update");
1028
prop = RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
1029
RNA_def_property_array(prop, 3);
1030
RNA_def_property_ui_text(prop, "Text Highlight", "");
1031
RNA_def_property_update(prop, 0, "rna_userdef_update");
1034
prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
1035
RNA_def_property_array(prop, 3);
1036
RNA_def_property_ui_text(prop, "Header", "");
1037
RNA_def_property_update(prop, 0, "rna_userdef_update");
1039
prop = RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
1040
RNA_def_property_array(prop, 3);
1041
RNA_def_property_ui_text(prop, "Header Text", "");
1042
RNA_def_property_update(prop, 0, "rna_userdef_update");
1044
prop = RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
1045
RNA_def_property_array(prop, 3);
1046
RNA_def_property_ui_text(prop, "Header Text Highlight", "");
1047
RNA_def_property_update(prop, 0, "rna_userdef_update");
1049
/* panel settings */
1050
prop = RNA_def_property(srna, "panelcolors", PROP_POINTER, PROP_NONE);
1051
RNA_def_property_flag(prop, PROP_NEVER_NULL);
1052
RNA_def_property_ui_text(prop, "Panel Colors", "");
1053
RNA_def_property_update(prop, 0, "rna_userdef_update");
1055
/* gradient/background settings */
1056
prop = RNA_def_property(srna, "gradients", PROP_POINTER, PROP_NONE);
1057
RNA_def_property_flag(prop, PROP_NEVER_NULL);
1058
RNA_def_property_ui_text(prop, "Gradient Colors", "");
1059
RNA_def_property_update(prop, 0, "rna_userdef_update");
1062
/* if (! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) { */
1063
prop = RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
1064
RNA_def_property_array(prop, 4);
798
1065
RNA_def_property_ui_text(prop, "Region Background", "");
799
1066
RNA_def_property_update(prop, 0, "rna_userdef_update");
1481
1760
RNA_def_property_ui_text(prop, "Syntax Built-in", "");
1482
1761
RNA_def_property_update(prop, 0, "rna_userdef_update");
1763
prop = RNA_def_property(srna, "syntax_symbols", PROP_FLOAT, PROP_COLOR_GAMMA);
1764
RNA_def_property_float_sdna(prop, NULL, "syntaxs");
1765
RNA_def_property_array(prop, 3);
1766
RNA_def_property_ui_text(prop, "Syntax Symbols", "");
1767
RNA_def_property_update(prop, 0, "rna_userdef_update");
1484
1769
prop = RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
1485
1770
RNA_def_property_float_sdna(prop, NULL, "syntaxv");
1486
1771
RNA_def_property_array(prop, 3);
1487
RNA_def_property_ui_text(prop, "Decorator", "");
1772
RNA_def_property_ui_text(prop, "Syntax Special", "");
1773
RNA_def_property_update(prop, 0, "rna_userdef_update");
1775
prop = RNA_def_property(srna, "syntax_preprocessor", PROP_FLOAT, PROP_COLOR_GAMMA);
1776
RNA_def_property_float_sdna(prop, NULL, "syntaxd");
1777
RNA_def_property_array(prop, 3);
1778
RNA_def_property_ui_text(prop, "Syntax PreProcessor", "");
1779
RNA_def_property_update(prop, 0, "rna_userdef_update");
1781
prop = RNA_def_property(srna, "syntax_reserved", PROP_FLOAT, PROP_COLOR_GAMMA);
1782
RNA_def_property_float_sdna(prop, NULL, "syntaxr");
1783
RNA_def_property_array(prop, 3);
1784
RNA_def_property_ui_text(prop, "Syntax Reserved", "");
1488
1785
RNA_def_property_update(prop, 0, "rna_userdef_update");
1490
1787
prop = RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
1569
1878
RNA_def_property_ui_text(prop, "Group Node", "");
1570
1879
RNA_def_property_update(prop, 0, "rna_userdef_update");
1881
prop = RNA_def_property(srna, "frame_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1882
RNA_def_property_float_sdna(prop, NULL, "movie");
1883
RNA_def_property_array(prop, 4);
1884
RNA_def_property_ui_text(prop, "Frame Node", "");
1885
RNA_def_property_update(prop, 0, "rna_userdef_update");
1887
prop = RNA_def_property(srna, "matte_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1888
RNA_def_property_float_sdna(prop, NULL, "syntaxs");
1889
RNA_def_property_array(prop, 3);
1890
RNA_def_property_ui_text(prop, "Matte Node", "");
1891
RNA_def_property_update(prop, 0, "rna_userdef_update");
1893
prop = RNA_def_property(srna, "distor_node", PROP_FLOAT, PROP_COLOR_GAMMA);
1894
RNA_def_property_float_sdna(prop, NULL, "syntaxd");
1895
RNA_def_property_array(prop, 3);
1896
RNA_def_property_ui_text(prop, "Distort Node", "");
1897
RNA_def_property_update(prop, 0, "rna_userdef_update");
1572
1899
prop = RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
1573
1900
RNA_def_property_int_sdna(prop, NULL, "noodle_curving");
1574
1901
RNA_def_property_int_default(prop, 5);
1925
2244
RNA_def_property_ui_text(prop, "View Sliders", "");
1926
2245
RNA_def_property_update(prop, 0, "rna_userdef_update");
1928
prop = RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR_GAMMA);
1929
RNA_def_property_float_sdna(prop, NULL, "shade2");
1930
RNA_def_property_array(prop, 3);
1931
RNA_def_property_ui_text(prop, "Bars", "");
1932
RNA_def_property_update(prop, 0, "rna_userdef_update");
1934
prop = RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1935
RNA_def_property_float_sdna(prop, NULL, "hilite");
1936
RNA_def_property_array(prop, 3);
1937
RNA_def_property_ui_text(prop, "Bars Selected", "");
1938
RNA_def_property_update(prop, 0, "rna_userdef_update");
2247
prop = RNA_def_property(srna, "active_action", PROP_FLOAT, PROP_COLOR_GAMMA);
2248
RNA_def_property_float_sdna(prop, NULL, "anim_active");
2249
RNA_def_property_array(prop, 4);
2250
RNA_def_property_ui_text(prop, "Active Action", "Animation data block has active action");
2251
RNA_def_property_update(prop, 0, "rna_userdef_update");
2253
prop = RNA_def_property(srna, "active_action_unset", PROP_FLOAT, PROP_COLOR_GAMMA);
2254
RNA_def_property_float_sdna(prop, NULL, "anim_non_active");
2255
RNA_def_property_array(prop, 4);
2256
RNA_def_property_ui_text(prop, "No Active Action", "Animation data block doesn't have active action");
2257
RNA_def_property_update(prop, 0, "rna_userdef_update");
1940
2259
prop = RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
1941
2260
RNA_def_property_float_sdna(prop, NULL, "strip");
1942
2261
RNA_def_property_array(prop, 3);
1943
RNA_def_property_ui_text(prop, "Strips", "");
2262
RNA_def_property_ui_text(prop, "Strips", "Action-Clip Strip - Unselected");
1944
2263
RNA_def_property_update(prop, 0, "rna_userdef_update");
1946
2265
prop = RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
1947
2266
RNA_def_property_float_sdna(prop, NULL, "strip_select");
1948
2267
RNA_def_property_array(prop, 3);
1949
RNA_def_property_ui_text(prop, "Strips Selected", "");
2268
RNA_def_property_ui_text(prop, "Strips Selected", "Action-Clip Strip - Selected");
2269
RNA_def_property_update(prop, 0, "rna_userdef_update");
2271
prop = RNA_def_property(srna, "transition_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
2272
RNA_def_property_float_sdna(prop, NULL, "nla_transition");
2273
RNA_def_property_array(prop, 3);
2274
RNA_def_property_ui_text(prop, "Transitions", "Transition Strip - Unselected");
2275
RNA_def_property_update(prop, 0, "rna_userdef_update");
2277
prop = RNA_def_property(srna, "transition_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2278
RNA_def_property_float_sdna(prop, NULL, "nla_transition_sel");
2279
RNA_def_property_array(prop, 3);
2280
RNA_def_property_ui_text(prop, "Transitions Selected", "Transition Strip - Selected");
2281
RNA_def_property_update(prop, 0, "rna_userdef_update");
2283
prop = RNA_def_property(srna, "meta_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
2284
RNA_def_property_float_sdna(prop, NULL, "nla_meta");
2285
RNA_def_property_array(prop, 3);
2286
RNA_def_property_ui_text(prop, "Meta Strips", "Meta Strip - Unselected (for grouping related strips)");
2287
RNA_def_property_update(prop, 0, "rna_userdef_update");
2289
prop = RNA_def_property(srna, "meta_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2290
RNA_def_property_float_sdna(prop, NULL, "nla_meta_sel");
2291
RNA_def_property_array(prop, 3);
2292
RNA_def_property_ui_text(prop, "Meta Strips Selected", "Meta Strip - Selected (for grouping related strips)");
2293
RNA_def_property_update(prop, 0, "rna_userdef_update");
2295
prop = RNA_def_property(srna, "sound_strips", PROP_FLOAT, PROP_COLOR_GAMMA);
2296
RNA_def_property_float_sdna(prop, NULL, "nla_sound");
2297
RNA_def_property_array(prop, 3);
2298
RNA_def_property_ui_text(prop, "Sound Strips",
2299
"Sound Strip - Unselected (for timing speaker sounds)");
2300
RNA_def_property_update(prop, 0, "rna_userdef_update");
2302
prop = RNA_def_property(srna, "sound_strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
2303
RNA_def_property_float_sdna(prop, NULL, "nla_sound_sel");
2304
RNA_def_property_array(prop, 3);
2305
RNA_def_property_ui_text(prop, "Sound Strips Selected",
2306
"Sound Strip - Selected (for timing speaker sounds)");
2307
RNA_def_property_update(prop, 0, "rna_userdef_update");
2309
prop = RNA_def_property(srna, "tweak", PROP_FLOAT, PROP_COLOR_GAMMA);
2310
RNA_def_property_float_sdna(prop, NULL, "nla_tweaking");
2311
RNA_def_property_array(prop, 3);
2312
RNA_def_property_ui_text(prop, "Tweak", "Color for strip/action being 'tweaked' or edited");
2313
RNA_def_property_update(prop, 0, "rna_userdef_update");
2315
prop = RNA_def_property(srna, "tweak_duplicate", PROP_FLOAT, PROP_COLOR_GAMMA);
2316
RNA_def_property_float_sdna(prop, NULL, "nla_tweakdupli");
2317
RNA_def_property_array(prop, 3);
2318
RNA_def_property_ui_text(prop, "Tweak Duplicate Flag",
2319
"Warning/error indicator color for strips referencing the strip being tweaked");
1950
2320
RNA_def_property_update(prop, 0, "rna_userdef_update");
1952
2322
prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
2251
2636
prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
2252
2637
RNA_def_property_ui_text(prop, "Module", "Module name");
2253
2638
RNA_def_struct_name_property(srna, prop);
2640
/* Collection active property */
2641
prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE);
2642
RNA_def_property_struct_type(prop, "AddonPreferences");
2643
RNA_def_property_pointer_funcs(prop, "rna_Addon_preferences_get", NULL, NULL, NULL);
2646
static void rna_def_userdef_addon_pref(BlenderRNA *brna)
2651
srna = RNA_def_struct(brna, "AddonPreferences", NULL);
2652
RNA_def_struct_ui_text(srna, "Addon Preferences", "");
2653
RNA_def_struct_sdna(srna, "bAddon"); /* WARNING: only a bAddon during registration */
2655
RNA_def_struct_refine_func(srna, "rna_AddonPref_refine");
2656
RNA_def_struct_register_funcs(srna, "rna_AddonPref_register", "rna_AddonPref_unregister", NULL);
2657
RNA_def_struct_idprops_func(srna, "rna_AddonPref_idprops");
2660
RNA_define_verify_sdna(0);
2661
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
2662
RNA_def_property_string_sdna(prop, NULL, "module");
2663
RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP);
2664
RNA_define_verify_sdna(1);
2553
2971
static EnumPropertyItem auto_key_modes[] = {
2554
2972
{AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
2555
2973
{AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
2556
{0, NULL, 0, NULL, NULL}};
2974
{0, NULL, 0, NULL, NULL}
2558
2977
static const EnumPropertyItem material_link_items[] = {
2559
2978
{0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
2560
2979
{USER_MAT_ON_OB, "OBJECT", 0, "Object",
2561
2980
"Toggle whether the material is linked to object data or the object block"},
2562
{0, NULL, 0, NULL, NULL}};
2981
{0, NULL, 0, NULL, NULL}
2564
2984
static const EnumPropertyItem object_align_items[] = {
2565
2985
{0, "WORLD", 0, "World", "Align newly added objects to the world coordinate system"},
2566
2986
{USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
2567
{0, NULL, 0, NULL, NULL}};
2987
{0, NULL, 0, NULL, NULL}
2569
2990
srna = RNA_def_struct(brna, "UserPreferencesEdit", NULL);
2570
2991
RNA_def_struct_sdna(srna, "UserDef");
2772
3198
{512, "CLAMP_512", 0, "512", ""},
2773
3199
{256, "CLAMP_256", 0, "256", ""},
2774
3200
{128, "CLAMP_128", 0, "128", ""},
2775
{0, NULL, 0, NULL, NULL}};
3201
{0, NULL, 0, NULL, NULL}
2777
static EnumPropertyItem anisotropic_items[] = {
3204
static EnumPropertyItem anisotropic_items[] = {
2778
3205
{1, "FILTER_0", 0, "Off", ""},
2779
3206
{2, "FILTER_2", 0, "2x", ""},
2780
3207
{4, "FILTER_4", 0, "4x", ""},
2781
3208
{8, "FILTER_8", 0, "8x", ""},
2782
3209
{16, "FILTER_16", 0, "16x", ""},
2783
{0, NULL, 0, NULL, NULL}};
3210
{0, NULL, 0, NULL, NULL}
2785
3213
static EnumPropertyItem audio_mixing_samples_items[] = {
2786
3214
{256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
2847
3280
"(for graphics drivers that do flipping)"},
2848
3281
{USER_DRAW_FULL, "FULL", 0, "Full",
2849
3282
"Do a full redraw each time, slow, only use for reference or when everything else fails"},
2850
{0, NULL, 0, NULL, NULL}};
3283
{0, NULL, 0, NULL, NULL}
2852
3286
static EnumPropertyItem color_picker_types[] = {
2853
3287
{USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
2854
3288
{USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
2855
3289
{USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
2856
3290
{USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
2857
{0, NULL, 0, NULL, NULL}};
2859
/* hardcoded here, could become dynamic somehow */
2860
/* locale according to http://www.roseindia.net/tutorials/I18N/locales-list.shtml */
2861
/* if you edit here, please also edit the source/blender/blenfont/intern/blf_lang.c 's locales */
2862
/* Note: As this list is in alphabetical order, and not defined order,
2863
* here is the highest define currently in use: 30 (turkish). */
3291
{0, NULL, 0, NULL, NULL}
3294
static EnumPropertyItem multi_sample_levels[] = {
3295
{USER_MULTISAMPLE_NONE, "NONE", 0, "No MultiSample", "Do not use OpenGL MultiSample"},
3296
{USER_MULTISAMPLE_2, "2", 0, "MultiSample: 2", "Use 2x OpenGL MultiSample (requires restart)"},
3297
{USER_MULTISAMPLE_4, "4", 0, "MultiSample: 4", "Use 4x OpenGL MultiSample (requires restart)"},
3298
{USER_MULTISAMPLE_8, "8", 0, "MultiSample: 8", "Use 8x OpenGL MultiSample (requires restart)"},
3299
{USER_MULTISAMPLE_16, "16", 0, "MultiSample: 16", "Use 16x OpenGL MultiSample (requires restart)"},
3300
{0, NULL, 0, NULL, NULL}
2864
3303
static EnumPropertyItem language_items[] = {
2865
{ 0, "", 0, N_("Nearly done"), ""},
2866
{ 0, "DEFAULT", 0, "Default (Default)", ""},
2867
{ 1, "ENGLISH", 0, "English (English)", "en_US"},
2868
{ 8, "FRENCH", 0, "French (Français)", "fr_FR"},
2869
{ 4, "ITALIAN", 0, "Italian (Italiano)", "it_IT"},
2870
{15, "RUSSIAN", 0, "Russian (Русский)", "ru_RU"},
2871
{13, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese (简体中文)", "zh_CN"},
2872
{ 9, "SPANISH", 0, "Spanish (Español)", "es"},
2873
{14, "TRADITIONAL_CHINESE", 0, "Traditional Chinese (繁體中文)", "zh_TW"},
2874
{ 0, "", 0, N_("In progress"), ""},
2875
/* using the utf8 flipped form of Arabic (العربية) */
2876
{21, "ARABIC", 0, "Arabic (ﺔﻴﺑﺮﻌﻟﺍ)", "ar_EG"},
2877
{22, "BULGARIAN", 0, "Bulgarian (Български)", "bg_BG"},
2878
{10, "CATALAN", 0, "Catalan (Català)", "ca_AD"},
2879
{16, "CROATIAN", 0, "Croatian (Hrvatski)", "hr_HR"},
2880
{11, "CZECH", 0, "Czech (Český)", "cs_CZ"},
2881
/* { 3, "DUTCH", 0, "Dutch (Nederlandse taal)", "nl_NL"},*/ /* XXX No po's yet. */
2882
{ 6, "FINNISH", 0, "Finnish (Suomi)", "fi_FI"},
2883
{ 5, "GERMAN", 0, "German (Deutsch)", "de_DE"},
2884
{23, "GREEK", 0, "Greek (Ελληνικά)", "el_GR"},
2885
{27, "INDONESIAN", 0, "Indonesian (Bahasa indonesia)", "id_ID"},
2886
{ 2, "JAPANESE", 0, "Japanese (日本語)", "ja_JP"},
2887
{29, "KYRGYZ", 0, "Kyrgyz (Кыргыз тили)", "ky_KG"},
2888
/* {24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"},*/ /* XXX No po's yet. */
2889
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
2890
/* using the utf8 flipped form of Persian (فارسی) */
2891
{26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_IR"},
2892
{19, "POLISH", 0, "Polish (Polski)", "pl_PL"},
2893
{12, "BRAZILIAN_PORTUGUESE", 0, "Portuguese (Português)", "pt"},
2894
/* {20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"},*/ /* XXX No po's yet. */
2895
{17, "SERBIAN", 0, "Serbian (Српски)", "sr_RS"},
2896
{28, "SERBIAN_LATIN", 0, "Serbian latin (Srpski latinica)", "sr_RS@latin"},
2897
{ 7, "SWEDISH", 0, "Swedish (Svenska)", "sv_SE"},
2898
{30, "TURKISH", 0, "Turkish (Türkçe)", "tr_TR"},
2899
{18, "UKRAINIAN", 0, "Ukrainian (Український)", "uk_UA"},
2900
{ 0, NULL, 0, NULL, NULL}};
3304
{0, "DEFAULT", 0, "Default (Default)", ""},
3305
{0, NULL, 0, NULL, NULL}
2902
3308
#ifdef WITH_CYCLES
2903
3309
static EnumPropertyItem compute_device_items[] = {
2904
3310
{0, "CPU", 0, "CPU", ""},
2905
{ 0, NULL, 0, NULL, NULL}};
3311
{ 0, NULL, 0, NULL, NULL}
2908
3315
srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL);
3034
3445
RNA_def_property_ui_text(prop, "16 Bit Float Textures", "Use 16 bit per component texture for float images");
3035
3446
RNA_def_property_update(prop, 0, "rna_userdef_gl_use_16bit_textures");
3448
prop = RNA_def_property(srna, "use_gpu_mipmap", PROP_BOOLEAN, PROP_NONE);
3449
RNA_def_property_boolean_sdna(prop, NULL, "use_gpu_mipmap", 1);
3450
RNA_def_property_ui_text(prop, "GPU Mipmap Generation", "Generate Image Mipmaps on the GPU");
3451
RNA_def_property_update(prop, 0, "rna_userdef_gl_gpu_mipmaps");
3037
3453
prop = RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
3038
3454
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
3039
3455
RNA_def_property_ui_text(prop, "VBOs",
3040
3456
"Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
3041
/* this isn't essential but nice to check if VBO draws any differently */
3457
/* this isn't essential but nice to check if VBO draws any differently */
3042
3458
RNA_def_property_update(prop, NC_WINDOW, NULL);
3044
3461
prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
3045
3462
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
3046
3463
RNA_def_property_ui_text(prop, "Anti-aliasing",
3047
3464
"Use anti-aliasing for the 3D view (may impact redraw performance)");
3049
3467
prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
3050
3468
RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
3151
3582
static EnumPropertyItem select_mouse_items[] = {
3152
3583
{USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
3153
3584
{0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
3154
{0, NULL, 0, NULL, NULL}};
3585
{0, NULL, 0, NULL, NULL}
3156
3588
static EnumPropertyItem view_rotation_items[] = {
3157
3589
{0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
3158
3590
{USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
3159
{0, NULL, 0, NULL, NULL}};
3591
{0, NULL, 0, NULL, NULL}
3594
static EnumPropertyItem ndof_view_rotation_items[] = {
3595
{NDOF_TURNTABLE, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
3596
{0, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
3597
{0, NULL, 0, NULL, NULL}
3161
3600
static EnumPropertyItem view_zoom_styles[] = {
3162
3601
{USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
3163
3602
{USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zoom in and out based on vertical mouse movement"},
3164
3603
{USER_ZOOM_SCALE, "SCALE", 0, "Scale",
3165
3604
"Zoom in and out like scaling the view, mouse movements relative to center"},
3166
{0, NULL, 0, NULL, NULL}};
3605
{0, NULL, 0, NULL, NULL}
3168
3608
static EnumPropertyItem view_zoom_axes[] = {
3169
3609
{0, "VERTICAL", 0, "Vertical", "Zoom in and out based on vertical mouse movement"},
3170
3610
{USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zoom in and out based on horizontal mouse movement"},
3171
{0, NULL, 0, NULL, NULL}};
3611
{0, NULL, 0, NULL, NULL}
3173
3614
srna = RNA_def_struct(brna, "UserPreferencesInput", NULL);
3174
3615
RNA_def_struct_sdna(srna, "UserDef");
3321
3777
StructRNA *srna;
3323
3779
static EnumPropertyItem anim_player_presets[] = {
3324
/*{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, *//* doesn't work yet! */
3780
{0, "INTERNAL", 0, "Internal", "Built-in animation player"},
3325
3781
{1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
3326
3782
{2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
3327
3783
{3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
3328
3784
{4, "RV", 0, "rv", "Frame player from Tweak Software"},
3329
3785
{5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"},
3330
3786
{50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
3331
{0, NULL, 0, NULL, NULL}};
3787
{0, NULL, 0, NULL, NULL}
3333
3790
srna = RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
3334
3791
RNA_def_struct_sdna(srna, "UserDef");