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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-08-12 15:59:11 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-08-12 15:59:11 +0300
commit04c7d9d56674f97d14c393488439c93a343823b4 (patch)
tree839b68ed6d86400201790b31e602fe95a94ae37a /source/blender/editors/mesh
parent82268fa1009dadb526dd6dc2ebc81763aedb2c18 (diff)
Depsgraph: tag relations for update when aterial slots changes
New dependency graph puts materials to the graph in order to deal with animation assigned to them and things like that. This leads us to a requirement to update relations when slots changes. This fixes: T49075 Assignment of a keyframed material using the frame_change_pre handler doesn't update the keyframe using the new dependency graph
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 1a14fad8650..999d5b278ee 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -3080,7 +3080,7 @@ static void bm_mesh_hflag_flush_vert(BMesh *bm, const char hflag)
* \note This could be used for split-by-material for non mesh types.
* \note This could take material data from another object or args.
*/
-static void mesh_separate_material_assign_mat_nr(Object *ob, const short mat_nr)
+static void mesh_separate_material_assign_mat_nr(Main *bmain, Object *ob, const short mat_nr)
{
ID *obdata = ob->data;
@@ -3116,18 +3116,18 @@ static void mesh_separate_material_assign_mat_nr(Object *ob, const short mat_nr)
ma_obdata = NULL;
}
- BKE_material_clear_id(obdata, true);
- BKE_material_resize_object(ob, 1, true);
- BKE_material_resize_id(obdata, 1, true);
+ BKE_material_clear_id(bmain, obdata, true);
+ BKE_material_resize_object(bmain, ob, 1, true);
+ BKE_material_resize_id(bmain, obdata, 1, true);
ob->mat[0] = ma_ob;
ob->matbits[0] = matbit;
(*matarar)[0] = ma_obdata;
}
else {
- BKE_material_clear_id(obdata, true);
- BKE_material_resize_object(ob, 0, true);
- BKE_material_resize_id(obdata, 0, true);
+ BKE_material_clear_id(bmain, obdata, true);
+ BKE_material_resize_object(bmain, ob, 0, true);
+ BKE_material_resize_id(bmain, obdata, 0, true);
}
}
@@ -3162,7 +3162,7 @@ static bool mesh_separate_material(Main *bmain, Scene *scene, Base *base_old, BM
/* leave the current object with some materials */
if (tot == bm_old->totface) {
- mesh_separate_material_assign_mat_nr(base_old->object, mat_nr);
+ mesh_separate_material_assign_mat_nr(bmain, base_old->object, mat_nr);
/* since we're in editmode, must set faces here */
BM_ITER_MESH (f, &iter, bm_old, BM_FACES_OF_MESH) {
@@ -3174,7 +3174,7 @@ static bool mesh_separate_material(Main *bmain, Scene *scene, Base *base_old, BM
/* Move selection into a separate object */
base_new = mesh_separate_tagged(bmain, scene, base_old, bm_old);
if (base_new) {
- mesh_separate_material_assign_mat_nr(base_new->object, mat_nr);
+ mesh_separate_material_assign_mat_nr(bmain, base_new->object, mat_nr);
}
result |= (base_new != NULL);