~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/makesrna/intern/rna_userdef.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 *  \ingroup RNA
25
25
 */
26
26
 
27
 
 
28
27
#include <stdlib.h>
29
28
 
 
29
#include "RNA_access.h"
30
30
#include "RNA_define.h"
31
31
#include "RNA_enum_types.h"
32
32
 
47
47
#include "BLF_translation.h"
48
48
 
49
49
#include "BKE_sound.h"
 
50
#include "BKE_addon.h"
50
51
 
51
52
#ifdef WITH_CYCLES
52
53
static EnumPropertyItem compute_device_type_items[] = {
53
54
        {USER_COMPUTE_DEVICE_NONE, "NONE", 0, "None", "Don't use compute device"},
54
55
        {USER_COMPUTE_DEVICE_CUDA, "CUDA", 0, "CUDA", "Use CUDA for GPU acceleration"},
55
56
        {USER_COMPUTE_DEVICE_OPENCL, "OPENCL", 0, "OpenCL", "Use OpenCL for GPU acceleration"},
56
 
        { 0, NULL, 0, NULL, NULL}};
 
57
        { 0, NULL, 0, NULL, NULL}
 
58
};
57
59
#endif
58
60
 
59
61
#ifdef RNA_RUNTIME
61
63
#include "DNA_object_types.h"
62
64
#include "DNA_screen_types.h"
63
65
 
 
66
#include "BKE_blender.h"
64
67
#include "BKE_DerivedMesh.h"
65
68
#include "BKE_depsgraph.h"
66
69
#include "BKE_global.h"
67
70
#include "BKE_main.h"
 
71
#include "BKE_idprop.h"
68
72
 
69
73
#include "GPU_draw.h"
70
74
 
77
81
 
78
82
#include "CCL_api.h"
79
83
 
 
84
#include "BKE_addon.h"
 
85
 
80
86
static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
81
87
{
82
88
        WM_main_add_notifier(NC_WINDOW, NULL);
83
89
}
84
90
 
 
91
/* also used by buffer swap switching */
85
92
static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
86
93
{
87
 
        U.widget_unit = (U.dpi * 20 + 36)/72;
88
 
        WM_main_add_notifier(NC_WINDOW, NULL);          /* full redraw */
89
 
        WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);        /* refresh region sizes */
 
94
        BKE_userdef_state();
 
95
        WM_main_add_notifier(NC_WINDOW, NULL);      /* full redraw */
 
96
        WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);    /* refresh region sizes */
90
97
}
91
98
 
92
99
static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
126
133
 
127
134
static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
128
135
{
129
 
        UserDef *userdef = (UserDef*)ptr->data;
130
 
        if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE)       G.f &= ~G_SCRIPT_AUTOEXEC;
131
 
        else                                                                                            G.f |=  G_SCRIPT_AUTOEXEC;
 
136
        UserDef *userdef = (UserDef *)ptr->data;
 
137
        if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE) G.f &= ~G_SCRIPT_AUTOEXEC;
 
138
        else G.f |=  G_SCRIPT_AUTOEXEC;
132
139
}
133
140
 
134
141
static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
143
150
        rna_userdef_update(bmain, scene, ptr);
144
151
}
145
152
 
 
153
static void rna_userdef_gl_gpu_mipmaps(Main *bmain, Scene *scene, PointerRNA *ptr)
 
154
{
 
155
        GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
 
156
        rna_userdef_update(bmain, scene, ptr);
 
157
}
 
158
 
146
159
static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
147
160
{
148
161
        GPU_free_images();
155
168
        rna_userdef_update(bmain, scene, ptr);
156
169
}
157
170
 
158
 
static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
 
171
static void rna_userdef_select_mouse_set(PointerRNA *ptr, int value)
159
172
{
160
 
        UserDef *userdef = (UserDef*)ptr->data;
 
173
        UserDef *userdef = (UserDef *)ptr->data;
161
174
 
162
175
        if (value) {
163
176
                userdef->flag |= USER_LMOUSESELECT;
169
182
 
170
183
static int rna_userdef_autokeymode_get(PointerRNA *ptr)
171
184
{
172
 
        UserDef *userdef = (UserDef*)ptr->data;
 
185
        UserDef *userdef = (UserDef *)ptr->data;
173
186
        short retval = userdef->autokey_mode;
174
187
        
175
188
        if (!(userdef->autokey_mode & AUTOKEY_ON))
178
191
        return retval;
179
192
}
180
193
 
181
 
static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
 
194
static void rna_userdef_autokeymode_set(PointerRNA *ptr, int value)
182
195
{
183
 
        UserDef *userdef = (UserDef*)ptr->data;
 
196
        UserDef *userdef = (UserDef *)ptr->data;
184
197
 
185
198
        if (value == AUTOKEY_MODE_NORMAL) {
186
199
                userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
194
207
 
195
208
static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
196
209
{
197
 
        UserDef *userdef = (UserDef*)ptr->data;
 
210
        UserDef *userdef = (UserDef *)ptr->data;
198
211
        int required_size = userdef->v2d_min_gridsize;
199
212
        
200
213
        /* set the timecode style */
258
271
 
259
272
static void rna_Userdef_memcache_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
260
273
{
261
 
        MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
 
274
        MEM_CacheLimiter_set_maximum(((size_t) U.memcachelimit) * 1024 * 1024);
262
275
}
263
276
 
264
277
static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
265
278
{
266
279
        Object *ob;
267
280
 
268
 
        vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
 
281
        vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL);
269
282
 
270
283
        for (ob = bmain->object.first; ob; ob = ob->id.next) {
271
284
                if (ob->mode & OB_MODE_WEIGHT_PAINT)
284
297
                light->flag |= 1;
285
298
        }
286
299
 
287
 
        WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
 
300
        WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D | NS_VIEW3D_GPU, NULL);
288
301
        rna_userdef_update(bmain, scene, ptr);
289
302
}
290
303
 
304
317
        return bext;
305
318
}
306
319
 
307
 
static void rna_userdef_addon_remove(bAddon *bext)
 
320
static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *bext_ptr)
308
321
{
 
322
        bAddon *bext = bext_ptr->data;
 
323
        if (BLI_findindex(&U.addons, bext) == -1) {
 
324
                BKE_report(reports, RPT_ERROR, "Addon is no longer valid");
 
325
                return;
 
326
        }
 
327
 
 
328
        if (bext->prop) {
 
329
                IDP_FreeProperty(bext->prop);
 
330
                MEM_freeN(bext->prop);
 
331
        }
 
332
 
309
333
        BLI_freelinkN(&U.addons, bext);
 
334
        RNA_POINTER_INVALIDATE(bext_ptr);
310
335
}
311
336
 
312
337
static void rna_userdef_temp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
325
350
        return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceGeneric, ptr->data);
