diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-29 16:59:18 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-29 17:02:53 +0300 |
commit | 8f670dd855b1d81fcf619b3b94ba4bfaf51e896d (patch) | |
tree | 681c0dabf0af6e17ead533d174fde08e55e9cd0f /source/blender/editors/sculpt_paint/paint_image_proj.c | |
parent | 9d037153f70c9bcc665fffa4971d1517044dbf29 (diff) | |
parent | f7af08b5feecd89ea32c8905de1e61d575ff4bf1 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/intern/library_remap.c
source/blender/blenkernel/intern/material.c
source/blender/editors/object/object_relations.c
source/blender/editors/render/render_preview.c
source/blender/makesrna/intern/rna_object.c
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index dab75df8d13..45ee1ebac11 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -5724,14 +5724,15 @@ static int texture_paint_add_texture_paint_slot_exec(bContext *C, wmOperator *op static int texture_paint_add_texture_paint_slot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { char imagename[MAX_ID_NAME - 2]; + Main *bmain = CTX_data_main(C); Object *ob = CTX_data_active_object(C); Material *ma = give_current_material(ob, ob->actcol); int type = RNA_enum_get(op->ptr, "type"); if (!ma) { - ma = BKE_material_add(CTX_data_main(C), "Material"); + ma = BKE_material_add(bmain, "Material"); /* no material found, just assign to first slot */ - assign_material(ob, ma, ob->actcol, BKE_MAT_ASSIGN_USERPREF); + assign_material(bmain, ob, ma, ob->actcol, BKE_MAT_ASSIGN_USERPREF); } type = RNA_enum_from_value(layer_type_items, type); |