[Bf-blender-cvs] [627a27dc69d] greasepencil-object: Fix error after merge
Antonio Vazquez
noreply at git.blender.org
Sun Apr 1 12:45:36 CEST 2018
Commit: 627a27dc69d06aab4c6f5811d442d31cb1353392
Author: Antonio Vazquez
Date: Sun Apr 1 12:45:21 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB627a27dc69d06aab4c6f5811d442d31cb1353392
Fix error after merge
===================================================================
M source/blender/editors/util/undo.c
===================================================================
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 1bbb6bcd5ce..40346301075 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -117,6 +117,8 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
wmWindow *win = CTX_wm_window(C);
// Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
+ Object *obact = CTX_data_active_object(C);
+ ScrArea *sa = CTX_wm_area(C);
/* undo during jobs are running can easily lead to freeing data using by jobs,
* or they can just lead to freezing job in some other cases */
@@ -144,28 +146,28 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
else {
BKE_undosys_step_undo_compat_only(wm->undo_stack, C, step);
}
-
- /* Set special modes for grease pencil */
- if (sa && (sa->spacetype == SPACE_VIEW3D)) {
- obact = CTX_data_active_object(C);
- if (obact && (obact->type == OB_GPENCIL)) {
- WorkSpace *workspace = CTX_wm_workspace(C);
- /* set cursor */
- if (workspace->object_mode == OB_MODE_GPENCIL_PAINT) {
- ED_gpencil_toggle_brush_cursor(C, true, NULL);
- }
- else if (workspace->object_mode == OB_MODE_GPENCIL_SCULPT) {
- ED_gpencil_toggle_brush_cursor(C, true, NULL);
- }
- else if (workspace->object_mode == OB_MODE_GPENCIL_WEIGHT) {
- ED_gpencil_toggle_brush_cursor(C, true, NULL);
- }
- else {
- ED_gpencil_toggle_brush_cursor(C, false, NULL);
+
+ /* Set special modes for grease pencil */
+ if (sa && (sa->spacetype == SPACE_VIEW3D)) {
+ if (obact && (obact->type == OB_GPENCIL)) {
+ WorkSpace *workspace = CTX_wm_workspace(C);
+ /* set cursor */
+ if (workspace->object_mode == OB_MODE_GPENCIL_PAINT) {
+ ED_gpencil_toggle_brush_cursor(C, true, NULL);
+ }
+ else if (workspace->object_mode == OB_MODE_GPENCIL_SCULPT) {
+ ED_gpencil_toggle_brush_cursor(C, true, NULL);
+ }
+ else if (workspace->object_mode == OB_MODE_GPENCIL_WEIGHT) {
+ ED_gpencil_toggle_brush_cursor(C, true, NULL);
+ }
+ else {
+ ED_gpencil_toggle_brush_cursor(C, false, NULL);
+ }
+ /* set workspace mode */
+ Base *basact = CTX_data_active_base(C);
+ ED_object_base_activate(C, basact);
}
- /* set workspace mode */
- Base *basact = CTX_data_active_base(C);
- ED_object_base_activate(C, basact);
}
}
More information about the Bf-blender-cvs
mailing list