From 9a9b1e98849131358041cf2bb83bf7b7c9828119 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Tue, 28 Aug 2018 08:16:30 +0200 Subject: GP: Revert replace custom function by standard API Using custom api breaks material at object level --- source/blender/editors/gpencil/gpencil_data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/gpencil/gpencil_data.c') diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 14c5d35c78a..84706966c60 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -1373,7 +1373,7 @@ static int gp_stroke_change_color_exec(bContext *C, wmOperator *op) } } /* try to find slot */ - int idx = BKE_object_material_slot_find_index(ob, ma) - 1; + int idx = BKE_gpencil_get_material_index(ob, ma) - 1; if (idx <= 0) { return OPERATOR_CANCELLED; } @@ -2123,7 +2123,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op) for (short i = 0; i < *totcol; i++) { Material *tmp_ma = give_current_material(ob_src, i + 1); - if (BKE_object_material_slot_find_index(ob_dst, tmp_ma) == 0) { + if (BKE_gpencil_get_material_index(ob_dst, tmp_ma) == 0) { BKE_object_material_slot_add(bmain, ob_dst); assign_material(bmain, ob_dst, tmp_ma, ob_dst->totcol, BKE_MAT_ASSIGN_USERPREF); } @@ -2163,7 +2163,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op) /* reasign material. Look old material and try to find in dst */ ma_src = give_current_material(ob_src, gps->mat_nr + 1); if (ma_src != NULL) { - idx = BKE_object_material_slot_find_index(ob_dst, ma_src); + idx = BKE_gpencil_get_material_index(ob_dst, ma_src); if (idx > 0) { gps->mat_nr = idx - 1; } -- cgit v1.2.3