diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-09 10:22:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-09 11:09:13 +0300 |
commit | f55026d46861a3cb0108ad3f7bab8ed0610f660d (patch) | |
tree | 5eef1d0cb4400250eec037f92b8e1147adad96eb /source/blender/editors/gpencil/gpencil_data.c | |
parent | eb9237eb20ccec08bce364db5f768b854a5bb440 (diff) |
Cleanup: BKE_gpencil naming
- The ambiguous term 'handle' was used where 'ensure'
is typically used (get or add when missing).
- Rename `current` to `active`, all `current` functions which were
also ensuring.
- Clarify what is being operated on, using `BKE_gpencil_object_*` for
objects, `BKE_gpencil_brush_*` for brushes.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_data.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index e3d57149d0f..710e8a9bc1c 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -521,7 +521,7 @@ static int gp_layer_duplicate_object_exec(bContext *C, wmOperator *op) * otherwise add the slot with the material */ Material *ma_src = give_current_material(ob_src, gps_src->mat_nr + 1); - int idx = BKE_gpencil_handle_material(bmain, ob_dst, ma_src); + int idx = BKE_gpencil_object_material_ensure(bmain, ob_dst, ma_src); /* reasign the stroke material to the right slot in destination object */ gps_dst->mat_nr = idx; @@ -1379,7 +1379,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); + int idx = BKE_gpencil_object_material_get_index(ob, ma); if (idx < 0) { return OPERATOR_CANCELLED; } @@ -2054,7 +2054,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); - BKE_gpencil_handle_material(bmain, ob_dst, tmp_ma); + BKE_gpencil_object_material_ensure(bmain, ob_dst, tmp_ma); } /* duplicate bGPDlayers */ @@ -2089,7 +2089,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); - gps->mat_nr = BKE_gpencil_handle_material(bmain, ob_dst, ma_src); + gps->mat_nr = BKE_gpencil_object_material_ensure(bmain, ob_dst, ma_src); bGPDspoint *pt; int i; |