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:
authorAntony Riakiotakis <kalast@gmail.com>2015-08-20 10:35:14 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-08-20 10:35:14 +0300
commit67e32b31951b8b570148bd8b456afac27bb9645a (patch)
treee96eb901b4ab6866c7a7909eae513ea4dc888200 /source/blender/blenkernel/intern/mesh_validate.c
parente9f432f73c164f1698381111255523ae99879b5f (diff)
Fix T45514 crash entering texpaint mode.
In the file of the report, stencil and clone indices have fallen out of synch with the uv/mtexpoly layers. Looks like the file has a long history, coming from 2.49 even. Unfortunately reporter cannot recall exact steps to reproduce, so "fix" is to patch mesh.validate to fix those indices.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_validate.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 418c2911b5b..e21dde9c726 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -980,6 +980,24 @@ bool BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata,
MAX_MCOL, tot_vcolloop - MAX_MCOL);
}
+ /* check indices of clone/stencil */
+ if (do_fixes && CustomData_get_clone_layer(pdata, CD_MTEXPOLY) >= tot_texpoly) {
+ CustomData_set_layer_clone(pdata, CD_MTEXPOLY, 0);
+ is_change_p = true;
+ }
+ if (do_fixes && CustomData_get_clone_layer(ldata, CD_MLOOPUV) >= tot_uvloop) {
+ CustomData_set_layer_clone(ldata, CD_MLOOPUV, 0);
+ is_change_l = true;
+ }
+ if (do_fixes && CustomData_get_stencil_layer(pdata, CD_MTEXPOLY) >= tot_texpoly) {
+ CustomData_set_layer_stencil(pdata, CD_MTEXPOLY, 0);
+ is_change_p = true;
+ }
+ if (do_fixes && CustomData_get_stencil_layer(ldata, CD_MLOOPUV) >= tot_uvloop) {
+ CustomData_set_layer_stencil(ldata, CD_MLOOPUV, 0);
+ is_change_l = true;
+ }
+
*r_change = (is_change_v || is_change_e || is_change_l || is_change_p);
return is_valid;