[Bf-blender-cvs] [b0cb6135c2a] greasepencil-object: Remove use of Global Main

Antonio Vazquez noreply at git.blender.org
Tue Jan 2 10:22:49 CET 2018


Commit: b0cb6135c2a4ac27c67030e6b91ca1836d1ec256
Author: Antonio Vazquez
Date:   Tue Jan 2 10:17:45 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBb0cb6135c2a4ac27c67030e6b91ca1836d1ec256

Remove use of Global Main

===================================================================

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 5d08e2bbe76..5e382be533e 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -42,7 +42,6 @@
 #include "DNA_gpencil_types.h"
 #include "DNA_windowmanager_types.h"
 
-#include "BKE_global.h" 
 #include "BKE_main.h" 
 #include "BKE_image.h" 
 #include "BKE_gpencil.h"
@@ -715,6 +714,7 @@ static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *op)
 /* end operator */
 static void gpencil_fill_exit(bContext *C, wmOperator *op)
 {
+	Main *bmain = CTX_data_main(C);
 	Object *ob = CTX_data_active_object(C);
 
 	/* clear undo stack */
@@ -738,9 +738,9 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op)
 
 		/* delete temp image */
 		if (tgpf->ima) {
-			for (Image *ima = G.main->image.first; ima; ima = ima->id.next) {
+			for (Image *ima = bmain->image.first; ima; ima = ima->id.next) {
 				if (ima == tgpf->ima) {
-					BLI_remlink(&G.main->image, ima);
+					BLI_remlink(&bmain->image, ima);
 					BKE_image_free(tgpf->ima);
 					MEM_SAFE_FREE(tgpf->ima);
 					break;



More information about the Bf-blender-cvs mailing list