From ce3f040e140996d7594c25e436ba49d7c09b30ed Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Jun 2011 16:59:15 +0000 Subject: fix [#27627] Strange behavior with solid open gl lights disable turning off all lights in the user preferences. --- source/blender/makesrna/intern/rna_userdef.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/makesrna/intern/rna_userdef.c') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b67805c97b9..14af5ed7a3f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -245,6 +245,13 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr) { + /* if all lights are off gpu_draw resets them all, [#27627] + * so disallow them all to be disabled */ + if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) { + SolidLight *light= ptr->data; + light->flag |= 1; + } + WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL); rna_userdef_update(bmain, scene, ptr); } -- cgit v1.2.3 From a3e296fc4060ab9aac46a8ec2f18696d6776d653 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Wed, 15 Jun 2011 18:59:22 +0000 Subject: Committing patch #25676 Anisotropic filtering in viewport and BGE by me. This patch adds anisotropic filtering of textures in the viewport and the BGE. The quality of the filtering is adjustable in the user preferences under System. For more information on anisotropic filtering: http://en.wikipedia.org/wiki/Anisotropic_filtering One current limitation of this setup (having the option a user preference) is it makes runtimes more troublesome. Runtimes don't have user preferences set, so for now the blender player defaults to 2x AF. Options will be added later to change this value (probably a command line option). --- source/blender/makesrna/intern/rna_userdef.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/blender/makesrna/intern/rna_userdef.c') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 14af5ed7a3f..cf371fbf9bc 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -117,6 +117,12 @@ static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr rna_userdef_update(bmain, scene, ptr); } +static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + GPU_set_anisotropic(U.anisotropic_filter); + rna_userdef_update(bmain, scene, ptr); +} + static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr) { GPU_free_images(); @@ -2346,6 +2352,14 @@ static void rna_def_userdef_system(BlenderRNA *brna) {128, "CLAMP_128", 0, "128", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem anisotropic_items[] ={ + {1, "FILTER_0", 0, "Off", ""}, + {2, "FILTER_2", 0, "2x", ""}, + {4, "FILTER_4", 0, "4x", ""}, + {8, "FILTER_8", 0, "8x", ""}, + {16, "FILTER_16", 0, "16x", ""}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem audio_mixing_samples_items[] = { {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"}, {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"}, @@ -2568,6 +2582,13 @@ static void rna_def_userdef_system(BlenderRNA *brna) prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA); RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)"); + + prop= RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter"); + RNA_def_property_enum_items(prop, anisotropic_items); + RNA_def_property_enum_default(prop, 1); + RNA_def_property_ui_text(prop, "Anisotropic Filter", "The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)"); + RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update"); prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "glreslimit"); -- cgit v1.2.3 From 09fc9257e1420879bde42b249bc3750fde31b14d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 20 Jun 2011 03:24:07 +0000 Subject: fix [#27664] startup.blend - manipulator user-prefs regarding issues in the report 1) fixed in previous commit. 2) intentional leaving as is. 3) left 'handle size' as is IMHO acceptably general, edited 'hotshop' tooltip/ 4) corrected default values. --- source/blender/makesrna/intern/rna_userdef.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_userdef.c') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index cf371fbf9bc..1bdb21d2d00 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2115,19 +2115,22 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_size"); RNA_def_property_range(prop, 2, 40); + RNA_def_property_int_default(prop, 15); RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE); 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 widget handles as percentage of widget radius"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_hotspot"); RNA_def_property_range(prop, 4, 40); - RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Hotspot in pixels for clicking widget handles"); + RNA_def_property_int_default(prop, 14); + RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Pixel distance around the handles to accept mouse clicks"); prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); -- cgit v1.2.3 From 05fb0e2d61f49b138e4f1c0abd8465cf77f95eca Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Fri, 24 Jun 2011 14:00:15 +0000 Subject: First commit to make "Style" settings saved in startup.blend Usage currently is limited to: - Panel text, widget text and label text style: point size, shadow effects Setting individual fonts to these is not possible yet, it uses the default for it. Access goes via outliner now; check "User Preferences". UI team could add this in userpref scripts :) --- source/blender/makesrna/intern/rna_userdef.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/blender/makesrna/intern/rna_userdef.c') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 1bdb21d2d00..4d1e1f175f2 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -361,36 +361,37 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) RNA_def_struct_sdna(srna, "uiStyle"); RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets"); + /* (not used yet) prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.5, 2.0); RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas"); - + */ prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "paneltitle"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); - RNA_def_property_ui_text(prop, "Panel Font", ""); + RNA_def_property_ui_text(prop, "Panel Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - +/* (not used yet) prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "grouplabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Group Label Font", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - +*/ prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); - RNA_def_property_ui_text(prop, "Widget Label Font", ""); + RNA_def_property_ui_text(prop, "Widget Label Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widget"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); - RNA_def_property_ui_text(prop, "Widget Font", ""); + RNA_def_property_ui_text(prop, "Widget Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); } -- cgit v1.2.3