diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 628 |
1 files changed, 420 insertions, 208 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 617d44a8626..6a5f8f5aaa6 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -36,11 +36,12 @@ #include "BLI_utildefines.h" #include "BLI_math_base.h" +#include "BLI_math_vector.h" #include "BKE_appdir.h" -#include "BKE_DerivedMesh.h" #include "BKE_sound.h" #include "BKE_addon.h" +#include "BKE_studiolight.h" #include "RNA_access.h" #include "RNA_define.h" @@ -52,7 +53,6 @@ #include "WM_types.h" #include "BLT_lang.h" -#include "GPU_buffers.h" #ifdef WITH_OPENSUBDIV static const EnumPropertyItem opensubdiv_compute_type_items[] = { @@ -68,16 +68,7 @@ static const EnumPropertyItem opensubdiv_compute_type_items[] = { #endif static const EnumPropertyItem audio_device_items[] = { - {0, "NONE", 0, "None", "Null device - there will be no audio output"}, -#ifdef WITH_SDL - {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage"}, -#endif -#ifdef WITH_OPENAL - {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"}, -#endif -#ifdef WITH_JACK - {3, "JACK", 0, "JACK", "JACK Audio Connection Kit, recommended for pro audio users"}, -#endif + {0, "Null", 0, "None", "Null device - there will be no audio output"}, {0, NULL, 0, NULL, NULL} }; @@ -87,6 +78,7 @@ const EnumPropertyItem rna_enum_navigation_mode_items[] = { {0, NULL, 0, NULL, NULL} }; + #if defined(WITH_INTERNATIONAL) || !defined(RNA_RUNTIME) static const EnumPropertyItem rna_enum_language_default_items[] = { {0, "DEFAULT", 0, "Default (Default)", ""}, @@ -94,19 +86,30 @@ static const EnumPropertyItem rna_enum_language_default_items[] = { }; #endif +static const EnumPropertyItem rna_enum_studio_light_orientation_items[] = { + {STUDIOLIGHT_ORIENTATION_CAMERA, "CAMERA", 0, "Camera", ""}, + {STUDIOLIGHT_ORIENTATION_WORLD, "WORLD", 0, "World", ""}, + {STUDIOLIGHT_ORIENTATION_VIEWNORMAL, "MATCAP", 0, "MatCap", ""}, + {0, NULL, 0, NULL, NULL} +}; + + #ifdef RNA_RUNTIME #include "DNA_object_types.h" #include "DNA_screen_types.h" #include "BKE_blender.h" -#include "BKE_depsgraph.h" +#include "BKE_DerivedMesh.h" #include "BKE_global.h" -#include "BKE_main.h" #include "BKE_idprop.h" +#include "BKE_main.h" +#include "BKE_mesh_runtime.h" #include "BKE_pbvh.h" #include "BKE_paint.h" +#include "DEG_depsgraph.h" + #include "GPU_draw.h" #include "GPU_select.h" @@ -183,10 +186,12 @@ static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; - if (userdef->tw_flag & V3D_USE_MANIPULATOR) - v3d->twflag |= V3D_USE_MANIPULATOR; - else - v3d->twflag &= ~V3D_USE_MANIPULATOR; + if (userdef->manipulator_flag & USER_MANIPULATOR_DRAW) { + v3d->twflag |= V3D_MANIPULATOR_DRAW; + } + else { + v3d->twflag &= ~V3D_MANIPULATOR_DRAW; + } } } } @@ -210,12 +215,6 @@ static void rna_userdef_load_ui_update(Main *UNUSED(bmain), Scene *UNUSED(scene) else G.fileflags &= ~G_FILE_NO_UI; } -static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - GPU_set_mipmap(bmain, !(U.gameflags & USER_DISABLE_MIPMAP)); - rna_userdef_update(bmain, scene, ptr); -} - static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr) { GPU_set_anisotropic(bmain, U.anisotropic_filter); @@ -367,11 +366,11 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN Object *ob; bTheme *btheme = UI_GetTheme(); - vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL, btheme->tv3d.vertex_unreferenced); + BKE_mesh_runtime_color_band_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight) : NULL, btheme->tv3d.vertex_unreferenced); for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->mode & OB_MODE_WEIGHT_PAINT) - DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } rna_userdef_update(bmain, scene, ptr); @@ -513,7 +512,7 @@ static void rna_userdef_opensubdiv_update(Main *bmain, Scene *UNUSED(scene), Poi if (object->derivedFinal != NULL && object->derivedFinal->type == DM_TYPE_CCGDM) { - DAG_id_tag_update(&object->id, OB_RECALC_OB); + DEG_id_tag_update(&object->id, OB_RECALC_OB); } } } @@ -527,7 +526,6 @@ static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C int totitem = 0; EnumPropertyItem *item = NULL; -#ifdef WITH_SYSTEM_AUDASPACE int i; char **names = BKE_sound_get_device_names(); @@ -536,31 +534,6 @@ static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C EnumPropertyItem new_item = {i, names[i], 0, names[i], names[i]}; RNA_enum_item_add(&item, &totitem, &new_item); } -#else - /* NONE */ - RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]); - -#ifdef WITH_SDL -# ifdef WITH_SDL_DYNLOAD - if (sdlewInit() == SDLEW_SUCCESS) -# endif - { - RNA_enum_item_add(&item, &totitem, &audio_device_items[index]); - } - index++; -#endif - -#ifdef WITH_OPENAL - RNA_enum_item_add(&item, &totitem, &audio_device_items[index++]); -#endif - -#ifdef WITH_JACK - if (BKE_sound_is_jack_supported()) { - RNA_enum_item_add(&item, &totitem, &audio_device_items[index]); - } - index++; -#endif -#endif /* may be unused */ UNUSED_VARS(index, audio_device_items); @@ -679,6 +652,136 @@ static StructRNA *rna_AddonPref_refine(PointerRNA *ptr) return (ptr->type) ? ptr->type : &RNA_AddonPreferences; } +static float rna_ThemeUI_roundness_get(PointerRNA *ptr) +{ + /* Remap from relative radius to 0..1 range. */ + uiWidgetColors *tui = (uiWidgetColors *)ptr->data; + return tui->roundness * 2.0f; +} + +static void rna_ThemeUI_roundness_set(PointerRNA *ptr, float value) +{ + uiWidgetColors *tui = (uiWidgetColors *)ptr->data; + tui->roundness = value * 0.5f; +} + +/* Studio Light */ +static void rna_UserDef_studiolight_begin(CollectionPropertyIterator *iter, PointerRNA *UNUSED(ptr)) +{ + rna_iterator_listbase_begin(iter, BKE_studiolight_listbase(), NULL); +} + +static void rna_StudioLights_refresh(UserDef *UNUSED(userdef)) +{ + BKE_studiolight_refresh(); +} + +static void rna_StudioLights_remove(UserDef *UNUSED(userdef), StudioLight *studio_light) +{ + BKE_studiolight_remove(studio_light); +} + +static StudioLight *rna_StudioLights_new(UserDef *UNUSED(userdef), const char *path, int orientation) +{ + return BKE_studiolight_new(path, orientation); +} + +/* StudioLight.name */ +static void rna_UserDef_studiolight_name_get(PointerRNA *ptr, char *value) +{ + StudioLight *sl = (StudioLight *)ptr->data; + BLI_strncpy(value, sl->name, FILE_MAXFILE); +} + +static int rna_UserDef_studiolight_name_length(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + return strlen(sl->name); +} + +/* StudioLight.path */ +static void rna_UserDef_studiolight_path_get(PointerRNA *ptr, char *value) +{ + StudioLight *sl = (StudioLight *)ptr->data; + BLI_strncpy(value, sl->path, FILE_MAX); +} + +static int rna_UserDef_studiolight_path_length(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + return strlen(sl->path); +} + +/* StudioLight.path_irr_cache */ +static void rna_UserDef_studiolight_path_irr_cache_get(PointerRNA *ptr, char *value) +{ + StudioLight *sl = (StudioLight *)ptr->data; + if (sl->path_irr_cache) { + BLI_strncpy(value, sl->path_irr_cache, FILE_MAX); + } + value[0] = 0x00; +} + +static int rna_UserDef_studiolight_path_irr_cache_length(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + if (sl->path_irr_cache) { + return strlen(sl->path_irr_cache); + } + return 0; +} + +/* StudioLight.path_sh_cache */ +static void rna_UserDef_studiolight_path_sh_cache_get(PointerRNA *ptr, char *value) +{ + StudioLight *sl = (StudioLight *)ptr->data; + if (sl->path_sh_cache) { + BLI_strncpy(value, sl->path_sh_cache, FILE_MAX); + } + value[0] = 0x00; +} + +static int rna_UserDef_studiolight_path_sh_cache_length(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + if (sl->path_sh_cache) { + return strlen(sl->path_sh_cache); + } + return 0; +} + +/* StudioLight.index */ +static int rna_UserDef_studiolight_index_get(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + return sl->index; +} + +/* StudioLight.is_user_defined */ +static int rna_UserDef_studiolight_is_user_defined_get(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + return (sl->flag & STUDIOLIGHT_USER_DEFINED) > 0; +} + +/* StudioLight.orientation */ + +static int rna_UserDef_studiolight_orientation_get(PointerRNA *ptr) +{ + StudioLight *sl = (StudioLight *)ptr->data; + return sl->flag & STUDIOLIGHT_FLAG_ORIENTATIONS; +} + +static void rna_UserDef_studiolight_spherical_harmonics_coefficients_get(PointerRNA *ptr, float *values) +{ + StudioLight *sl = (StudioLight *)ptr->data; + float *value = values; + for (int i = 0; i < STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS; i++) { + copy_v3_v3(value, sl->spherical_harmonics_coefs[i]); + value += 3; + } +} + #else /* TODO(sergey): This technically belongs to blenlib, but we don't link @@ -849,6 +952,11 @@ static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna) RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Down", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "roundness", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_funcs(prop, "rna_ThemeUI_roundness_get", "rna_ThemeUI_roundness_set", NULL); + RNA_def_property_ui_text(prop, "Roundness", "Amount of edge rounding"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) @@ -891,6 +999,16 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Driven Selected", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "inner_overridden", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Overridden", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "inner_overridden_sel", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Overridden Selected", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Blend", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -914,6 +1032,10 @@ static void rna_def_userdef_theme_ui_panel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Background", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "sub_back", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_ui_text(prop, "Sub Background", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "show_header", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Show Header", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -974,6 +1096,11 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Tool Widget Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "wcol_toolbar_item", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_ui_text(prop, "Toolbar Item Widget Colors", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Radio Widget Colors", ""); @@ -1059,6 +1186,11 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_ui_text(prop, "State Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "wcol_tab", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_ui_text(prop, "Tab Colors", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "menu_shadow_fac", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Menu Shadow Strength", "Blending factor for menu shadows"); RNA_def_property_range(prop, 0.01f, 1.0f); @@ -1078,12 +1210,22 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Icon Alpha", "Transparency of icons in the interface, to reduce contrast"); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "icon_saturation", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_ui_text(prop, "Icon Saturation", "Saturation of icons in the interface"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "widget_emboss", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "widget_emboss"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Widget Emboss", "Color of the 1px shadow line underlying widgets"); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "editor_outline", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "editor_outline"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Editor Outline", "Color of the outline of the editors and their round corners"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + /* axis */ prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "xaxis"); @@ -1102,6 +1244,37 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Z Axis", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + + /* Generic manipulator colors. */ + prop = RNA_def_property(srna, "manipulator_hi", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "manipulator_hi"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Manipulator Highlight", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "manipulator_primary", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "manipulator_primary"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Manipulator Primary", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "manipulator_secondary", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "manipulator_secondary"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Manipulator Secondary", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "manipulator_a", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "manipulator_a"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Manipulator A", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + + prop = RNA_def_property(srna, "manipulator_b", PROP_FLOAT, PROP_COLOR_GAMMA); + RNA_def_property_float_sdna(prop, NULL, "manipulator_b"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Manipulator B", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_common(StructRNA *srna) @@ -1125,7 +1298,7 @@ static void rna_def_userdef_theme_space_common(StructRNA *srna) /* header */ prop = RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); + RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Header", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -1305,7 +1478,7 @@ static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna) RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 1, 10); + RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "Vertex Size", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -1527,7 +1700,7 @@ static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, bool incl_nurbs RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, 255); + RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Handle Vertex Size", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); } @@ -1586,7 +1759,7 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) prop = RNA_def_property(srna, "wire_edit", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Wire Edit", ""); + RNA_def_property_ui_text(prop, "Wire Edit", "Color for wireframe when in edit mode, but edge selection is active"); RNA_def_property_update(prop, 0, "rna_userdef_update"); @@ -1614,18 +1787,6 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Active Object", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "group"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Object Grouped", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop = RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "group_active"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Object Grouped Active", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "text_keyframe", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "time_keyframe"); RNA_def_property_array(prop, 3); @@ -2273,23 +2434,6 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_userdef_update"); } -static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) -{ - StructRNA *srna; -// PropertyRNA *prop; - - /* space_logic */ - - srna = RNA_def_struct(brna, "ThemeLogicEditor", NULL); - RNA_def_struct_sdna(srna, "ThemeSpace"); - RNA_def_struct_clear_flag(srna, STRUCT_UNDO); - RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor"); - - rna_def_userdef_theme_spaces_main(srna); - -} - - static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) { StructRNA *srna; @@ -2306,44 +2450,6 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) } -static void rna_def_userdef_theme_space_time(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - /* space_time */ - - srna = RNA_def_struct(brna, "ThemeTimeline", NULL); - RNA_def_struct_sdna(srna, "ThemeSpace"); - RNA_def_struct_clear_flag(srna, STRUCT_UNDO); - RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline"); - - rna_def_userdef_theme_spaces_main(srna); - - prop = RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop = RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "cframe"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop = RNA_def_property(srna, "time_keyframe", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "time_keyframe"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Keyframe", "Base color for keyframe indicator lines"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop = RNA_def_property(srna, "time_grease_pencil", PROP_FLOAT, PROP_COLOR_GAMMA); - RNA_def_property_float_sdna(prop, NULL, "time_gp_keyframe"); - RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Grease Pencil", "Color of Grease Pencil keyframes"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); -} - static void rna_def_userdef_theme_space_image(BlenderRNA *brna) { StructRNA *srna; @@ -2745,7 +2851,7 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) srna = RNA_def_struct(brna, "ThemeNLAEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); RNA_def_struct_clear_flag(srna, STRUCT_UNDO); - RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor"); + RNA_def_struct_ui_text(srna, "Theme Nonlinear Animation", "Theme settings for the NLA Editor"); rna_def_userdef_theme_spaces_main(srna); rna_def_userdef_theme_spaces_list_main(srna); @@ -2975,6 +3081,34 @@ static void rna_def_userdef_theme_space_clip(BlenderRNA *brna) rna_def_userdef_theme_spaces_curves(srna, false, false, false, true); } +static void rna_def_userdef_theme_space_topbar(BlenderRNA *brna) +{ + StructRNA *srna; + + /* space_topbar */ + + srna = RNA_def_struct(brna, "ThemeTopBar", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); + RNA_def_struct_ui_text(srna, "Theme Top Bar", "Theme settings for the Top Bar"); + + rna_def_userdef_theme_spaces_main(srna); +} + +static void rna_def_userdef_theme_space_statusbar(BlenderRNA *brna) +{ + StructRNA *srna; + + /* space_statusbar */ + + srna = RNA_def_struct(brna, "ThemeStatusBar", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); + RNA_def_struct_ui_text(srna, "Theme Status Bar", "Theme settings for the Status Bar"); + + rna_def_userdef_theme_spaces_main(srna); +} + static void rna_def_userdef_themes(BlenderRNA *brna) { StructRNA *srna; @@ -2985,15 +3119,13 @@ static void rna_def_userdef_themes(BlenderRNA *brna) {19, "STYLE", ICON_FONTPREVIEW, "Text Style", ""}, {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""}, {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""}, - {2, "TIMELINE", ICON_TIME, "Timeline", ""}, {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""}, {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dope Sheet", ""}, - {5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""}, + {5, "NLA_EDITOR", ICON_NLA, "Nonlinear Animation", ""}, {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""}, {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""}, {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""}, {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""}, - {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""}, {11, "PROPERTIES", ICON_BUTS, "Properties", ""}, {12, "OUTLINER", ICON_OOPS, "Outliner", ""}, {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""}, @@ -3001,6 +3133,8 @@ static void rna_def_userdef_themes(BlenderRNA *brna) {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""}, {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""}, {20, "CLIP_EDITOR", ICON_CLIP, "Movie Clip Editor", ""}, + {21, "TOPBAR", ICON_NONE, "Top Bar", ""}, + {22, "STATUSBAR", ICON_NONE, "Status Bar", ""}, {0, NULL, 0, NULL, NULL} }; @@ -3049,7 +3183,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "tnla"); RNA_def_property_struct_type(prop, "ThemeNLAEditor"); - RNA_def_property_ui_text(prop, "NLA Editor", ""); + RNA_def_property_ui_text(prop, "Nonlinear Animation", ""); prop = RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); @@ -3081,24 +3215,12 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeTextEditor"); RNA_def_property_ui_text(prop, "Text Editor", ""); - prop = RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "ttime"); - RNA_def_property_struct_type(prop, "ThemeTimeline"); - RNA_def_property_ui_text(prop, "Timeline", ""); - prop = RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "tnode"); RNA_def_property_struct_type(prop, "ThemeNodeEditor"); RNA_def_property_ui_text(prop, "Node Editor", ""); - prop = RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "tlogic"); - RNA_def_property_struct_type(prop, "ThemeLogicEditor"); - RNA_def_property_ui_text(prop, "Logic Editor", ""); - prop = RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "toops"); @@ -3134,6 +3256,18 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "tclip"); RNA_def_property_struct_type(prop, "ThemeClipEditor"); RNA_def_property_ui_text(prop, "Clip Editor", ""); + + prop = RNA_def_property(srna, "topbar", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "ttopbar"); + RNA_def_property_struct_type(prop, "ThemeTopBar"); + RNA_def_property_ui_text(prop, "Top Bar", ""); + + prop = RNA_def_property(srna, "statusbar", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "tstatusbar"); + RNA_def_property_struct_type(prop, "ThemeStatusBar"); + RNA_def_property_ui_text(prop, "Status Bar", ""); } static void rna_def_userdef_addon(BlenderRNA *brna) @@ -3156,6 +3290,90 @@ static void rna_def_userdef_addon(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Addon_preferences_get", NULL, NULL, NULL); } +static void rna_def_userdef_studiolights(BlenderRNA *brna) +{ + StructRNA *srna; + FunctionRNA *func; + PropertyRNA *parm; + + srna = RNA_def_struct(brna, "StudioLights", NULL); + RNA_def_struct_sdna(srna, "UserDef"); + RNA_def_struct_ui_text(srna, "Studio Lights", "Collection of studio lights"); + + func = RNA_def_function(srna, "new", "rna_StudioLights_new"); + RNA_def_function_ui_description(func, "Create a new studiolight"); + parm = RNA_def_string(func, "path", NULL, 0, "File Path", "File path where the studio light file can be found"); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_enum(func, "orientation", rna_enum_studio_light_orientation_items, STUDIOLIGHT_ORIENTATION_WORLD, "Orientation", "The orientation for the new studio light"); + RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); + parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "Newly created StudioLight"); + RNA_def_function_return(func, parm); + + func = RNA_def_function(srna, "remove", "rna_StudioLights_remove"); + RNA_def_function_ui_description(func, "Remove a studio light"); + parm = RNA_def_pointer(func, "studio_light", "StudioLight", "", "The studio light to remove"); + RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + + func = RNA_def_function(srna, "refresh", "rna_StudioLights_refresh"); + RNA_def_function_ui_description(func, "Refresh Studio Lights from disk"); +} + +static void rna_def_userdef_studiolight(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + RNA_define_verify_sdna(false); + srna = RNA_def_struct(brna, "StudioLight", NULL); + RNA_def_struct_clear_flag(srna, STRUCT_UNDO); + RNA_def_struct_ui_text(srna, "Studio Light", "Studio light"); + + prop = RNA_def_property(srna, "index", PROP_INT, PROP_NONE); + RNA_def_property_int_funcs(prop, "rna_UserDef_studiolight_index_get", NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Index", ""); + + prop = RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_UserDef_studiolight_is_user_defined_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "User Defined", ""); + + prop = RNA_def_property(srna, "orientation", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_enum_studio_light_orientation_items); + RNA_def_property_enum_funcs(prop, "rna_UserDef_studiolight_orientation_get", NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Orientation", ""); + + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_string_funcs(prop, "rna_UserDef_studiolight_name_get", "rna_UserDef_studiolight_name_length", NULL); + RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_struct_name_property(srna, prop); + + prop = RNA_def_property(srna, "path", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_funcs(prop, "rna_UserDef_studiolight_path_get", "rna_UserDef_studiolight_path_length", NULL); + RNA_def_property_ui_text(prop, "Path", ""); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + prop = RNA_def_property(srna, "path_irr_cache", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_funcs(prop, "rna_UserDef_studiolight_path_irr_cache_get", "rna_UserDef_studiolight_path_irr_cache_length", NULL); + RNA_def_property_ui_text(prop, "Irradiance Cache Path", "Path where the irradiance cache is stored"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + prop = RNA_def_property(srna, "path_sh_cache", PROP_STRING, PROP_DIRPATH); + RNA_def_property_string_funcs(prop, "rna_UserDef_studiolight_path_sh_cache_get", "rna_UserDef_studiolight_path_sh_cache_length", NULL); + RNA_def_property_ui_text(prop, "SH Cache Path", "Path where the spherical harmonics cache is stored"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + + const int spherical_harmonics_dim[] = {STUDIOLIGHT_SPHERICAL_HARMONICS_COMPONENTS, 3}; + prop = RNA_def_property(srna, "spherical_harmonics_coefficients", PROP_FLOAT, PROP_COLOR); + RNA_def_property_multi_array(prop, 2, spherical_harmonics_dim); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_funcs(prop, "rna_UserDef_studiolight_spherical_harmonics_coefficients_get", NULL, NULL); + + RNA_define_verify_sdna(true); +} + static void rna_def_userdef_pathcompare(BlenderRNA *brna) { StructRNA *srna; @@ -3217,14 +3435,14 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_space_seq(brna); rna_def_userdef_theme_space_buts(brna); rna_def_userdef_theme_space_text(brna); - rna_def_userdef_theme_space_time(brna); rna_def_userdef_theme_space_node(brna); rna_def_userdef_theme_space_outliner(brna); rna_def_userdef_theme_space_info(brna); rna_def_userdef_theme_space_userpref(brna); rna_def_userdef_theme_space_console(brna); - rna_def_userdef_theme_space_logic(brna); rna_def_userdef_theme_space_clip(brna); + rna_def_userdef_theme_space_topbar(brna); + rna_def_userdef_theme_space_statusbar(brna); rna_def_userdef_theme_colorset(brna); rna_def_userdef_themes(brna); } @@ -3371,7 +3589,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips (when off hold Alt to force display)"); prop = RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON); + RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON); RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips"); prop = RNA_def_property(srna, "show_developer_ui", PROP_BOOLEAN, PROP_NONE); @@ -3385,11 +3603,6 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL); - RNA_def_property_ui_text(prop, "Global Scene", "Force the current Scene to be displayed in all Screens"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0); RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available"); @@ -3493,10 +3706,6 @@ static void rna_def_userdef_view(BlenderRNA *brna) "Otherwise menus, etc will always be top to bottom, left to right, " "no matter opening direction"); - prop = RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND); - RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views"); - prop = RNA_def_property(srna, "use_mouse_depth_navigate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DEPTH_NAVIGATE); RNA_def_property_ui_text(prop, "Auto Depth", @@ -3567,30 +3776,30 @@ static void rna_def_userdef_view(BlenderRNA *brna) /* 3D transform widget */ prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", V3D_USE_MANIPULATOR); + RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW); RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator"); RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update"); + prop = RNA_def_property(srna, "show_manipulator_navigate", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW_NAVIGATE); + RNA_def_property_ui_text(prop, "Navigate Manipulator", "Use 3D navigation manipulator"); + RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update"); + + /* TODO, expose once it's working. */ +#if 0 + prop = RNA_def_property(srna, "show_manipulator_shaded", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_SHADED); + RNA_def_property_ui_text(prop, "Manipulator Shaded", "Use 3D transform manipulator"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); +#endif + prop = RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_PIXEL); - RNA_def_property_int_sdna(prop, NULL, "tw_size"); + RNA_def_property_int_sdna(prop, NULL, "manipulator_size"); RNA_def_property_range(prop, 10, 200); RNA_def_property_int_default(prop, 75); RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of the manipulator"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_PERCENTAGE); - RNA_def_property_int_sdna(prop, NULL, "tw_handlesize"); - RNA_def_property_range(prop, 2, 40); - RNA_def_property_int_default(prop, 25); - RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of manipulator handles as percentage of the radius"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop = RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_PIXEL); - RNA_def_property_int_sdna(prop, NULL, "tw_hotspot"); - RNA_def_property_range(prop, 4, 40); - RNA_def_property_int_default(prop, 14); - RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Distance around the handles to accept mouse clicks"); - prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); RNA_def_property_range(prop, 4, 10); @@ -3932,20 +4141,6 @@ static void rna_def_userdef_system(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static const EnumPropertyItem draw_method_items[] = { - {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"}, - {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", - "Use a third buffer for minimal redraws at the cost of more memory"}, - {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", - "Redraw all overlapping regions, minimal memory usage but more redraws"}, - {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip", - "Redraw all overlapping regions, minimal memory usage but more redraws " - "(for graphics drivers that do flipping)"}, - {USER_DRAW_FULL, "FULL", 0, "Full", - "Do a full redraw each time, slow, only use for reference or when everything else fails"}, - {0, NULL, 0, NULL, NULL} - }; - static const EnumPropertyItem color_picker_types[] = { {USER_CP_CIRCLE_HSV, "CIRCLE_HSV", 0, "Circle (HSV)", "A circular Hue/Saturation color wheel, with Value slider"}, {USER_CP_CIRCLE_HSL, "CIRCLE_HSL", 0, "Circle (HSL)", "A circular Hue/Saturation color wheel, with Lightness slider"}, @@ -3978,6 +4173,13 @@ static void rna_def_userdef_system(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static const EnumPropertyItem gpu_antialias_method_items[] = { + {USER_AA_NONE, "OFF", 0, "Off", "Disable Anti Alias in viewport"}, + {USER_AA_FXAA, "FXAA", 0, "FXAA", "Use FXAA, a fast screenspace Anti Alias method"}, + {USER_AA_TAA8, "TAA8", 0, "TAA 8x", "Use TAA with 8 samples when screen is static, when not static fallback to FXAA"}, + {0, NULL, 0, NULL, NULL} + }; + srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL); RNA_def_struct_sdna(srna, "UserDef"); RNA_def_struct_nested(brna, srna, "UserPreferences"); @@ -3991,20 +4193,27 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts"); RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_language_update"); + prop = RNA_def_property(srna, "ui_scale", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_sdna(prop, NULL, "dpi_fac"); + RNA_def_property_ui_text(prop, "UI Scale", + "Size multiplier to use when drawing custom user interface elements, so that " + "they are scaled correctly on screens with different DPI. This value is based " + "on operating system DPI settings and Blender display scale"); + + prop = RNA_def_property(srna, "ui_line_width", PROP_FLOAT, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_float_sdna(prop, NULL, "pixelsize"); + RNA_def_property_ui_text(prop, "UI Line Width", + "Suggested line thickness and point size in pixels, for add-ons drawing custom " + "user interface elements, based on operating system settings and Blender UI scale"); + prop = RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "DPI", - "DPI for add-ons to use when drawing custom user interface elements, controlled by " - "operating system settings and Blender UI scale, with a reference value of 72 DPI " - "(note that since this value includes a user defined scale, it is not always the " - "actual monitor DPI)"); prop = RNA_def_property(srna, "pixel_size", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_sdna(prop, NULL, "pixelsize"); - RNA_def_property_ui_text(prop, "Pixel Size", - "Suggested line thickness and point size in pixels, for add-ons drawing custom user " - "interface elements, controlled by operating system settings and Blender UI scale"); prop = RNA_def_property(srna, "font_path_ui", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "font_path_ui"); @@ -4108,24 +4317,12 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit (in megabytes)"); RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update"); - prop = RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "frameserverport"); - RNA_def_property_range(prop, 0, 32727); - RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering"); - prop = RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "glalphaclip"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP); - RNA_def_property_ui_text(prop, "Mipmaps", - "Scale textures for the 3D View (looks nicer but uses more memory and slows image " - "reloading)"); - RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update"); - prop = RNA_def_property(srna, "use_16bit_textures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_16bit_textures", 1); RNA_def_property_ui_text(prop, "16 Bit Float Textures", "Use 16 bit per component texture for float images"); @@ -4170,12 +4367,6 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector"); - prop = RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod"); - RNA_def_property_enum_items(prop, draw_method_items); - RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager"); - RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); - prop = RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mixbufsize"); RNA_def_property_enum_items(prop, audio_mixing_samples_items); @@ -4239,6 +4430,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_enum_items(prop, multi_sample_levels); RNA_def_property_ui_text(prop, "MultiSample", "Enable OpenGL multi-sampling, only for systems that support it, requires restart"); + RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); prop = RNA_def_property(srna, "use_region_overlap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag2", USER_REGION_OVERLAP); @@ -4246,6 +4438,13 @@ static void rna_def_userdef_system(BlenderRNA *brna) "Draw tool/property regions over the main region, when using Triple Buffer"); RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); + prop = RNA_def_property(srna, "max_anti_alias_method", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "gpu_viewport_antialias"); + RNA_def_property_enum_items(prop, gpu_antialias_method_items); + RNA_def_property_ui_text(prop, "Viewport Anti-aliasing", + "Method to draw the Anti-Aliasing in the viewport"); + RNA_def_property_update(prop, 0, "rna_userdef_update"); + #ifdef WITH_OPENSUBDIV prop = RNA_def_property(srna, "opensubdiv_compute_type", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); @@ -4706,6 +4905,7 @@ void RNA_def_userdef(BlenderRNA *brna) {USER_SECTION_INPUT, "INPUT", 0, "Input", ""}, {USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""}, {USER_SECTION_THEME, "THEMES", 0, "Themes", ""}, + {USER_SECTION_LIGHT, "LIGHTS", 0, "Lights", ""}, {USER_SECTION_FILE, "FILES", 0, "File", ""}, {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""}, {0, NULL, 0, NULL, NULL} @@ -4791,6 +4991,16 @@ void RNA_def_userdef(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_THICK_WRAP); + /* StudioLight Collection */ + prop = RNA_def_property(srna, "studio_lights", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "StudioLight"); + RNA_def_property_srna(prop, "StudioLights"); + RNA_def_property_collection_funcs( + prop, "rna_UserDef_studiolight_begin", "rna_iterator_listbase_next", + "rna_iterator_listbase_end", "rna_iterator_listbase_get", + NULL, NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Studio Lights", ""); + rna_def_userdef_view(brna); rna_def_userdef_edit(brna); rna_def_userdef_input(brna); @@ -4798,6 +5008,8 @@ void RNA_def_userdef(BlenderRNA *brna) rna_def_userdef_system(brna); rna_def_userdef_addon(brna); rna_def_userdef_addon_pref(brna); + rna_def_userdef_studiolights(brna); + rna_def_userdef_studiolight(brna); rna_def_userdef_pathcompare(brna); } |