326
351
}
327
352
 
 
353
static PointerRNA rna_Theme_space_gradient_get(PointerRNA *ptr)
 
354
{
 
355
        return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceGradient, ptr->data);
 
356
}
 
357
 
328
358
static PointerRNA rna_Theme_space_list_generic_get(PointerRNA *ptr)
329
359
{
330
360
        return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceListGeneric, ptr->data);
375
405
        }
376
406
        else {
377
407
                /* get device list from cycles. it would be good to make this generic
378
 
                   once we have more subsystems using opencl, for now this is easiest */
 
408
                 * once we have more subsystems using opencl, for now this is easiest */
379
409
                int opencl = (U.compute_device_type == USER_COMPUTE_DEVICE_OPENCL);
380
410
                CCLDeviceInfo *devices = CCL_compute_device_list(opencl);
381
411
                int a;
382
412
 
383
413
                if (devices) {
384
 
                        for (a = 0; devices[a].name; a++) {
 
414
                        for (a = 0; devices[a].identifier[0]; a++) {
385
415
                                tmp.value = devices[a].value;
386
416
                                tmp.identifier = devices[a].identifier;
387
417
                                tmp.name = devices[a].name;
403
433
}
404
434
#endif
405
435
 
 
436
#ifdef WITH_INTERNATIONAL
 
437
static EnumPropertyItem *rna_lang_enum_properties_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
 
438
                                                        PropertyRNA *UNUSED(prop), int *free)
 
439
{
 
440
        *free = 0; /* These items are handled by BLF code! */
 
441
        return BLF_RNA_lang_enum_properties();
 
442
}
 
443
#endif
 
444
 
 
445
static IDProperty *rna_AddonPref_idprops(PointerRNA *ptr, int create)
 
446
{
 
447
        if (create && !ptr->data) {
 
448
                IDPropertyTemplate val = {0};
 
449
                ptr->data = IDP_New(IDP_GROUP, &val, "RNA_AddonPreferences group");
 
450
        }
 
451
 
 
452
        return ptr->data;
 
453
}
 
454
 
 
455
static PointerRNA rna_Addon_preferences_get(PointerRNA *ptr)
 
456
{
 
457
        bAddon *addon = (bAddon *)ptr->data;
 
458
        bAddonPrefType *apt = BKE_addon_pref_type_find(addon->module, TRUE);
 
459
        if (apt) {
 
460
                if (addon->prop == NULL) {
 
461
                        IDPropertyTemplate val = {0};
 
462
                        addon->prop = IDP_New(IDP_GROUP, &val, addon->module); /* name is unimportant  */
 
463
                }
 
464
                return rna_pointer_inherit_refine(ptr, apt->ext.srna, addon->prop);
 
465
        }
 
466
        else {
 
467
                return PointerRNA_NULL;
 
468
        }
 
469
}
 
470
 
 
471
static void rna_AddonPref_unregister(Main *UNUSED(bmain), StructRNA *type)
 
472
{
 
473
        bAddonPrefType *apt = RNA_struct_blender_type_get(type);
 
474
 
 
475
        if (!apt)
 
476
                return;
 
477
 
 
478
        RNA_struct_free_extension(type, &apt->ext);
 
479
 
 
480
        BKE_addon_pref_type_remove(apt);
 
481
        RNA_struct_free(&BLENDER_RNA, type);
 
482
 
 
483
        /* update while blender is running */
 
484
        WM_main_add_notifier(NC_WINDOW, NULL);
 
485
}
 
486
 
 
487
static StructRNA *rna_AddonPref_register(Main *bmain, ReportList *reports, void *data, const char *identifier,
 
488
                                         StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
 
489
{
 
490
        bAddonPrefType *apt, dummyapt = {{'\0'}};
 
491
        bAddon dummyaddon = {NULL};
 
492
        PointerRNA dummyhtr;
 
493
        // int have_function[1];
 
494
 
 
495
        /* setup dummy header & header type to store static properties in */
 
496
        RNA_pointer_create(NULL, &RNA_AddonPreferences, &dummyaddon, &dummyhtr);
 
497
 
 
498
        /* validate the python class */
 
499
        if (validate(&dummyhtr, data, NULL /* have_function */ ) != 0)
 
500
                return NULL;
 
501
 
 
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));
 
506
                return NULL;
 
507
        }
 
508
 
 
509
        /* check if we have registered this header type before, and remove it */
 
510
        apt = BKE_addon_pref_type_find(dummyaddon.module, TRUE);
 
511
        if (apt) {
 
512
                if (apt->ext.srna) {
 
513
                        rna_AddonPref_unregister(bmain, apt->ext.srna);
 
514
                }
 
515
        }
 
516
 
 
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);
 
521
 
 
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);
 
527
 
 
528
//      apt->draw = (have_function[0]) ? header_draw : NULL;
 
529
 
 
530
        /* update while blender is running */
 
531
        WM_main_add_notifier(NC_WINDOW, NULL);
 
532
 
 
533
        return apt->ext.srna;
 
534
}
 
535
 
 
536
/* placeholder, doesn't do anything useful yet */
 
537
static StructRNA *rna_AddonPref_refine(PointerRNA *ptr)
 
538
{
 
539
        return (ptr->type) ? ptr->type : &RNA_AddonPreferences;
 
540
}
 
541
 
406
542
#else
407
543
 
408
544
static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
412
548
        
