[Bf-blender-cvs] [37b04f1aa5e] greasepencil-object: Fix error selecting camera

Antonio Vazquez noreply at git.blender.org
Thu Oct 12 17:11:09 CEST 2017


Commit: 37b04f1aa5e4662104c8ebd92d71462e41ce60b9
Author: Antonio Vazquez
Date:   Thu Oct 12 17:10:43 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB37b04f1aa5e4662104c8ebd92d71462e41ce60b9

Fix error selecting camera

The edit shgroup creation must check active object to verify if it's a OB_GPENCIL

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

M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 2ee24cd5b63..37e137740b7 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -608,6 +608,9 @@ static void gpencil_add_editpoints_shgroup(GPENCIL_StorageList *stl, GpencilBatc
 	{
 		const DRWContextState *draw_ctx = DRW_context_state_get();
 		Object *obact = draw_ctx->obact;
+		if (obact->type != OB_GPENCIL) {
+			return;
+		}
 		bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
 
 		/* line of the original stroke */



More information about the Bf-blender-cvs mailing list