[Bf-blender-cvs] [df88dbf] master: Fix T38161: Copy Material to Others causes incorrect viewport display if target object uses more materials

Bastien Montagne noreply at git.blender.org
Fri Jan 17 13:17:02 CET 2014


Commit: df88dbf955919c1178009781ee6462ff339818a6
Author: Bastien Montagne
Date:   Fri Jan 17 13:16:07 2014 +0100
https://developer.blender.org/rBdf88dbf955919c1178009781ee6462ff339818a6

Fix T38161: Copy Material to Others causes incorrect viewport display if target object uses more materials

We need to update object data, like when removing a mat slot, since some mat indices might have become invalid!

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

M	source/blender/editors/render/render_shading.c

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

diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 3ef1f0d..066195d 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -348,6 +348,7 @@ static int material_slot_copy_exec(bContext *C, wmOperator *UNUSED(op))
 			
 			if (ob_iter->totcol == ob->totcol) {
 				ob_iter->actcol = ob->actcol;
+				DAG_id_tag_update(&ob_iter->id, OB_RECALC_DATA);
 				WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob_iter);
 			}
 		}




More information about the Bf-blender-cvs mailing list