413
549
        static EnumPropertyItem font_kerning_style[] = {
414
550
                {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"},
415
 
                {1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
416
 
                {0, NULL, 0, NULL, NULL}};
 
551
                {1, "FITTED", 0, "Fitted", "Use scaled and grid-fitted kerning distances"},
 
552
                {0, NULL, 0, NULL, NULL}
 
553
        };
417
554
 
418
555
        srna = RNA_def_struct(brna, "ThemeFontStyle", NULL);
419
556
        RNA_def_struct_sdna(srna, "uiFontStyle");
455
592
 
456
593
        prop = RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
457
594
        RNA_def_property_range(prop, 0.0f, 1.0f);
458
 
        RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
 
595
        RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in gray value");
459
596
        RNA_def_property_update(prop, 0, "rna_userdef_update");
460
597
}
461
598
 
471
608
        RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
472
609
        RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
473
610
        
474
 
        /* (not used yet)
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");
478
 
        */
 
611
 
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");
485
 
        /*      (not used yet) */
486
 
#if 0
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");
493
 
#endif
 
616
        RNA_def_property_ui_text(prop, "Panel Title Font", "");
 
617
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
618
 
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");
624
 
 
 
749
        
 
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");
 
753
        
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");
 
757
 
 
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");
 
761
}
 
762
 
 
763
static void rna_def_userdef_theme_ui_gradient(BlenderRNA *brna)
 
764
{
 
765
        StructRNA *srna;
 
766
        PropertyRNA *prop;
 
767
 
 
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");
 
772
 
 
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");
 
777
 
 
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");
 
782
 
 
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");
628
787
}
629
788
 
630
789
static void rna_def_userdef_theme_ui(BlenderRNA *brna)
635
794
        rna_def_userdef_theme_ui_wcol(brna);
636
795
        rna_def_userdef_theme_ui_wcol_state(brna);
637
796
        rna_def_userdef_theme_ui_panel(brna);
638
 
        
 
797
        rna_def_userdef_theme_ui_gradient(brna);
 
798
 
639
799
        srna = RNA_def_struct(brna, "ThemeUserInterface", NULL);
640
800
        RNA_def_struct_sdna(srna, "ThemeUI");
641
801
        RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
730
890
        RNA_def_property_ui_text(prop, "State Colors", "");
731
891
        RNA_def_property_update(prop, 0, "rna_userdef_update");
732
892
 
733
 
        prop = RNA_def_property(srna, "panel", PROP_POINTER, PROP_NONE);
734
 
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
735
 
        RNA_def_property_ui_text(prop, "Panel Colors", "");
 
893
        prop = RNA_def_property(srna, "menu_shadow_fac", PROP_FLOAT, PROP_FACTOR);
 
894
        RNA_def_property_ui_text(prop, "Menu Shadow Strength", "Blending factor for menu shadows");
 
895
        RNA_def_property_range(prop, 0.01f, 1.0f);
 
896
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
897
        
 
898
        prop = RNA_def_property(srna, "menu_shadow_width", PROP_INT, PROP_NONE);
 
899
        RNA_def_property_ui_text(prop, "Menu Shadow Width", "Width of menu shadows in standard pixels, set to zero to disable it");
 
900
        RNA_def_property_range(prop, 0.0f, 24.0f);
736
901
        RNA_def_property_update(prop, 0, "rna_userdef_update");
737
902
        
738
903
        prop = RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
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");
 
911
        
 
912
        /* axis */
 
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");
 
918
        
 
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");
 
924
        
 
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");
746
930
}
747
931
 
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");
793
977
 
794
 
        /* buttons */
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);
 
978
        /* panel settings */
 
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");
 
983
 
 
984
        /* buttons */
 
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");
 
990
 
 
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");
 
995
 
 
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");
 
1000
 
 
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");
 
1005
/*      } */
 
1006
}
 
1007
 
 
1008
static void rna_def_userdef_theme_space_gradient(BlenderRNA *brna)
 
1009
{
 
1010
        StructRNA *srna;
 
1011
        PropertyRNA *prop;
 
1012
 
 
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", "");
 
1016
 
 
1017
        /* window */
 
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");
 
1022
 
 
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");
 
1027
 
 
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");
 
1032
 
 
1033
        /* header */
 
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");
 
1038
 
 
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");
 
1043
 
 
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");
 
1048
 
 
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");
 
1054
 
 
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");
 
1060
 
 
1061
        /* buttons */
 
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");
800
1067
 
857
1124
        RNA_def_property_ui_text(prop, "Theme Space", "Settings for space");
858
1125
}
859
1126
 
 
1127
static void rna_def_userdef_theme_spaces_gradient(StructRNA *srna)
 
1128
{
 
1129
        PropertyRNA *prop;
 
1130
 
 
1131
        prop = RNA_def_property(srna, "space", PROP_POINTER, PROP_NONE);
 
1132
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
 
1133
        RNA_def_property_struct_type(prop, "ThemeSpaceGradient");
 
1134
        RNA_def_property_pointer_funcs(prop, "rna_Theme_space_gradient_get", NULL, NULL, NULL);
 
1135
        RNA_def_property_ui_text(prop, "Theme Space", "Settings for space");
 
1136
}
 
1137
 
