Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-08-28 00:16:02 +0300
committerAntonioya <blendergit@gmail.com>2018-08-28 00:16:02 +0300
commit9195b5b3b138a8c5c18196bd7b1f421574e46d02 (patch)
tree173b25827c15a3ba1a7cf7e2731ef0687ae5a526 /source/blender/editors/gpencil/gpencil_edit.c
parent35c1baef27b81959d2c16f9f5e935fc91fb02667 (diff)
GP: Replace custom function by standard API
Replace BKE_gpencil_get_material_index by BKE_object_material_slot_find_index
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c8
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 3d169dceb4c..17853182c18 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_gpencil_get_material_index(ob, ma) == 0) {
+ if (ma != NULL && BKE_object_material_slot_find_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_gpencil_get_material_index(ob, ma) > 0)) {
- gps->mat_nr = BKE_gpencil_get_material_index(ob, ma) - 1;
+ if ((ma) && (BKE_object_material_slot_find_index(ob, ma) > 0)) {
+ gps->mat_nr = BKE_object_material_slot_find_index(ob, ma) - 1;
CLAMP_MIN(gps->mat_nr, 0);
}
else {
@@ -3240,7 +3240,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_gpencil_get_material_index(ob_dst, ma);
+ idx = BKE_object_material_slot_find_index(ob_dst, ma);
if (idx == 0) {
totadd++;