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_global.h" | #include "BKE_global.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 "ED_armature.h" | #include "ED_armature.h" | ||||
| #include "ED_particle.h" | #include "ED_particle.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); | |||||
| } | |||||
| } | |||||
| 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)) { | |||||
| /* set cursor */ | |||||
| if (obact->mode == OB_MODE_GPENCIL_PAINT) { | |||||
| ED_gpencil_toggle_brush_cursor(C, true); | |||||
| } | |||||
| else if (obact->mode == OB_MODE_GPENCIL_SCULPT) { | |||||
| ED_gpencil_toggle_brush_cursor(C, true); | |||||
| } | |||||
| else if (obact->mode == OB_MODE_GPENCIL_WEIGHT) { | |||||
| ED_gpencil_toggle_brush_cursor(C, true); | |||||
| } | |||||
| else { | |||||
| ED_gpencil_toggle_brush_cursor(C, false); | |||||
| } | |||||
| /* set workspace mode */ | |||||
| BKE_workspace_object_mode_set(CTX_wm_workspace(C), obact->mode); | |||||
| } | |||||
| } | |||||
| 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. | |||||