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:
authorTon Roosendaal <ton@blender.org>2011-01-12 21:00:23 +0300
committerTon Roosendaal <ton@blender.org>2011-01-12 21:00:23 +0300
commit604d029ddf164e87eb453d83c59e65c2f16f8879 (patch)
treec981354dab170549f1fb729e51e068f0cb0a8ecc /source/blender/editors/sculpt_paint
parent505e2d882af792480764791c070c19849477f774 (diff)
Bugfix #25570
The tool-redo depends on a working undo system, so it can rewind a step and then redo operator with new settings. When a user disables undo, this won't work. Now the properties for redo operator (toolbar, F6) will grey out when a redo isn't possible.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_undo.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c
index 758ef2a2fc1..6425e2d0494 100644
--- a/source/blender/editors/sculpt_paint/paint_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_undo.c
@@ -239,6 +239,27 @@ int ED_undo_paint_step(bContext *C, int type, int step, const char *name)
return 0;
}
+int ED_undo_paint_valid(int type, const char *name)
+{
+ UndoStack *stack;
+
+ if(type == UNDO_PAINT_IMAGE)
+ stack= &ImageUndoStack;
+ else if(type == UNDO_PAINT_MESH)
+ stack= &MeshUndoStack;
+ else
+ return 0;
+
+ if(stack->current==NULL);
+ else {
+ if(name && strcmp(stack->current->name, name) == 0)
+ return 1;
+ else
+ return stack->elems.first != stack->elems.last;
+ }
+ return 0;
+}
+
void ED_undo_paint_free(void)
{
undo_stack_free(&ImageUndoStack);