860
1138
static void rna_def_userdef_theme_spaces_list_main(StructRNA *srna)
861
1139
{
862
1140
        PropertyRNA *prop;
1061
1339
        RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
1062
1340
        RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
1063
1341
 
1064
 
        rna_def_userdef_theme_spaces_main(srna);
 
1342
        rna_def_userdef_theme_spaces_gradient(srna);
1065
1343
 
1066
1344
        prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
1067
1345
        RNA_def_property_array(prop, 3);
1068
1346
        RNA_def_property_ui_text(prop, "Grid", "");
1069
1347
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1070
1348
 
1071
 
        prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1072
 
        RNA_def_property_array(prop, 4);
1073
 
        RNA_def_property_ui_text(prop, "Panel", "");
1074
 
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1075
 
 
1076
1349
        prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
1077
1350
        RNA_def_property_array(prop, 3);
1078
1351
        RNA_def_property_ui_text(prop, "Wire", "");
1172
1445
        RNA_def_property_ui_text(prop, "Bone Pose", "");
1173
1446
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1174
1447
 
 
1448
        prop = RNA_def_property(srna, "bone_pose_active", PROP_FLOAT, PROP_COLOR_GAMMA);
 
1449
        RNA_def_property_array(prop, 3);
 
1450
        RNA_def_property_ui_text(prop, "Bone Pose Active", "");
 
1451
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
1452
 
1175
1453
        prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
1176
1454
        RNA_def_property_float_sdna(prop, NULL, "cframe");
1177
1455
        RNA_def_property_array(prop, 3);
1194
1472
        RNA_def_property_array(prop, 3);
1195
1473
        RNA_def_property_ui_text(prop, "Camera Path", "");
1196
1474
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
1475
 
 
1476
        prop = RNA_def_property(srna, "skin_root", PROP_FLOAT, PROP_COLOR_GAMMA);
 
1477
        RNA_def_property_array(prop, 3);
 
1478
        RNA_def_property_ui_text(prop, "Skin Root", "");
 
1479
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1197
1480
}
1198
1481
 
1199
1482
 
1217
1500
        RNA_def_property_ui_text(prop, "Grid", "");
1218
1501
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1219
1502
 
1220
 
        prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1221
 
        RNA_def_property_array(prop, 3);
1222
 
        RNA_def_property_ui_text(prop, "Panel", "");
1223
 
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1224
 
 
1225
1503
        prop = RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
1226
1504
        RNA_def_property_float_sdna(prop, NULL, "shade1");
1227
1505
        RNA_def_property_array(prop, 3);
1304
1582
        RNA_def_property_ui_text(prop, "Selected File", "");
1305
1583
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1306
1584
 
1307
 
        prop = RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR_GAMMA);
1308
 
        RNA_def_property_float_sdna(prop, NULL, "panel");
1309
 
        RNA_def_property_array(prop, 3);
1310
 
        RNA_def_property_ui_text(prop, "Tiles", "");
1311
 
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1312
 
 
1313
1585
        prop = RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR_GAMMA);
1314
1586
        RNA_def_property_float_sdna(prop, NULL, "shade1");
1315
1587
        RNA_def_property_array(prop, 3);
1417
1689
        RNA_def_property_array(prop, 3);
1418
1690
        RNA_def_property_ui_text(prop, "Cursor", "");
1419
1691
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
1692
 
 
1693
        prop = RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
 
1694
        RNA_def_property_float_sdna(prop, NULL, "console_select");
 
1695
        RNA_def_property_array(prop, 4);
 
1696
        RNA_def_property_ui_text(prop, "Selection", "");
 
1697
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
1698
 
1420
1699
}
1421
1700
 
1422
1701
static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
1481
1760
        RNA_def_property_ui_text(prop, "Syntax Built-in", "");
1482
1761
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1483
1762
        
 
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");
 
1768
 
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");
 
1774
 
 
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");
 
1780
 
 
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");
1489
1786
 
1490
1787
        prop = RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
1521
1818
        rna_def_userdef_theme_spaces_main(srna);
1522
1819
        rna_def_userdef_theme_spaces_list_main(srna);
1523
1820
 
 
1821
        prop = RNA_def_property(srna, "node_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
 
1822
        RNA_def_property_float_sdna(prop, NULL, "select");
 
1823
        RNA_def_property_array(prop, 3);
 
1824
        RNA_def_property_ui_text(prop, "Node Selected", "");
 
1825
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
1826
 
 
1827
        prop = RNA_def_property(srna, "node_active", PROP_FLOAT, PROP_COLOR_GAMMA);
 
1828
        RNA_def_property_float_sdna(prop, NULL, "active");
 
1829
        RNA_def_property_array(prop, 3);
 
1830
        RNA_def_property_ui_text(prop, "Active Node", "");
 
1831
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
1832
 
1524
1833
        prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
1525
1834
        RNA_def_property_float_sdna(prop, NULL, "wire");
1526
1835
        RNA_def_property_array(prop, 3);
1569
1878
        RNA_def_property_ui_text(prop, "Group Node", "");
1570
1879
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1571
1880
 
 
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");
 
1886
        
 
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");
 
1892
 
 
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");
 
1898
 
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);
1580
1907
static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
1581
1908
{
1582
1909
        StructRNA *srna;
1583
 
        PropertyRNA *prop;
 
1910
//      PropertyRNA *prop;
1584
1911
        
1585
1912
        /* space_logic */
1586
1913
        
1591
1918
        
1592
1919
        rna_def_userdef_theme_spaces_main(srna);
1593
1920
        
1594
 
        prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1595
 
        RNA_def_property_array(prop, 3);
1596
 
        RNA_def_property_ui_text(prop, "Panel", "");
1597
 
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1598
1921
}
1599
1922
 
1600
1923
 
1601
1924
static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
1602
1925
{
1603
1926
        StructRNA *srna;
1604
 
        PropertyRNA *prop;
 
1927
//      PropertyRNA *prop;
1605
1928
 
1606
1929
        /* space_buts */
1607
1930
 
1612
1935
 
1613
1936
        rna_def_userdef_theme_spaces_main(srna);
1614
1937
 
1615
 
        prop = RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
1616
 
        RNA_def_property_array(prop, 3);
1617
 
        RNA_def_property_ui_text(prop, "Panel", "");
1618
 
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1619
1938
}
1620
1939
 
1621
1940
static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
1769
2088
        RNA_def_property_ui_text(prop, "Effect Strip", "");
1770
2089
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1771
2090
 
1772
 
        prop = RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1773
 
        RNA_def_property_float_sdna(prop, NULL, "plugin");
1774
 
        RNA_def_property_array(prop, 3);
1775
 
        RNA_def_property_ui_text(prop, "Plugin Strip", "");
1776
 
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1777
 
 
1778
2091
        prop = RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
1779
2092
        RNA_def_property_float_sdna(prop, NULL, "transition");
