[Bf-blender-cvs] [62392f76c9a] userpref_redesign: Revert changes to RNA path of undo settings

William Reynish noreply at git.blender.org
Thu Jan 3 22:16:25 CET 2019


Commit: 62392f76c9aae2945a5422a74017fac369ead194
Author: William Reynish
Date:   Wed Jan 2 22:52:51 2019 +0100
Branches: userpref_redesign
https://developer.blender.org/rB62392f76c9aae2945a5422a74017fac369ead194

Revert changes to RNA path of undo settings

Too many Add-ons use these settings, we shouldn't break them all after
beta release. RNA and UI structuring are a bit out-of-sync here now, but
that's an acceptable annoyance.

Also adds some slightly nicer grouping in the RNA file, and moves the
Weight Paint Range property to the View category to match the UI.

===================================================================

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 75fddb84513..a6e4aa4b90a 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -251,16 +251,16 @@ class USERPREF_PT_interface_viewports_3d_weight_paint(PreferencePanel):
 
     def draw_header(self, context):
         prefs = context.preferences
-        system = prefs.system
+        view = prefs.view
 
-        self.layout.prop(system, "use_weight_color_range", text="")
+        self.layout.prop(view, "use_weight_color_range", text="")
 
     def draw_props(self, context, layout):
         prefs = context.preferences
-        system = prefs.system
+        view = prefs.view
 
-        layout.active = system.use_weight_color_range
-        layout.template_color_ramp(system, "weight_color_range", expand=True)
+        layout.active = view.use_weight_color_range
+        layout.template_color_ramp(view, "weight_color_range", expand=True)
 
 
 class USERPREF_PT_interface_viewports_2d(PreferencePanel):
@@ -650,10 +650,11 @@ class USERPREF_PT_system_memory(PreferencePanel):
     def draw_props(self, context, layout):
         prefs = context.preferences
         system = prefs.system
+        edit = prefs.edit
 
-        layout.prop(system, "undo_steps", text="Undo Steps")
-        layout.prop(system, "undo_memory_limit", text="Undo Memory Limit")
-        layout.prop(system, "use_global_undo")
+        layout.prop(edit, "undo_steps", text="Undo Steps")
+        layout.prop(edit, "undo_memory_limit", text="Undo Memory Limit")
+        layout.prop(edit, "use_global_undo")
 
         layout.separator()
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 950f986897a..1fd560fa0af 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3755,6 +3755,23 @@ static void rna_def_userdef_view(BlenderRNA *brna)
 	                         "Show the frames per second screen refresh rate, while animation is played back");
 	RNA_def_property_update(prop, 0, "rna_userdef_update");
 
+	/* Weight Paint */
+
+	prop = RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
+	RNA_def_property_ui_text(prop, "Use Weight Color Range",
+	                         "Enable color range used for weight visualization in weight painting mode");
+	RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
+
+	prop = RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
+	RNA_def_property_flag(prop, PROP_NEVER_NULL);
+	RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
+	RNA_def_property_struct_type(prop, "ColorRamp");
+	RNA_def_property_ui_text(prop, "Weight Color Range",
+	                         "Color range used for weight visualization in weight painting mode");
+	RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
+
+
 	/* app flags (use for app-templates) */
 	prop = RNA_def_property(srna, "show_layout_ui", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "app_flag", USER_APP_LOCK_UI_LAYOUT);
@@ -4065,6 +4082,25 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
 	        "When entering numbers while transforming, "
 	        "default to advanced mode for full math expression evaluation");
 
+	/* Undo */
+
+	prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "undosteps");
+	RNA_def_property_range(prop, 0, 256);
+	RNA_def_property_int_funcs(prop, NULL, "rna_userdef_undo_steps_set", NULL);
+	RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
+
+	prop = RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "undomemory");
+	RNA_def_property_range(prop, 0, max_memory_in_megabytes_int());
+	RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
+
+	prop = RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
+	RNA_def_property_ui_text(prop, "Global Undo",
+	                         "Global undo works by keeping a full copy of the file itself in memory, "
+	                         "so takes extra memory");
+
 
 	/* auto keyframing */
 	prop = RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
@@ -4346,38 +4382,77 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 	RNA_def_property_float_sdna(prop, NULL, "pixelsize");
 
-	/* Undo */
-
-	prop = RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
-	RNA_def_property_int_sdna(prop, NULL, "undosteps");
-	RNA_def_property_range(prop, 0, 256);
-	RNA_def_property_int_funcs(prop, NULL, "rna_userdef_undo_steps_set", NULL);
-	RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
 
-	prop = RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
-	RNA_def_property_int_sdna(prop, NULL, "undomemory");
-	RNA_def_property_range(prop, 0, max_memory_in_megabytes_int());
-	RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
+	/* Memory */
 
-	prop = RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
-	RNA_def_property_ui_text(prop, "Global Undo",
-	                         "Global undo works by keeping a full copy of the file itself in memory, "
-	                         "so takes extra memory");
+	prop = RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
+	RNA_def_property_range(prop, 0, INT_MAX);
+	RNA_def_property_ui_range(prop, 0, 500, 1, -1);
+	RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback (sequencer only)");
 
+	prop = RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
+	RNA_def_property_range(prop, 0, max_memory_in_megabytes_int());
+	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, "scrollback", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_int_sdna(prop, NULL, "scrollback");
 	RNA_def_property_range(prop, 32, 32768);
 	RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
 
+
+	/* System */
+
 	prop = RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "author");
 	RNA_def_property_string_maxlength(prop, 80);
 	RNA_def_property_ui_text(prop, "Author",
 	                         "Name that will be used in exported files when format supports such feature");
 
-	/* System & OpenGL */
+	prop = RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
+	RNA_def_property_ui_text(prop, "Auto Run Python Scripts",
+	                         "Allow any .blend file to run scripts automatically "
+	                         "(unsafe with blend files from an untrusted source)");
+	RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
+
+	prop = RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
+	RNA_def_property_ui_text(prop, "Tabs as Spaces",
+	                         "Automatically convert all new tabs into spaces for new and loaded text files");
+
+	/* OpenGL */
+
+	/* Full scene anti-aliasing */
+	prop = RNA_def_property(srna, "multi_sample", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "ogl_multisamples");
+	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");
+
+	/* grease pencil anti-aliasing */
+	prop = RNA_def_property(srna, "gpencil_multi_sample", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_multisamples");
+	RNA_def_property_enum_items(prop, multi_sample_levels);
+	RNA_def_property_ui_text(prop, "Gpencil MultiSample",
+	                         "Enable Grease Pencil OpenGL multi-sampling, only for systems that support it");
+	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);
+	RNA_def_property_ui_text(prop, "Region Overlap",
+	                         "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, "gpu_viewport_quality", PROP_FLOAT, PROP_FACTOR);
+	RNA_def_property_float_sdna(prop, NULL, "gpu_viewport_quality");
+	RNA_def_property_float_default(prop, 0.6f);
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_ui_text(prop, "Viewport Quality", "Quality setting for Solid mode rendering in the 3d viewport");
+	RNA_def_property_update(prop, 0, "rna_userdef_update");
 
 	prop = RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_collection_sdna(prop, NULL, "light_param", "");
@@ -4396,51 +4471,14 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 	                               "View the result of the studio light editor in the viewport");
 	RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
 
-	prop = RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list