diff options
author | Antonioya <blendergit@gmail.com> | 2018-08-08 17:56:56 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-08-08 17:56:56 +0300 |
commit | 5c4fd526124c348c8f324a2d0a384958c6e793b8 (patch) | |
tree | 4147a301d31e79e16a584769e61a506721a0ca6f /source/blender/editors/gpencil/gpencil_brush.c | |
parent | 78a6fa1a7294d73a4f35b08d569d03f1afdd71ac (diff) |
Fix T56220: Adding Grease Object crashes if link Material is set to Object
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_brush.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_brush.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index ff93e7fc57d..d8be0dd665a 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -1053,8 +1053,8 @@ static void gp_brush_clone_add(bContext *C, tGP_BrushEditData *gso) /* Fix color references */ Material *ma = BLI_ghash_lookup(data->new_colors, &new_stroke->mat_nr); - if ((ma) && (BKE_object_material_slot_find_index(ob, ma) > 0)) { - gps->mat_nr = BKE_object_material_slot_find_index(ob, ma) - 1; + if ((ma) && (BKE_gpencil_get_material_index(ob, ma) > 0)) { + gps->mat_nr = BKE_gpencil_get_material_index(ob, ma) - 1; CLAMP_MIN(gps->mat_nr, 0); } else { |