1780
2093
        RNA_def_property_array(prop, 3);
1897
2210
        RNA_def_property_array(prop, 3);
1898
2211
        RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
1899
2212
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
2213
        
 
2214
        prop = RNA_def_property(srna, "summary", PROP_FLOAT, PROP_COLOR_GAMMA);
 
2215
        RNA_def_property_float_sdna(prop, NULL, "anim_active");
 
2216
        RNA_def_property_array(prop, 4);
 
2217
        RNA_def_property_ui_text(prop, "Summary", "Color of summary channel");
 
2218
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1900
2219
}
1901
2220
 
1902
2221
static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
1925
2244
        RNA_def_property_ui_text(prop, "View Sliders", "");
1926
2245
        RNA_def_property_update(prop, 0, "rna_userdef_update");
1927
2246
        
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");
1933
 
 
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");
1939
 
 
 
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");
 
2252
        
 
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");
 
2258
        
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");
1945
 
 
 
2264
        
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");
 
2270
        
 
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");
 
2276
        
 
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");
 
2282
        
 
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");
 
2288
        
 
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");
 
2294
        
 
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");
 
2301
        
 
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");
 
2308
        
 
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");
 
2314
        
 
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");
1951
2321
 
1952
2322
        prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
2003
2373
        RNA_def_struct_ui_text(srna, "Theme Clip Editor", "Theme settings for the Movie Clip Editor");
2004
2374
 
2005
2375
        rna_def_userdef_theme_spaces_main(srna);
 
2376
        rna_def_userdef_theme_spaces_list_main(srna);
2006
2377
 
2007
2378
        prop = RNA_def_property(srna, "marker_outline", PROP_FLOAT, PROP_COLOR_GAMMA);
2008
2379
        RNA_def_property_float_sdna(prop, NULL, "marker_outline");
2009
2380
        RNA_def_property_array(prop, 3);
2010
 
        RNA_def_property_ui_text(prop, "Marker Outline Color", "Color of marker's outile");
 
2381
        RNA_def_property_ui_text(prop, "Marker Outline Color", "Color of marker's outline");
2011
2382
        RNA_def_property_update(prop, 0, "rna_userdef_update");
2012
2383
 
2013
2384
        prop = RNA_def_property(srna, "marker", PROP_FLOAT, PROP_COLOR_GAMMA);
2077
2448
        RNA_def_property_range(prop, 0, 255);
2078
2449
        RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
2079
2450
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
2451
 
 
2452
        prop = RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
 
2453
        RNA_def_property_float_sdna(prop, NULL, "strip");
 
2454
        RNA_def_property_array(prop, 3);
 
2455
        RNA_def_property_ui_text(prop, "Strips", "");
 
2456
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
2457
 
 
2458
        prop = RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
 
2459
        RNA_def_property_float_sdna(prop, NULL, "strip_select");
 
2460
        RNA_def_property_array(prop, 3);
 
2461
        RNA_def_property_ui_text(prop, "Strips Selected", "");
 
2462
        RNA_def_property_update(prop, 0, "rna_userdef_update");
2080
2463
}
2081
2464
 
2082
2465
static void rna_def_userdef_themes(BlenderRNA *brna)
2086
2469
        
2087
2470
        static EnumPropertyItem active_theme_area[] = {
2088
2471
                {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
 
2472
                {19, "STYLE", ICON_FONTPREVIEW, "Text Style", ""},
2089
2473
                {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
2090
2474
                {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
2091
2475
                {2, "TIMELINE", ICON_TIME, "Timeline", ""},
2103
2487
                {15, "INFO", ICON_INFO, "Info", ""},
2104
2488
                {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
2105
2489
                {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
2106
 
            {20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
2107
 
                {0, NULL, 0, NULL, NULL}};
 
2490
                {20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""},
 
2491
                {0, NULL, 0, NULL, NULL}
 
2492
        };
2108
2493
 
2109
2494
        srna = RNA_def_struct(brna, "Theme", NULL);
2110
2495
        RNA_def_struct_sdna(srna, "bTheme");
2114
2499
        prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
2115
2500
        RNA_def_property_ui_text(prop, "Name", "Name of the theme");
2116
2501
        RNA_def_struct_name_property(srna, prop);
2117
 
                /* XXX: for now putting this in presets is silly - its just Default */
 
2502
        /* XXX: for now putting this in presets is silly - its just Default */
2118
2503
        RNA_def_property_flag(prop, PROP_SKIP_SAVE);
2119
2504
 
2120
2505
        prop = RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
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);
 
2639
 
 
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);
 
2644
}
 
2645
 
 
2646
static void rna_def_userdef_addon_pref(BlenderRNA *brna)
 
2647
{
 
2648
        StructRNA *srna;
 
2649
        PropertyRNA *prop;
 
2650
 
 
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 */
 
2654
 
 
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");
 
2658
 
 
2659
        /* registration */
 
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);
2254
2665
}
2255
2666
 
2256
2667
 
2261
2672
        rna_def_userdef_theme_ui(brna);
2262
2673
 
2263
2674
        rna_def_userdef_theme_space_generic(brna);
 
2675
        rna_def_userdef_theme_space_gradient(brna);
2264
2676
        rna_def_userdef_theme_space_list_generic(brna);
2265
2677
        
2266
2678
        rna_def_userdef_theme_space_view3d(brna);
2335
2747
                                             "milliseconds are shown instead"},
2336
2748
                {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds",
2337
2749
                                             "Direct conversion of frame numbers to seconds"},
2338
 
                {0, NULL, 0, NULL, NULL}};
 
2750
                {0, NULL, 0, NULL, NULL}
 
2751
        };
2339
2752
        
2340
2753
        PropertyRNA *prop;
2341
2754
        StructRNA *srna;
2405
2818
        RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay",
2406
2819
                                 "Time delay in 1/10 seconds before automatically opening sub level menus");
2407
2820
 
2408
 
        prop = RNA_def_property(srna, "quit_dialog", PROP_BOOLEAN, PROP_NONE);
 
2821
        prop = RNA_def_property(srna, "use_quit_dialog", PROP_BOOLEAN, PROP_NONE);
