diff options
author | Antonioya <blendergit@gmail.com> | 2018-08-28 09:16:30 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-08-28 09:18:09 +0300 |
commit | 9a9b1e98849131358041cf2bb83bf7b7c9828119 (patch) | |
tree | 290cba0b98a1c6937670d8f578c189039123700a /source/blender/editors/gpencil/gpencil_edit.c | |
parent | 039b11f3497731572e36904b03550438b706df34 (diff) |
GP: Revert replace custom function by standard API
Using custom api breaks material at object level
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 49202149d31..df786b4e675 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -768,7 +768,7 @@ GHash *gp_copybuf_validate_colormap(bContext *C) char *ma_name = BLI_ghashIterator_getValue(&gh_iter); Material *ma = BLI_ghash_lookup(name_to_ma, ma_name); - if (ma != NULL && BKE_object_material_slot_find_index(ob, ma) == 0) { + if (ma != NULL && BKE_gpencil_get_material_index(ob, ma) == 0) { BKE_object_material_slot_add(bmain, ob); assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF); } @@ -1022,8 +1022,8 @@ static int gp_strokes_paste_exec(bContext *C, wmOperator *op) /* Remap material */ Material *ma = BLI_ghash_lookup(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 { @@ -3239,7 +3239,7 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op) /* add duplicate materials */ ma = give_current_material(ob, gps->mat_nr + 1); - idx = BKE_object_material_slot_find_index(ob_dst, ma); + idx = BKE_gpencil_get_material_index(ob_dst, ma); if (idx == 0) { totadd++; |