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/blenkernel/BKE_gpencil.h | |
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/blenkernel/BKE_gpencil.h')
-rw-r--r-- | source/blender/blenkernel/BKE_gpencil.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h index e94ba27a8ea..a22d30a01fa 100644 --- a/source/blender/blenkernel/BKE_gpencil.h +++ b/source/blender/blenkernel/BKE_gpencil.h @@ -86,7 +86,6 @@ void BKE_gpencil_frame_delete_laststroke(struct bGPDlayer *gpl, struct bGPDframe /* materials */ void BKE_gpencil_material_index_remove(struct bGPdata *gpd, int index); void BKE_gpencil_material_remap(struct bGPdata *gpd, const unsigned int *remap, unsigned int remap_len); -int BKE_gpencil_get_material_index(struct Object *ob, struct Material *ma); /* statistics functions */ void BKE_gpencil_stats_update(struct bGPdata *gpd); @@ -131,23 +130,29 @@ struct bGPDlayer *BKE_gpencil_layer_getactive(struct bGPdata *gpd); void BKE_gpencil_layer_setactive(struct bGPdata *gpd, struct bGPDlayer *active); void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl); -struct Material *BKE_gpencil_get_material_from_brush(struct Brush *brush); -void BKE_gpencil_brush_set_material(struct Brush *brush, struct Material *material); +/* Brush */ +struct Material *BKE_gpencil_brush_material_get(struct Brush *brush); +void BKE_gpencil_brush_material_set(struct Brush *brush, struct Material *material); -struct Material *BKE_gpencil_handle_brush_material(struct Main *bmain, struct Object *ob, struct Brush *brush); -int BKE_gpencil_handle_material(struct Main *bmain, struct Object *ob, struct Material *material); +/* Object */ +struct Material *BKE_gpencil_object_material_ensure_active(struct Main *bmain, struct Object *ob); +struct Material *BKE_gpencil_object_material_ensure_from_brush(struct Main *bmain, struct Object *ob, struct Brush *brush); +int BKE_gpencil_object_material_ensure(struct Main *bmain, struct Object *ob, struct Material *material); -struct Material *BKE_gpencil_handle_new_material(struct Main *bmain, struct Object *ob, const char *name, int *r_index); +struct Material *BKE_gpencil_object_material_new(struct Main *bmain, struct Object *ob, const char *name, int *r_index); -struct Material *BKE_gpencil_get_material_for_brush(struct Object *ob, struct Brush *brush); -int BKE_gpencil_get_material_index_for_brush(struct Object *ob, struct Brush *brush); +int BKE_gpencil_object_material_get_index(struct Object *ob, struct Material *ma); -struct Material *BKE_gpencil_current_input_toolsettings_material(struct Main *bmain, struct Object *ob, struct ToolSettings *ts); -struct Material *BKE_gpencil_current_input_brush_material(struct Main *bmain, struct Object *ob, struct Brush *brush); -struct Material *BKE_gpencil_current_input_material(struct Main *bmain, struct Object *ob); +struct Material *BKE_gpencil_object_material_get_from_brush(struct Object *ob, struct Brush *brush); +int BKE_gpencil_object_material_get_index_from_brush(struct Object *ob, struct Brush *brush); +struct Material *BKE_gpencil_object_material_ensure_from_active_input_toolsettings( + struct Main *bmain, struct Object *ob, struct ToolSettings *ts); +struct Material *BKE_gpencil_object_material_ensure_from_active_input_brush( + struct Main *bmain, struct Object *ob, struct Brush *brush); +struct Material *BKE_gpencil_object_material_ensure_from_active_input_material( + struct Main *bmain, struct Object *ob); -struct Material *BKE_gpencil_material_ensure(struct Main *bmain, struct Object *ob); /* object boundbox */ bool BKE_gpencil_data_minmax( |