2409
2822
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_QUIT_PROMPT);
2410
2823
        RNA_def_property_ui_text(prop, "Prompt Quit",
2411
2824
                                 "Asks for confirmation when quitting through the window close button");
2437
2850
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
2438
2851
        RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
2439
2852
 
2440
 
        prop = RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
2441
 
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
 
2853
        prop = RNA_def_property(srna, "use_mouse_depth_navigate", PROP_BOOLEAN, PROP_NONE);
 
2854
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZBUF_ORBIT);
2442
2855
        RNA_def_property_ui_text(prop, "Auto Depth",
2443
2856
                                 "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
2444
2857
 
 
2858
        prop = RNA_def_property(srna, "use_mouse_depth_cursor", PROP_BOOLEAN, PROP_NONE);
 
2859
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZBUF_CURSOR);
 
2860
        RNA_def_property_ui_text(prop, "Cursor Depth",
 
2861
                                 "Use the depth under the mouse when placing the cursor");
 
2862
 
2445
2863
        prop = RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
2446
2864
        RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
2447
2865
        RNA_def_property_ui_text(prop, "Camera Parent Lock",
2535
2953
                                 "Minimum number of pixels between each gridline in 2D Viewports");
2536
2954
        RNA_def_property_update(prop, 0, "rna_userdef_update");
2537
2955
        
2538
 
                /* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */
 
2956
        /* TODO: add a setter for this, so that we can bump up the minimum size as necessary... */
2539
2957
        prop = RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
2540
2958
        RNA_def_property_enum_items(prop, timecode_styles);
2541
2959
        RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
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}
 
2975
        };
2557
2976
                
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}
 
2982
        };
2563
2983
                
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}
 
2988
        };
2568
2989
 
2569
2990
        srna = RNA_def_struct(brna, "UserPreferencesEdit", NULL);
2570
2991
        RNA_def_struct_sdna(srna, "UserDef");
2632
3053
        RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
2633
3054
        RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available",
2634
3055
                                 "Automatic keyframe insertion in available F-Curves");
 
3056
 
 
3057
        prop = RNA_def_property(srna, "use_auto_keying_warning", PROP_BOOLEAN, PROP_NONE);
 
3058
        RNA_def_property_boolean_negative_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_NOWARNING);
 
3059
        RNA_def_property_ui_text(prop, "Show Auto Keying Warning",
 
3060
                                 "Show warning indicators when transforming objects and bones if auto keying is enabled");
2635
3061
        
2636
3062
        /* keyframing settings */
2637
3063
        prop = RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
2653
3079
        RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
2654
3080
        RNA_def_property_ui_text(prop, "New Interpolation Type",
2655
3081
                                 "Interpolation mode used for first keyframe on newly added F-Curves "
2656
 
                                 "(subsequent keyframes take interpolation from preceeding keyframe)");
 
3082
                                 "(subsequent keyframes take interpolation from preceding keyframe)");
2657
3083
        
2658
3084
        prop = RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
2659
3085
        RNA_def_property_enum_items(prop, keyframe_handle_type_items);
2665
3091
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
2666
3092
        RNA_def_property_ui_text(prop, "Allow Negative Frames",
2667
3093
                                 "Current frame number can be manually set to a negative value");
2668
 
                                                         
 
3094
 
2669
3095
        /* fcurve opacity */
2670
3096
        prop = RNA_def_property(srna, "fcurve_unselected_alpha", PROP_FLOAT, PROP_FACTOR);
2671
3097
        RNA_def_property_float_sdna(prop, NULL, "fcu_inactive_alpha");
2672
3098
        RNA_def_property_range(prop, 0.001f, 1.0f);
2673
3099
        RNA_def_property_ui_text(prop, "Unselected F-Curve Visibility",
2674
3100
                                 "Amount that unselected F-Curves stand out from the background (Graph Editor)");
2675
 
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
 
3101
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_GRAPH, NULL);
2676
3102
        
2677
3103
        /* grease pencil */
2678
3104
        prop = RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
2744
3170
        RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
2745
3171
        RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
2746
3172
                
2747
 
                /* xxx */
 
3173
        /* xxx */
2748
3174
        prop = RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
2749
3175
        RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
2750
3176
        RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
2751
 
                /* xxx */
 
3177
        /* xxx */
2752
3178
        prop = RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
2753
3179
        RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
2754
3180
        RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
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}
 
3202
        };
2776
3203
 
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}
 
3211
        };
2784
3212
 
2785
3213
        static EnumPropertyItem audio_mixing_samples_items[] = {
2786
3214
                {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
2791
3219
                {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
2792
3220
                {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
2793
3221
                {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
2794
 
                {0, NULL, 0, NULL, NULL}};
 
3222
                {0, NULL, 0, NULL, NULL}
 
3223
        };
2795
3224
 
2796
3225
        static EnumPropertyItem audio_device_items[] = {
2797
3226
                {0, "NONE", 0, "None", "Null device - there will be no audio output"},
2804
3233
#ifdef WITH_JACK
2805
3234
                {3, "JACK", 0, "Jack", "JACK - Audio Connection Kit, recommended for pro audio users"},
2806
3235
#endif
2807
 
                {0, NULL, 0, NULL, NULL}};
 
3236
                {0, NULL, 0, NULL, NULL}
 
3237
        };
2808
3238
 
2809
3239
        static EnumPropertyItem audio_rate_items[] = {
2810
3240
/*              {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"}, */
2817
3247
/*              {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"}, */
2818
3248
                {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
2819
3249
                {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
2820
 
                {0, NULL, 0, NULL, NULL}};
 
3250
                {0, NULL, 0, NULL, NULL}
 
3251
        };
2821
3252
 
2822
3253
        static EnumPropertyItem audio_format_items[] = {
2823
3254
                {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
2826
3257
                {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
2827
3258
                {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
2828
3259
                {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
2829
 
                {0, NULL, 0, NULL, NULL}};
 
3260
                {0, NULL, 0, NULL, NULL}
 
3261
        };
2830
3262
 
2831
3263
        static EnumPropertyItem audio_channel_items[] = {
2832
3264
                {1, "MONO", 0, "Mono", "Set audio channels to mono"},
2834
3266
                {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
2835
3267
                {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
2836
3268
                {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
2837
 
                {0, NULL, 0, NULL, NULL}};
 
3269
                {0, NULL, 0, NULL, NULL}
 
3270
        };
2838
3271
 
2839
3272
        static EnumPropertyItem draw_method_items[] = {
2840
3273
                {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
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}
 
3284
        };
2851
3285
        
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}};
2858
 
        
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}
 
3292
        };
 
3293
        
 
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}
 
3301
        };
 
3302
        
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}
 
3306
        };
