Fix T102685: Grease Pencil brush cursors missing on file open

Brush cursors were missing when opening a file saved in sculpt/vertex-/
weightpaint mode.

Since we dont do a full modeswitch on file load in `ED_editors_init` for
grease pencil since rBde994d6b7b1c, we were missing the brush cursor
toggling [`ED_gpencil_toggle_brush_cursor`] normally done in
`ED_gpencil_setup_modes`.

This is now explicitly added for any greasepencil paintmode (in case
object is active).

Maniphest Tasks: T102685

Differential Revision: https://developer.blender.org/D16603
This commit is contained in:
Philipp Oeser 2022-11-24 14:04:16 +01:00
parent 9a537b63a5
commit cdc73cb840
Notes: blender-bot 2023-02-14 09:48:25 +01:00
Referenced by issue #88449: Blender LTS: Maintenance Task 2.93
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #102685, Grease Pencil: Brush cursors not shown if the file is opened with sculpt/vertex-/weightpaint mode
1 changed files with 4 additions and 0 deletions

View File

@ -46,6 +46,7 @@
#include "DEG_depsgraph.h"
#include "ED_armature.h"
#include "ED_gpencil.h"
#include "ED_image.h"
#include "ED_mesh.h"
#include "ED_object.h"
@ -117,6 +118,9 @@ void ED_editors_init(bContext *C)
ob->mode = OB_MODE_OBJECT;
DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
}
else if (mode & OB_MODE_ALL_PAINT_GPENCIL) {
ED_gpencil_toggle_brush_cursor(C, true, NULL);
}
continue;
}