[Bf-blender-cvs] [5edc1d475dc] greasepencil-object: Fix parameter list for some functions after merge
Antonio Vazquez
noreply at git.blender.org
Tue May 29 17:59:53 CEST 2018
Commit: 5edc1d475dc123b1263580b3fd9722947d23b0f4
Author: Antonio Vazquez
Date: Tue May 29 17:59:45 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB5edc1d475dc123b1263580b3fd9722947d23b0f4
Fix parameter list for some functions after merge
===================================================================
M source/blender/blenkernel/intern/gpencil.c
M source/blender/editors/gpencil/gpencil_add_monkey.c
M source/blender/editors/gpencil/gpencil_data.c
M source/blender/editors/gpencil/gpencil_edit.c
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/modifiers/intern/MOD_gpencilcolor.c
M source/blender/modifiers/intern/MOD_gpenciltint.c
===================================================================
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index c02b0d2bcfc..1c2d78bbea4 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1066,10 +1066,10 @@ Material *BKE_gpencil_material_ensure(Main *bmain, Object *ob)
ma = give_current_material(ob, ob->actcol);
if (ma == NULL) {
if (ob->totcol == 0) {
- BKE_object_material_slot_add(ob);
+ BKE_object_material_slot_add(bmain, ob);
}
ma = BKE_material_add_gpencil(bmain, DATA_("Material"));
- assign_material(ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
+ assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
}
else if (ma->gp_style == NULL) {
BKE_material_init_gpencil_settings(ma);
diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c
index d2ff8d65d9c..2fb6253f67c 100644
--- a/source/blender/editors/gpencil/gpencil_add_monkey.c
+++ b/source/blender/editors/gpencil/gpencil_add_monkey.c
@@ -66,9 +66,9 @@ static int gpencil_monkey_color(Main *bmain, Object *ob, const ColorTemplate *pc
}
/* create a new one */
- BKE_object_material_slot_add(ob);
+ BKE_object_material_slot_add(bmain, ob);
ma = BKE_material_add_gpencil(bmain, pct->name);
- assign_material(ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
+ assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
copy_v4_v4(ma->gp_style->stroke_rgba, pct->line);
copy_v4_v4(ma->gp_style->fill_rgba, pct->fill);
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 4a1d73fc240..2d0824a73d3 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1841,8 +1841,8 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
for (short i = 0; i < *totcol; i++) {
Material *tmp_ma = (*matar)[i];
if (BKE_object_material_slot_find_index(ob_dst, tmp_ma) == 0) {
- BKE_object_material_slot_add(ob_dst);
- assign_material(ob_dst, tmp_ma, ob_dst->totcol, BKE_MAT_ASSIGN_EXISTING);
+ BKE_object_material_slot_add(bmain, ob_dst);
+ assign_material(bmain, ob_dst, tmp_ma, ob_dst->totcol, BKE_MAT_ASSIGN_EXISTING);
}
}
@@ -2428,9 +2428,9 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *UNUSED(op))
for (bGPDpalettecolor *palcolor = palette->colors.first; palcolor; palcolor = palcolor->next) {
/* create material slot */
- BKE_object_material_slot_add(ob);
+ BKE_object_material_slot_add(bmain, ob);
Material *ma = BKE_material_add_gpencil(bmain, palcolor->info);
- assign_material(ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
+ assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
/* copy color settings */
MaterialGPencilStyle *gp_style = ma->gp_style;
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 43219ba0b71..f1e3404b1bd 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -747,6 +747,7 @@ void ED_gpencil_strokes_copybuf_free(void)
*/
GHash *gp_copybuf_validate_colormap(bContext *C)
{
+ Main *bmain = CTX_data_main(C);
Object *ob = CTX_data_active_object(C);
GHash *new_colors = BLI_ghash_str_new("GPencil Paste Dst Colors");
GHashIterator gh_iter;
@@ -758,8 +759,8 @@ GHash *gp_copybuf_validate_colormap(bContext *C)
Material *ma = BLI_ghashIterator_getValue(&gh_iter);
if (BKE_object_material_slot_find_index(ob, ma) == 0) {
- BKE_object_material_slot_add(ob);
- assign_material(ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
+ BKE_object_material_slot_add(bmain, ob);
+ assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
}
/* Store this mapping (for use later when pasting) */
@@ -3162,10 +3163,10 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op)
ob_dst->totcol = totadd;
if (totadd > totslots) {
- BKE_object_material_slot_add(ob_dst);
+ BKE_object_material_slot_add(bmain, ob_dst);
}
- assign_material(ob_dst, ma, ob_dst->totcol, BKE_MAT_ASSIGN_EXISTING);
+ assign_material(bmain, ob_dst, ma, ob_dst->totcol, BKE_MAT_ASSIGN_EXISTING);
idx = totadd;
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 3e41e4de8ec..ca88ca7fc37 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1611,8 +1611,8 @@ static void gp_init_colors(tGPsdata *p)
/* check if the material is already on object material slots and add it if missing */
if (BKE_object_material_slot_find_index(p->ob, p->material) == 0) {
- BKE_object_material_slot_add(p->ob);
- assign_material(p->ob, ma, p->ob->totcol, BKE_MAT_ASSIGN_EXISTING);
+ BKE_object_material_slot_add(p->bmain, p->ob);
+ assign_material(p->bmain, p->ob, ma, p->ob->totcol, BKE_MAT_ASSIGN_EXISTING);
}
/* assign color information to temp tGPsdata */
diff --git a/source/blender/modifiers/intern/MOD_gpencilcolor.c b/source/blender/modifiers/intern/MOD_gpencilcolor.c
index e1934fd408f..0a94dc707ae 100644
--- a/source/blender/modifiers/intern/MOD_gpencilcolor.c
+++ b/source/blender/modifiers/intern/MOD_gpencilcolor.c
@@ -123,9 +123,9 @@ static void gp_bakeModifier(
if (mmd->flag & GP_TINT_CREATE_COLORS) {
Material *newmat = BLI_ghash_lookup(gh_color, mat->id.name);
if (newmat == NULL) {
- BKE_object_material_slot_add(ob);
+ BKE_object_material_slot_add(bmain, ob);
newmat = BKE_material_copy(bmain, mat);
- assign_material(ob, newmat, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
+ assign_material(bmain, ob, newmat, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
copy_v4_v4(newmat->gp_style->stroke_rgba, gps->runtime.tmp_stroke_rgba);
copy_v4_v4(newmat->gp_style->fill_rgba, gps->runtime.tmp_fill_rgba);
diff --git a/source/blender/modifiers/intern/MOD_gpenciltint.c b/source/blender/modifiers/intern/MOD_gpenciltint.c
index fe351a27977..06138f4b023 100644
--- a/source/blender/modifiers/intern/MOD_gpenciltint.c
+++ b/source/blender/modifiers/intern/MOD_gpenciltint.c
@@ -130,9 +130,9 @@ static void gp_bakeModifier(
if (mmd->flag & GP_TINT_CREATE_COLORS) {
Material *newmat = (Material *)BLI_ghash_lookup(gh_color, mat->id.name);
if (newmat == NULL) {
- BKE_object_material_slot_add(ob);
+ BKE_object_material_slot_add(bmain, ob);
newmat = BKE_material_copy(bmain, mat);
- assign_material(ob, newmat, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
+ assign_material(bmain, ob, newmat, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
copy_v4_v4(newmat->gp_style->stroke_rgba, gps->runtime.tmp_stroke_rgba);
copy_v4_v4(newmat->gp_style->fill_rgba, gps->runtime.tmp_fill_rgba);
More information about the Bf-blender-cvs
mailing list