Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/util/undo.c
| Context not available. | |||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_gpencil_types.h" | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| Context not available. | |||||
| #include "BKE_library_override.h" | #include "BKE_library_override.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | |||||
| #include "BKE_paint.h" | |||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| Context not available. | |||||
| if (ED_gpencil_session_active()) { | if (ED_gpencil_session_active()) { | ||||
| return ED_undo_gpencil_step(C, step, undoname); | return ED_undo_gpencil_step(C, step, undoname); | ||||
| } | } | ||||
| if (sa && (sa->spacetype == SPACE_VIEW3D)) { | |||||
| if (obact && (obact->type == OB_GPENCIL)) { | |||||
| ED_gpencil_toggle_brush_cursor(C, false, NULL); | |||||
| } | |||||
| } | |||||
| if (sa && (sa->spacetype == SPACE_IMAGE)) { | if (sa && (sa->spacetype == SPACE_IMAGE)) { | ||||
| SpaceImage *sima = (SpaceImage *)sa->spacedata.first; | SpaceImage *sima = (SpaceImage *)sa->spacedata.first; | ||||
| Context not available. | |||||
| WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene); | ||||
| } | } | ||||
| } | } | ||||
| /* 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 workspace mode */ | |||||
| Base *basact = CTX_data_active_base(C); | |||||
| ED_object_base_activate(C, basact); | |||||
| } | |||||
| } | |||||
| WM_event_add_notifier(C, NC_WINDOW, NULL); | WM_event_add_notifier(C, NC_WINDOW, NULL); | ||||
| WM_event_add_notifier(C, NC_WM | ND_UNDO, NULL); | WM_event_add_notifier(C, NC_WM | ND_UNDO, NULL); | ||||
| if (win) { | if (win) { | ||||
| win->addmousemove = true; | win->addmousemove = true; | ||||
| } | } | ||||
| Context not available. | |||||