[Bf-blender-cvs] [682c18404c1] greasepencil-experimental: GP: Fill: Debug code to show image used to generate fills
Charlie Jolly
noreply at git.blender.org
Thu Jan 10 10:26:42 CET 2019
Commit: 682c18404c1dd5b79b1baa95545d688fd74db8bd
Author: Charlie Jolly
Date: Thu Jan 10 09:26:17 2019 +0000
Branches: greasepencil-experimental
https://developer.blender.org/rB682c18404c1dd5b79b1baa95545d688fd74db8bd
GP: Fill: Debug code to show image used to generate fills
===================================================================
M source/blender/editors/gpencil/gpencil_fill.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 554b94a35f9..f3d1c489796 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1100,12 +1100,35 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op)
/* delete temp image */
if (tgpf->ima) {
+ Image *image;
for (Image *ima = bmain->image.first; ima; ima = ima->id.next) {
if (ima == tgpf->ima) {
- BLI_remlink(&bmain->image, ima);
+ image = ima;
+ break;
+ }
+ }
+
+ if (image) {
+ bool debug = true;
+ if (debug) {
+ /* set active for debugging */
+ const bScreen *screen = WM_window_get_active_screen(tgpf->win);
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ if (sa->spacetype == SPACE_IMAGE) {
+ SpaceImage *sima = sa->spacedata.first;
+ if (sima) {
+ sima->image = image;
+ }
+ else {
+ debug = false;
+ }
+ }
+ }
+ }
+ if (debug == false) {
+ BLI_remlink(&bmain->image, image);
BKE_image_free(tgpf->ima);
MEM_SAFE_FREE(tgpf->ima);
- break;
}
}
}
More information about the Bf-blender-cvs
mailing list