From d5d3dc418912863b172ef9f79f9991bb9d46bea8 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 30 Aug 2019 14:19:07 +0200 Subject: GPencil: Use default material when slot material is empty When a material slot is empty, the default material is used. The default color used is Gray to get a good contrast in dense scenes with dark and white background. Reviewers: brecht, dfelinto, mendio, pepeland Differential Revision: https://developer.blender.org/D5625 --- source/blender/blenkernel/BKE_material.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/BKE_material.h') diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 44a8f98e994..7ff9c4e6376 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -38,6 +38,7 @@ struct bNode; /* materials */ void init_def_material(void); +void BKE_material_gpencil_default_free(void); void BKE_material_free(struct Material *ma); void test_object_materials(struct Main *bmain, struct Object *ob, struct ID *id); void test_all_objects_materials(struct Main *bmain, struct ID *id); @@ -46,6 +47,7 @@ void BKE_material_resize_object(struct Main *bmain, const short totcol, bool do_id_user); void BKE_material_init(struct Material *ma); +void BKE_material_gpencil_init(struct Material *ma); void BKE_material_remap_object(struct Object *ob, const unsigned int *remap); void BKE_material_remap_object_calc(struct Object *ob_dst, struct Object *ob_src, @@ -92,6 +94,7 @@ bool BKE_object_material_slot_add(struct Main *bmain, struct Object *ob); bool BKE_object_material_slot_remove(struct Main *bmain, struct Object *ob); bool BKE_object_material_slot_used(struct ID *id, short actcol); +struct Material *BKE_material_gpencil_get(struct Object *ob, short act); struct MaterialGPencilStyle *BKE_material_gpencil_settings_get(struct Object *ob, short act); void BKE_texpaint_slot_refresh_cache(struct Scene *scene, struct Material *ma); @@ -123,6 +126,7 @@ struct Depsgraph; void BKE_material_eval(struct Depsgraph *depsgraph, struct Material *material); extern struct Material defmaterial; +extern struct Material defgpencil_material; #ifdef __cplusplus } -- cgit v1.2.3