2901
3307
 
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}
 
3312
        };
2906
3313
#endif
2907
3314
 
2908
3315
        srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL);
2920
3327
 
2921
3328
        prop = RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
2922
3329
        RNA_def_property_int_sdna(prop, NULL, "dpi");
2923
 
        RNA_def_property_range(prop, 48, 128);
 
3330
        RNA_def_property_range(prop, 48, 144);
2924
3331
        RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
2925
3332
        RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
2926
3333
        
2939
3346
 
2940
3347
        prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
2941
3348
        RNA_def_property_enum_items(prop, language_items);
 
3349
#ifdef WITH_INTERNATIONAL
 
3350
        RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_lang_enum_properties_itemf");
 
3351
#endif
2942
3352
        RNA_def_property_ui_text(prop, "Language", "Language used for translation");
2943
3353
        RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update");
2944
3354
 
2982
3392
        RNA_def_property_enum_items(prop, color_picker_types);
2983
3393
        RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
2984
3394
        RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
 
3395
        RNA_def_property_update(prop, 0, "rna_userdef_update");
2985
3396
        
2986
3397
        prop = RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
2987
3398
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
3003
3414
        prop = RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
3004
3415
        RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
3005
3416
        RNA_def_property_range(prop, 0, 500);
3006
 
        RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
 
3417
        RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback (sequencer only)");
3007
3418
 
3008
3419
        prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
3009
3420
        RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
3010
 
        RNA_def_property_range(prop, 0, (sizeof(void *) == 8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
3011
 
        RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
 
3421
        RNA_def_property_range(prop, 0, (sizeof(void *) == 8) ? 1024 * 32 : 1024); /* 32 bit 2 GB, 64 bit 32 GB */
 
3422
        RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit (in megabytes)");
3012
3423
        RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
3013
3424
 
3014
3425
        prop = RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
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");
3036
3447
 
 
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");
 
3452
 
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);
3043
3459
 
 
3460
#if 0
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)");
 
3465
#endif
3048
3466
 
3049
3467
        prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
3050
3468
        RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
3078
3496
        RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
3079
3497
        RNA_def_property_enum_items(prop, draw_method_items);
3080
3498
        RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
3081
 
        RNA_def_property_update(prop, 0, "rna_userdef_update");
 
3499
        RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
3082
3500
 
3083
3501
        prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
3084
3502
        RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
3126
3544
        RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
3127
3545
        RNA_def_property_update(prop, 0, "rna_userdef_text_update");
3128
3546
        
 
3547
        /* Full scene anti-aliasing */
 
3548
        prop = RNA_def_property(srna, "multi_sample", PROP_ENUM, PROP_NONE);
 
3549
        RNA_def_property_enum_bitflag_sdna(prop, NULL, "ogl_multisamples");
 
3550
        RNA_def_property_enum_items(prop, multi_sample_levels);
 
3551
        RNA_def_property_ui_text(prop, "MultiSample", "Enable OpenGL multi-sampling, only for systems that support it, requires restart");
 
3552
 
 
3553
        prop = RNA_def_property(srna, "use_region_overlap", PROP_BOOLEAN, PROP_NONE);
 
3554
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_REGION_OVERLAP);
 
3555
        RNA_def_property_ui_text(prop, "Region Overlap",
 
3556
                                 "Draw tool/property regions over the main region, when using Triple Buffer");
 
3557
        RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
 
3558
        
3129
3559
#ifdef WITH_CYCLES
3130
3560
        prop = RNA_def_property(srna, "compute_device_type", PROP_ENUM, PROP_NONE);
3131
3561
        RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
3133
3563
        RNA_def_property_enum_items(prop, compute_device_type_items);
3134
3564
        RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_compute_device_type_itemf");
3135
3565
        RNA_def_property_ui_text(prop, "Compute Device Type", "Device to use for computation (rendering with Cycles)");
 
3566
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL);
3136
3567
 
3137
3568
        prop = RNA_def_property(srna, "compute_device", PROP_ENUM, PROP_NONE);
3138
3569
        RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
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}
 
3586
        };
3155
3587
                
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}
 
3592
        };
 
3593
 
 
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}
 
3598
        };
3160
3599
                
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}
 
3606
        };
3167
3607
        
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}
 
3612
        };
3172
3613
                
3173
3614
        srna = RNA_def_struct(brna, "UserPreferencesInput", NULL);
3174
3615
        RNA_def_struct_sdna(srna, "UserDef");
3224
3665
        /* global options */
3225
3666
        prop = RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
3226
3667
        RNA_def_property_range(prop, 0.25f, 4.0f);
3227
 
        RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
 
3668
        RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse for panning");
 
3669
        
 
3670
        prop = RNA_def_property(srna, "ndof_orbit_sensitivity", PROP_FLOAT, PROP_NONE);
 
3671
        RNA_def_property_range(prop, 0.25f, 4.0f);
 
3672
        RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for orbiting");
3228
3673
 
3229
3674
        prop = RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
3230
3675
        RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
3240
3685
        RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
3241
3686
        RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
3242
3687
        /* TODO: update description when fly-mode visuals are in place  ("projected position in fly mode")*/
 
3688
        
 
3689
        /* 3D view */
 
3690
        prop = RNA_def_property(srna, "ndof_view_rotate_method", PROP_ENUM, PROP_NONE);
 
3691
        RNA_def_property_enum_bitflag_sdna(prop, NULL, "ndof_flag");
 
