Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-29 16:49:21 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-29 16:49:21 +0300
commitf7af08b5feecd89ea32c8905de1e61d575ff4bf1 (patch)
treeb23f8e58157285ce3c6287f664f66bfcba85a69d /source/blender/editors/object
parentc72a204001ae32ab082af66b373ce19b64e28e2d (diff)
Cleanup: Get rid of G.main in BKE_material.
Note that in some cases, this only moves the G.main case to somne other places - in particular, RNA getters/setters are becoming annoying here...
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_relations.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 4618d05133e..ee78dc83c26 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1570,7 +1570,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);
DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA);
break;
@@ -1578,7 +1578,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 */
}
DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA);
break;
@@ -1978,7 +1978,7 @@ static void single_mat_users(Main *bmain, Scene *scene, const int flag, const bo
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);
if (do_textures) {
for (b = 0; b < MAX_MTEX; b++) {
@@ -2494,7 +2494,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);
DAG_id_tag_update(&base->object->id, OB_RECALC_OB);