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 | |
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')
5 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 510b3381b7e..3a67abdb9a0 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3624,7 +3624,7 @@ static Base *mesh_separate_tagged(Main *bmain, Scene *scene, ViewLayer *view_lay base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, USER_DUP_MESH); /* DAG_relations_tag_update(bmain); */ /* normally would call directly after but in this case delay recalc */ - assign_matarar(base_new->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */ + assign_matarar(bmain, base_new->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */ ED_object_base_select(base_new, BA_SELECT); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 6925daa4b6c..75ff3fc24e6 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1454,7 +1454,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) ob_dst->data = obdata_id; /* if amount of material indices changed: */ - test_object_materials(ob_dst, ob_dst->data); + test_object_materials(bmain, ob_dst, ob_dst->data); DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); break; @@ -1462,7 +1462,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op) /* new approach, using functions from kernel */ for (a = 0; a < ob_src->totcol; a++) { Material *ma = give_current_material(ob_src, a + 1); - assign_material(ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); /* also works with ma==NULL */ + assign_material(bmain, ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); /* also works with ma==NULL */ } DEG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); break; @@ -1875,7 +1875,7 @@ static void single_mat_users(Main *bmain, Scene *scene, ViewLayer *view_layer, c BKE_animdata_copy_id_action(&man->id, false); man->id.us = 0; - assign_material(ob, man, a, BKE_MAT_ASSIGN_USERPREF); + assign_material(bmain, ob, man, a, BKE_MAT_ASSIGN_USERPREF); } } } @@ -2513,7 +2513,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent if (base == NULL || ma == NULL) return OPERATOR_CANCELLED; - assign_material(base->object, ma, 1, BKE_MAT_ASSIGN_USERPREF); + assign_material(CTX_data_main(C), base->object, ma, 1, BKE_MAT_ASSIGN_USERPREF); DEG_id_tag_update(&base->object->id, OB_RECALC_OB); 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); 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); diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 9bd0c622d66..ca26c9be9f2 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -2201,6 +2201,7 @@ static int material_drop_invoke(bContext *C, wmOperator *op, const wmEvent *even { Material *ma = NULL; Object *ob = NULL; + Main *bmain = CTX_data_main(C); SpaceOops *soops = CTX_wm_space_outliner(C); ARegion *ar = CTX_wm_region(C); TreeElement *te = NULL; @@ -2223,7 +2224,7 @@ static int material_drop_invoke(bContext *C, wmOperator *op, const wmEvent *even return OPERATOR_CANCELLED; } - assign_material(ob, ma, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF); + assign_material(bmain, ob, ma, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF); WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C)); WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma); |