3692
        RNA_def_property_enum_items(prop, ndof_view_rotation_items);
 
3693
        RNA_def_property_ui_text(prop, "NDOF View Rotation", "Rotation style in the viewport");
3243
3694
 
3244
3695
        /* 3D view: roll */
3245
3696
        prop = RNA_def_property(srna, "ndof_roll_invert_axis", PROP_BOOLEAN, PROP_NONE);
3310
3761
        RNA_def_property_range(prop, 0, 32);
3311
3762
        RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "Number of lines scrolled at a time with the mouse wheel");
3312
3763
        
 
3764
        prop = RNA_def_property(srna, "use_trackpad_natural", PROP_BOOLEAN, PROP_NONE);
 
3765
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_TRACKPAD_NATURAL);
 
3766
        RNA_def_property_ui_text(prop, "Trackpad Natural",
 
3767
                                 "If your system uses 'natural' scrolling, this option keeps consistent trackpad usage throughout the UI");
 
3768
 
3313
3769
        prop = RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
3314
3770
        RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
3315
3771
        RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
3321
3777
        StructRNA *srna;
3322
3778
        
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}
 
3788
        };
3332
3789
        
3333
3790
        srna = RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
3334
3791
        RNA_def_struct_sdna(srna, "UserDef");
3349
3806
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
3350
3807
        RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector");
3351
3808
 
 
3809
        prop = RNA_def_property(srna, "hide_system_bookmarks", PROP_BOOLEAN, PROP_NONE);
 
3810
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_SYSTEM_BOOKMARKS);
 
3811
        RNA_def_property_ui_text(prop, "Hide System Bookmarks", "Hide system bookmarks in the file selector");
 
3812
 
3352
3813
        prop = RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
3353
3814
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_THUMBNAILS);
3354
3815
        RNA_def_property_ui_text(prop, "Show Thumbnails", "Open in thumbnail view for images and movies");
3373
3834
        RNA_def_property_string_sdna(prop, NULL, "textudir");
3374
3835
        RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
3375
3836
 
3376
 
        prop = RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
3377
 
        RNA_def_property_string_sdna(prop, NULL, "plugtexdir");
3378
 
        RNA_def_property_ui_text(prop, "Texture Plugin Directory", "The default directory to search for texture plugins");
3379
 
 
3380
 
        prop = RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
3381
 
        RNA_def_property_string_sdna(prop, NULL, "plugseqdir");
3382
 
        RNA_def_property_ui_text(prop, "Sequence Plugin Directory",
3383
 
                                 "The default directory to search for sequence plugins");
3384
 
 
3385
3837
        prop = RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
3386
3838
        RNA_def_property_string_sdna(prop, NULL, "renderdir");
3387
3839
        RNA_def_property_ui_text(prop, "Render Output Directory",
3394
3846
                                 "startup, addons & modules (requires restart)");
3395
3847
        /* TODO, editing should reset sys.path! */
3396
3848
 
 
3849
        prop = RNA_def_property(srna, "i18n_branches_directory", PROP_STRING, PROP_DIRPATH);
 
3850
        RNA_def_property_string_sdna(prop, NULL, "i18ndir");
 
3851
        RNA_def_property_ui_text(prop, "Translation Branches Directory",
 
3852
                                 "The path to the '/branches' directory of your local svn-translation copy, "
 
3853
                                 "to allow translating from the UI");
 
3854
 
3397
3855
        prop = RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
3398
3856
        RNA_def_property_string_sdna(prop, NULL, "sounddir");
3399
3857
        RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
3415
3873
        RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
3416
3874
        RNA_def_property_enum_items(prop, anim_player_presets);
3417
3875
        RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
3418
 
        RNA_def_property_enum_default(prop, 1);         /* set default to blender 2.4 player until an internal one is back */
 
3876
        RNA_def_property_enum_default(prop, 1);     /* set default to blender 2.4 player until an internal one is back */
3419
3877
        
3420
3878
        /* Autosave  */
3421
3879
 
3438
3896
                                 "The time (in minutes) to wait between automatic temporary saves");
3439
3897
        RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
3440
3898
 
 
3899
        prop = RNA_def_property(srna, "use_keep_session", PROP_BOOLEAN, PROP_NONE);
 
3900
        RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_KEEP_SESSION);
 
3901
        RNA_def_property_ui_text(prop, "Keep Session",
 
3902
                                 "Always load session recovery and save it after quitting Blender");
 
3903
        
3441
3904
        prop = RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
3442
3905
        RNA_def_property_range(prop, 0, 30);
3443
3906
        RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
3448
3911
                                 "Enables automatic saving of preview images in the .blend file");
3449
3912
}
3450
3913
 
3451
 
void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
 
3914
static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
3452
3915
{
3453
3916
        StructRNA *srna;
3454
3917
        FunctionRNA *func;
3467
3930
        RNA_def_function_return(func, parm);
3468
3931
 
3469
3932
        func = RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
3470
 
        RNA_def_function_flag(func, FUNC_NO_SELF);
 
3933
        RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_REPORTS);
3471
3934
        RNA_def_function_ui_description(func, "Remove addon");
3472
3935
        parm = RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove");
3473
 
        RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
 
3936
        RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 
3937
        RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
3474
3938
}
3475
3939
 
3476
3940
void RNA_def_userdef(BlenderRNA *brna)
3486
3950
                {USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
3487
3951
                {USER_SECTION_FILE, "FILES", 0, "File", ""},
3488
3952
                {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
3489
 
                {0, NULL, 0, NULL, NULL}};
 
3953
                {0, NULL, 0, NULL, NULL}
 
3954
        };
3490
3955
 
3491
3956
        rna_def_userdef_dothemes(brna);
3492
3957
        rna_def_userdef_solidlight(brna);
3557
4022
        rna_def_userdef_filepaths(brna);
3558
4023
        rna_def_userdef_system(brna);
3559
4024
        rna_def_userdef_addon(brna);
 
4025
        rna_def_userdef_addon_pref(brna);
3560
4026
        
3561
4027
}
3562
4028