From a0f3ea7da3f65333fbac9c2d528c4242c417860d Mon Sep 17 00:00:00 2001 From: Antonioya Date: Fri, 5 Jul 2019 23:11:53 +0200 Subject: Fix T62101: GPencil: selection order is wrong Following the advices of @Germano Cavalcante (mano-wii) , I have exposed as a workaround the free function to be called from draw manager for selection. Now, the free function is not called for selection inside gpencil draw_scene, but it's called from draw_manager.c. The real fix would be create a new Scene_finish callback in draw manager, but as the release of 2.80 is almost here, we fix this with a workaround that must be removed when new callback is in place. Differential Revision: http://developer.blender.org/D5193 --- source/blender/draw/intern/draw_manager.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/draw/intern/draw_manager.c') diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index bab38cf0a9f..2a241264988 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -88,6 +88,7 @@ #include "engines/basic/basic_engine.h" #include "engines/workbench/workbench_engine.h" #include "engines/external/external_engine.h" +#include "engines/gpencil/gpencil_engine.h" #include "GPU_context.h" @@ -2379,6 +2380,13 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph, } } + /* TODO: GPXX Workaround for grease pencil selection while draw manager support a callback from + * scene finish */ + void *data = GPU_viewport_engine_data_get(DST.viewport, &draw_engine_gpencil_type); + if (data != NULL) { + DRW_gpencil_free_runtime_data(data); + } + DRW_state_lock(0); DRW_draw_callbacks_post_scene(); -- cgit v1.2.3