Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-11-07 12:24:11 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2014-11-07 12:31:15 +0300
commit5604a3d31ddb01c6856f9e85c87111e155137984 (patch)
treee00a8fb2081a9fb489dea39c86b9f8effe2c116d
parenta8b9402c8ffdcf294929e11051bcc49e1bbc1037 (diff)
Fix T42531: Setting 'Undo' steps to '1' causes weirdness.
Do not allow '1' value here, it's useless. Thanks to Campbell for suggested solution here!
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index a23c3ea8534..ab82c5abf86 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -209,6 +209,14 @@ static void rna_userdef_gl_use_16bit_textures(Main *bmain, Scene *scene, Pointer
rna_userdef_update(bmain, scene, ptr);
}
+static void rna_userdef_undo_steps_set(PointerRNA *ptr, int value)
+{
+ UserDef *userdef = (UserDef *)ptr->data;
+
+ /* Do not allow 1 undo steps, useless and breaks undo/redo process (see T42531). */
+ userdef->undosteps = (value == 1) ? 2 : value;
+}
+
static void rna_userdef_select_mouse_set(PointerRNA *ptr, int value)
{
UserDef *userdef = (UserDef *)ptr->data;
@@ -3465,6 +3473,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
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, 64);
+ 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);