Fix T58360 "Use object as pivot" in GP "Shadow effect" crashes Blender
authorAntonioya <blendergit@gmail.com>
Fri, 7 Dec 2018 19:01:01 +0000 (20:01 +0100)
committerAntonioya <blendergit@gmail.com>
Fri, 7 Dec 2018 19:01:01 +0000 (20:01 +0100)
source/blender/draw/engines/gpencil/gpencil_shader_fx.c
source/blender/shader_fx/intern/FX_shader_shadow.c

index fcadf29625306d8e91b4c7ad3e030f93e2cab607..673b47ff05226c52bc33fa66a1a138c8822baf77 100644 (file)
@@ -443,6 +443,9 @@ static void DRW_gpencil_fx_shadow(
        }
        ShadowShaderFxData *fxd = (ShadowShaderFxData *)fx;
        if ((!fxd->object) && (fxd->flag & FX_SHADOW_USE_OBJECT)) {
+               fxd->runtime.fx_sh = NULL;
+               fxd->runtime.fx_sh_b = NULL;
+               fxd->runtime.fx_sh_c = NULL;
                return;
        }
 
index e3a9543fcb4409148ed109b13f657beb0ff04926..ba1bd4fe907dea26d555c5436f1640ef944c0d14 100644 (file)
@@ -61,6 +61,8 @@ static void initData(ShaderFxData *md)
 
        ARRAY_SET_ITEMS(gpfx->blur, 5, 5);
        gpfx->samples = 2;
+
+       gpfx->object = NULL;
 }
 
 static void copyData(const ShaderFxData *md, ShaderFxData *target)