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/render/render_shading.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/render/render_shading.c')
-rw-r--r-- | source/blender/editors/render/render_shading.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index e792de01e2c..a57d5c95440 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -100,12 +100,13 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) { + Main *bmain = CTX_data_main(C); Object *ob = ED_object_context(C); if (!ob) return OPERATOR_CANCELLED; - BKE_object_material_slot_add(ob); + BKE_object_material_slot_add(bmain, ob); if (ob->mode & OB_MODE_TEXTURE_PAINT) { Scene *scene = CTX_data_scene(C); @@ -148,7 +149,7 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - BKE_object_material_slot_remove(ob); + BKE_object_material_slot_remove(CTX_data_main(C), ob); if (ob->mode & OB_MODE_TEXTURE_PAINT) { Scene *scene = CTX_data_scene(C); @@ -348,6 +349,7 @@ void OBJECT_OT_material_slot_deselect(wmOperatorType *ot) static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op)) { + Main *bmain = CTX_data_main(C); Object *ob = ED_object_context(C); Material ***matar; @@ -358,7 +360,7 @@ static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op)) { if (ob != ob_iter && give_matarar(ob_iter)) { if (ob->data != ob_iter->data) - assign_matarar(ob_iter, matar, ob->totcol); + assign_matarar(bmain, ob_iter, matar, ob->totcol); if (ob_iter->totcol == ob->totcol) { ob_iter->actcol = ob->actcol; @@ -1494,7 +1496,7 @@ static int copy_material_exec(bContext *C, wmOperator *UNUSED(op)) if (ma == NULL) return OPERATOR_CANCELLED; - copy_matcopybuf(ma); + copy_matcopybuf(CTX_data_main(C), ma); return OPERATOR_FINISHED; } @@ -1520,7 +1522,7 @@ static int paste_material_exec(bContext *C, wmOperator *UNUSED(op)) if (ma == NULL) return OPERATOR_CANCELLED; - paste_matcopybuf(ma); + paste_matcopybuf(CTX_data_main(C), ma); WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma); |