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:
authorJoseph Eagar <joeedh@gmail.com>2022-08-16 00:52:02 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-08-16 00:52:02 +0300
commit3f9299e45d39051f341fcc2d6415defcc01eca93 (patch)
treebc831f2db7d246155bd1600e5e3492c1eedf95d4 /source/blender/editors/sculpt_paint/sculpt_intern.h
parent6b49b54bb13721b8fbe23acb6084af9280887778 (diff)
Sculpt: Fix redo panel bugs
SCULPT_undo_push_begin no longer takes an explicit name. Instead it takes a wmOperator pointer and uses op->type->name for the name. This is necassary for the redo panel to work and should fix the entire class of bugs related to misspelled undo push names. Cases where the calling operator is not registered may use SCULPT_undo_push_begin_ex if desired; it takes a name string as before.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_intern.h')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 6a10f7cad18..d9f40fedf2b 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -1493,11 +1493,17 @@ SculptUndoNode *SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType
SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node, SculptUndoType type);
SculptUndoNode *SCULPT_undo_get_first_node(void);
+/* Pushes an undo step using the operator name. This is necassary for
+ * redo panels to work; operators that do not support that may use
+ * SCULPT_undo_push_begin_ex instead if so desired.
+ */
+void SCULPT_undo_push_begin(struct Object *ob, const struct wmOperator *op);
+
/**
- * NOTE: `name` must match operator name for
- * redo panels to work.
+ * NOTE: SCULPT_undo_push_begin is preferred since `name`
+ * must match operator name for redo panels to work.
*/
-void SCULPT_undo_push_begin(struct Object *ob, const char *name);
+void SCULPT_undo_push_begin_ex(struct Object *ob, const char *name);
void SCULPT_undo_push_end(struct Object *ob);
void SCULPT_undo_push_end_ex(struct Object *ob, const bool use_nested_undo);