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_data.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_data.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 954d012fd24..8533dbbba4c 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_gpencil_get_material_index(ob, ma) - 1;
+ int idx = BKE_object_material_slot_find_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_gpencil_get_material_index(ob_dst, tmp_ma) == 0) {
+ if (BKE_object_material_slot_find_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_gpencil_get_material_index(ob_dst, ma_src);
+ idx = BKE_object_material_slot_find_index(ob_dst, ma_src);
if (idx > 0) {
gps->mat_nr = idx - 1;
}