[Bf-blender-cvs] [452d43b] blender-v2.78-release: Fix T49827L Crash linking material while in Material viewport shading mode

Sergey Sharybin noreply at git.blender.org
Mon Oct 24 12:34:41 CEST 2016


Commit: 452d43b1c8c53d1aee5373501fe62f02e3b3376d
Author: Sergey Sharybin
Date:   Mon Oct 24 10:09:13 2016 +0200
Branches: blender-v2.78-release
https://developer.blender.org/rB452d43b1c8c53d1aee5373501fe62f02e3b3376d

Fix T49827L Crash linking material while in Material viewport shading mode

Material linking might and does change the way how drawObject is calculated
but does not tag drawObject for recalculation in any way.

Now use dependency graph to tag draw object for reclaculation. Currently do
this using OB_RECALC_DATA taq since tagging is not very granular yet. In the
future we can introduce ore granular tagging in the new dependency graph
easily.

Simple and safe for 2.78a.

===================================================================

M	source/blender/editors/object/object_relations.c

===================================================================

diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 82c6a14..35d7b32 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1575,7 +1575,7 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
 							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 */
 						}
-						DAG_id_tag_update(&ob_dst->id, 0);
+						DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA);
 						break;
 					case MAKE_LINKS_ANIMDATA:
 						BKE_animdata_copy_id((ID *)ob_dst, (ID *)ob_src, false);




More information about the Bf-blender-cvs mailing list