Replace wrong aasign material flag to BKE_MAT_ASSIGN_USERPREF
This commit is contained in:
parent
fe8dcffd79
commit
7288d4d8c4
|
@ -1073,7 +1073,7 @@ Material *BKE_gpencil_material_ensure(Main *bmain, Object *ob)
|
|||
BKE_object_material_slot_add(bmain, ob);
|
||||
}
|
||||
ma = BKE_material_add_gpencil(bmain, DATA_("Material"));
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
}
|
||||
else if (ma->gp_style == NULL) {
|
||||
BKE_material_init_gpencil_settings(ma);
|
||||
|
|
|
@ -68,7 +68,7 @@ static int gpencil_monkey_color(Main *bmain, Object *ob, const ColorTemplate *pc
|
|||
/* create a new one */
|
||||
BKE_object_material_slot_add(bmain, ob);
|
||||
ma = BKE_material_add_gpencil(bmain, pct->name);
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
|
||||
copy_v4_v4(ma->gp_style->stroke_rgba, pct->line);
|
||||
copy_v4_v4(ma->gp_style->fill_rgba, pct->fill);
|
||||
|
|
|
@ -1903,7 +1903,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
|
|||
Material *tmp_ma = (*matar)[i];
|
||||
if (BKE_object_material_slot_find_index(ob_dst, tmp_ma) == 0) {
|
||||
BKE_object_material_slot_add(bmain, ob_dst);
|
||||
assign_material(bmain, ob_dst, tmp_ma, ob_dst->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob_dst, tmp_ma, ob_dst->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -734,7 +734,7 @@ GHash *gp_copybuf_validate_colormap(bContext *C)
|
|||
|
||||
if (BKE_object_material_slot_find_index(ob, ma) == 0) {
|
||||
BKE_object_material_slot_add(bmain, ob);
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
}
|
||||
|
||||
/* Store this mapping (for use later when pasting) */
|
||||
|
@ -3195,7 +3195,7 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op)
|
|||
BKE_object_material_slot_add(bmain, ob_dst);
|
||||
}
|
||||
|
||||
assign_material(bmain, ob_dst, ma, ob_dst->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob_dst, ma, ob_dst->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
idx = totadd;
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *UNUSED(op))
|
|||
/* create material slot */
|
||||
BKE_object_material_slot_add(bmain, ob);
|
||||
Material *ma = BKE_material_add_gpencil(bmain, palcolor->info);
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
|
||||
/* copy color settings */
|
||||
MaterialGPencilStyle *gp_style = ma->gp_style;
|
||||
|
|
|
@ -1604,7 +1604,7 @@ 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->bmain, p->ob);
|
||||
assign_material(p->bmain, p->ob, ma, p->ob->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(p->bmain, p->ob, ma, p->ob->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
}
|
||||
|
||||
/* assign color information to temp tGPsdata */
|
||||
|
|
|
@ -126,7 +126,7 @@ static void bakeModifier(
|
|||
if (newmat == NULL) {
|
||||
BKE_object_material_slot_add(bmain, ob);
|
||||
newmat = BKE_material_copy(bmain, mat);
|
||||
assign_material(bmain, ob, newmat, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob, newmat, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
|
||||
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);
|
||||
|
|
|
@ -134,7 +134,7 @@ static void bakeModifier(
|
|||
if (newmat == NULL) {
|
||||
BKE_object_material_slot_add(bmain, ob);
|
||||
newmat = BKE_material_copy(bmain, mat);
|
||||
assign_material(bmain, ob, newmat, ob->totcol, BKE_MAT_ASSIGN_EXISTING);
|
||||
assign_material(bmain, ob, newmat, ob->totcol, BKE_MAT_ASSIGN_USERPREF);
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue