diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-10-03 02:55:25 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-10-03 02:55:25 +0400 |
commit | 60e32f69b922df783ce2c273daf13b347862c6cb (patch) | |
tree | 00b514e953770063028d192b9820a721b6b44924 /source/blender/blenkernel | |
parent | 06c43148a19ad7e8cddf9ba51549b51bdb1f6f0c (diff) |
Fix for bug #17735: vertex color render layer got invalid value
when switching to weight paint mode.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index d4b17f97ad9..b7f068c936b 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2701,17 +2701,22 @@ static void mesh_build_data(Object *ob, CustomDataMask dataMask) if( (G.f & G_WEIGHTPAINT) && ob==obact ) { MCol *wpcol = (MCol*)calc_weightpaint_colors(ob); int layernum = CustomData_number_of_layers(&me->fdata, CD_MCOL); + int prevactive = CustomData_get_active_layer(&me->fdata, CD_MCOL); + int prevrender = CustomData_get_render_layer(&me->fdata, CD_MCOL); /* ugly hack here, we temporarily add a new active mcol layer with weightpaint colors in it, that is then duplicated in CDDM_from_mesh */ CustomData_add_layer(&me->fdata, CD_MCOL, CD_ASSIGN, wpcol, me->totface); CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum); + CustomData_set_layer_render(&me->fdata, CD_MCOL, layernum); mesh_calc_modifiers(ob, NULL, &ob->derivedDeform, &ob->derivedFinal, 0, 1, needMapping, dataMask, -1); CustomData_free_layer_active(&me->fdata, CD_MCOL, me->totface); + CustomData_set_layer_active(&me->fdata, CD_MCOL, prevactive); + CustomData_set_layer_render(&me->fdata, CD_MCOL, prevrender); } else { mesh_calc_modifiers(ob, NULL, &ob->derivedDeform, &ob->derivedFinal, G.rendering, 1, |