Commit: 287703cc4fb59f02e033a911ecab967877d79177 Author: Antonio Vazquez Date: Fri May 11 16:59:13 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB287703cc4fb59f02e033a911ecab967877d79177
Rename functions to use "material" instead of "color" =================================================================== M source/blender/blenkernel/BKE_gpencil.h M source/blender/blenkernel/intern/gpencil.c M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c M source/blender/editors/gpencil/gpencil_fill.c M source/blender/editors/gpencil/gpencil_paint.c M source/blender/editors/gpencil/gpencil_primitive.c M source/blender/editors/gpencil/gpencil_utils.c M source/blender/editors/space_view3d/view3d_manipulator_ruler.c M source/blender/editors/space_view3d/view3d_ruler.c =================================================================== diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h index cec03046c02..77f8a3a1702 100644 --- a/source/blender/blenkernel/BKE_gpencil.h +++ b/source/blender/blenkernel/BKE_gpencil.h @@ -131,8 +131,8 @@ 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_color_from_brush(struct Brush *brush); -struct Material *BKE_gpencil_color_ensure(struct Main *bmain, struct Object *ob); +struct Material *BKE_gpencil_get_material_from_brush(struct Brush *brush); +struct Material *BKE_gpencil_material_ensure(struct Main *bmain, struct Object *ob); /* Palettes - Deprecated (2.78-2.79) Only to convert old files */ void BKE_gpencil_free_palettes(struct ListBase *list); diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 290ed877a29..bc77f0eb3d9 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1015,7 +1015,7 @@ void BKE_gpencil_layer_delete(bGPdata *gpd, bGPDlayer *gpl) BLI_freelinkN(&gpd->layers, gpl); } -Material *BKE_gpencil_get_color_from_brush(Brush *brush) +Material *BKE_gpencil_get_material_from_brush(Brush *brush) { Material *ma = NULL; @@ -1027,7 +1027,7 @@ Material *BKE_gpencil_get_color_from_brush(Brush *brush) } /* Get active color, and add all default settings if we don't find anything */ -Material *BKE_gpencil_color_ensure(Main *bmain, Object *ob) +Material *BKE_gpencil_material_ensure(Main *bmain, Object *ob) { Material *ma = NULL; diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c index af2c8f955a4..fab150887af 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -635,7 +635,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T float obscale = (ob->size[0] + ob->size[1] + ob->size[2]) / 3.0f; /* use the brush material */ - Material *ma = BKE_gpencil_get_color_from_brush(brush); + Material *ma = BKE_gpencil_get_material_from_brush(brush); if (ma != NULL) { gp_style = ma->gp_style; } diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index e911e1be7f3..7c69cb32b11 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -990,10 +990,10 @@ static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *UNUSED(op)) tgpf->fill_draw_mode = brush->gp_fill_draw_mode; /* get color info */ - Material *ma = BKE_gpencil_get_color_from_brush(brush); + Material *ma = BKE_gpencil_get_material_from_brush(brush); /* if no brush defaults, get material and color info */ if ((ma == NULL) || (ma->gp_style == NULL)) { - ma = BKE_gpencil_color_ensure(bmain, tgpf->ob); + ma = BKE_gpencil_material_ensure(bmain, tgpf->ob); /* assign always the first material to the brush */ brush->material = give_current_material(tgpf->ob, 1); } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index ef096a9a9f0..30e31708688 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1564,13 +1564,13 @@ static void gp_init_colors(tGPsdata *p) MaterialGPencilStyle *gp_style = NULL; /* use brush material */ - ma = BKE_gpencil_get_color_from_brush(brush); + ma = BKE_gpencil_get_material_from_brush(brush); /* if no brush defaults, get material and color info * NOTE: Ensures that everything we need will exist... */ if ((ma == NULL) || (ma->gp_style == NULL)) { - BKE_gpencil_color_ensure(p->bmain, p->ob); + BKE_gpencil_material_ensure(p->bmain, p->ob); /* assign always the first material to the brush */ p->material = give_current_material(p->ob, 1); diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index f95cd4ab603..5c3819b8e99 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -447,7 +447,7 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op) tgpi->gpd = gpd; /* getcolor info */ - tgpi->mat = BKE_gpencil_color_ensure(bmain, tgpi->ob); + tgpi->mat = BKE_gpencil_material_ensure(bmain, tgpi->ob); /* set parameters */ tgpi->type = RNA_enum_get(op->ptr, "type"); diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 67f0b0923d5..e16bdd54063 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1161,7 +1161,7 @@ void ED_gpencil_add_defaults(bContext *C) } /* ensure color exist */ - BKE_gpencil_color_ensure(bmain, ob); + BKE_gpencil_material_ensure(bmain, ob); Paint *paint = BKE_brush_get_gpencil_paint(ts); /* if not exist, create a new one */ @@ -1425,9 +1425,9 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata) } /* get current drawing color */ - ma = BKE_gpencil_get_color_from_brush(paintbrush); + ma = BKE_gpencil_get_material_from_brush(paintbrush); if (ma == NULL) { - BKE_gpencil_color_ensure(bmain, ob); + BKE_gpencil_material_ensure(bmain, ob); /* assign the first material to the brush */ ma = give_current_material(ob, 1); paintbrush->material = ma; diff --git a/source/blender/editors/space_view3d/view3d_manipulator_ruler.c b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c index cc7bdc05baa..1c3e948aac9 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_ruler.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c @@ -403,7 +403,7 @@ static bool view3d_ruler_to_gpencil(bContext *C, wmManipulatorGroup *mgroup) } /* try to get active color or create a new one */ - Material *mat = BKE_gpencil_color_ensure(bmain, ob); + Material *mat = BKE_gpencil_material_ensure(bmain, ob); gpf = BKE_gpencil_layer_getframe(gpl, CFRA, true); BKE_gpencil_free_strokes(gpf); diff --git a/source/blender/editors/space_view3d/view3d_ruler.c b/source/blender/editors/space_view3d/view3d_ruler.c index 715650cd024..0dea0ca0994 100644 --- a/source/blender/editors/space_view3d/view3d_ruler.c +++ b/source/blender/editors/space_view3d/view3d_ruler.c @@ -322,7 +322,7 @@ static bool view3d_ruler_to_gpencil(bContext *C, RulerInfo *ruler_info) } /* try to get active color or create a new one */ - Material *mat = BKE_gpencil_color_ensure(bmain, ob); + Material *mat = BKE_gpencil_material_ensure(bmain, ob); gpf = BKE_gpencil_layer_getframe(gpl, CFRA, true); BKE_gpencil_free_strokes(gpf); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs