[Bf-blender-cvs] [5f8ee2a36b6] greasepencil-object: GPencil: Fix renamed functions after merge
Antonio Vazquez
noreply at git.blender.org
Wed Feb 5 16:00:00 CET 2020
Commit: 5f8ee2a36b6004b6f4866c51caeb63ebfafb3328
Author: Antonio Vazquez
Date: Wed Feb 5 11:39:55 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB5f8ee2a36b6004b6f4866c51caeb63ebfafb3328
GPencil: Fix renamed functions after merge
===================================================================
M source/blender/blenkernel/intern/brush.c
M source/blender/blenkernel/intern/gpencil.c
M source/blender/blenloader/intern/versioning_defaults.c
M source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M source/blender/editors/gpencil/gpencil_merge.c
M source/blender/editors/gpencil/gpencil_vertex_ops.c
===================================================================
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 0ca2dbe8784..2879905795b 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -320,7 +320,7 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
* drawn. */
Material *ma = BLI_findstring(&bmain->materials, "Dots Stroke", offsetof(ID, name) + 2);
if (ma == NULL) {
- ma = BKE_material_add_gpencil(bmain, "Dots Stroke");
+ ma = BKE_gpencil_material_add(bmain, "Dots Stroke");
}
brush->gpencil_settings->material = ma;
/* Pin the matterial to the brush. */
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 9ddba9384a6..c604502e87a 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -2379,21 +2379,21 @@ bool BKE_gpencil_merge_materials_table_get(Object *ob,
MaterialGPencilStyle *gp_style_primary = NULL;
MaterialGPencilStyle *gp_style_secondary = NULL;
- short *totcol = give_totcolp(ob);
+ short *totcol = BKE_object_material_num(ob);
if (totcol == 0) {
return changed;
}
for (int idx_primary = 0; idx_primary < *totcol; idx_primary++) {
/* Read primary material to compare. */
- ma_primary = BKE_material_gpencil_get(ob, idx_primary + 1);
+ ma_primary = BKE_gpencil_material(ob, idx_primary + 1);
if (ma_primary == NULL) {
continue;
}
for (int idx_secondary = idx_primary + 1; idx_secondary < *totcol; idx_secondary++) {
/* Read secondary material to compare with primary material. */
- ma_secondary = BKE_material_gpencil_get(ob, idx_secondary + 1);
+ ma_secondary = BKE_gpencil_material(ob, idx_secondary + 1);
if ((ma_secondary == NULL) ||
(BLI_ghash_haskey(r_mat_table, POINTER_FROM_INT(idx_secondary)))) {
continue;
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 4364aeba5cc..8dc71dd314e 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -612,14 +612,14 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
/* Dots Stroke. */
ma = BLI_findstring(&bmain->materials, "Dots Stroke", offsetof(ID, name) + 2);
if (ma == NULL) {
- ma = BKE_material_add_gpencil(bmain, "Dots Stroke");
+ ma = BKE_gpencil_material_add(bmain, "Dots Stroke");
}
ma->gp_style->mode = GP_STYLE_MODE_DOTS;
/* Boxes Stroke. */
ma = BLI_findstring(&bmain->materials, "Boxes Stroke", offsetof(ID, name) + 2);
if (ma == NULL) {
- ma = BKE_material_add_gpencil(bmain, "Boxes Stroke");
+ ma = BKE_gpencil_material_add(bmain, "Boxes Stroke");
}
ma->gp_style->mode = GP_STYLE_MODE_BOX;
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 826151b922f..f2fc77dccf6 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -928,7 +928,7 @@ static void gpencil_add_fill_vertexdata(GpencilBatchCache *cache,
const bool attenuate = (GPENCIL_VERTEX_MODE(gpd) &&
GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
if (gps->totpoints >= 3) {
float tfill[4];
/* set color using material, tint color and opacity */
@@ -1097,7 +1097,7 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
const bool hide_vertex_lines = (GPENCIL_VERTEX_MODE(gpd) && (use_vertex_mask) &&
((v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES) == 0));
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
/* alpha factor for edit points/line to make them more subtle */
float edit_alpha = v3d->vertex_opacity;
diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c
index 32886a58a0a..d085d791477 100644
--- a/source/blender/editors/gpencil/gpencil_merge.c
+++ b/source/blender/editors/gpencil/gpencil_merge.c
@@ -599,7 +599,7 @@ static int gp_stroke_merge_material_exec(bContext *C, wmOperator *op)
/* Review materials. */
GHash *mat_table = BLI_ghash_int_new(__func__);
- short *totcol = give_totcolp(ob);
+ short *totcol = BKE_object_material_num(ob);
if (totcol == 0) {
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/gpencil/gpencil_vertex_ops.c b/source/blender/editors/gpencil/gpencil_vertex_ops.c
index ab48ca49cd2..2226257f6a6 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_ops.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_ops.c
@@ -517,7 +517,7 @@ static bool gp_extract_palette_from_vertex(bContext *C, const bool selected, con
if (ED_gpencil_stroke_color_use(ob, gpl, gps) == false) {
continue;
}
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
if (gp_style == NULL) {
continue;
}
@@ -684,7 +684,7 @@ static int gp_material_to_vertex_exec(bContext *C, wmOperator *op)
bool changed = false;
- short *totcol = give_totcolp(ob);
+ short *totcol = BKE_object_material_num(ob);
if (totcol == 0) {
return OPERATOR_CANCELLED;
}
@@ -708,7 +708,7 @@ static int gp_material_to_vertex_exec(bContext *C, wmOperator *op)
continue;
}
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
if (gp_style == NULL) {
continue;
}
@@ -753,7 +753,7 @@ static int gp_material_to_vertex_exec(bContext *C, wmOperator *op)
/* If not found create a new material. */
if (!found) {
- ma = BKE_material_add_gpencil(bmain, name);
+ ma = BKE_gpencil_material_add(bmain, name);
if (use_stroke) {
ma->gp_style->flag |= GP_STYLE_STROKE_SHOW;
}
@@ -772,7 +772,7 @@ static int gp_material_to_vertex_exec(bContext *C, wmOperator *op)
ma->gp_style->fill_rgba[3] = gp_style->fill_rgba[3];
BKE_object_material_slot_add(bmain, ob);
- assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
+ BKE_object_material_assign(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
mat_elm->key = key;
mat_elm->ma = ma;
More information about the Bf-blender-cvs
mailing list