diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 263bf4e57e2..6981d70019a 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1101,25 +1101,23 @@ Material *BKE_gpencil_current_input_toolsettings_material(Main *bmain, Object *o /* Guaranteed to return a material assigned to object. Returns never NULL. */ Material *BKE_gpencil_current_input_brush_material(Main *bmain, Object *ob, Brush *brush) { - Material *ma; if (brush) { - ma = BKE_gpencil_handle_brush_material(bmain, ob, brush); - if (!ma && brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED) { + Material *ma = BKE_gpencil_handle_brush_material(bmain, ob, brush); + if (ma) { + return ma; + } + else if (brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED) { /* it is easier to just unpin a NULL material, instead of setting a new one */ brush->gpencil_settings->flag &= ~GP_BRUSH_MATERIAL_PINNED; } } - if (ma) { - return ma; - } return BKE_gpencil_current_input_material(bmain, ob); } /* Guaranteed to return a material assigned to object. Returns never NULL. Only use this for materials unrelated to user input */ Material *BKE_gpencil_current_input_material(Main *bmain, Object *ob) { - Material *ma; - ma = give_current_material(ob, ob->actcol); + Material *ma = give_current_material(ob, ob->actcol); if (ma) { return ma; } |