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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-12-01 14:38:11 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-12-01 14:38:11 +0300
commit47ef301c76f8a5471c962a4453112a0a49a8f975 (patch)
treeb76ca46fc30960821d43b28ecd76709b43faab67 /source/blender/draw
parentb0ec08cfa1cbdc1a5f4dc083f31873e222e84391 (diff)
Texture Paint: fix face selection with subsurface.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 5ee91f52342..9902f241efd 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -3549,14 +3549,22 @@ static GPUVertBuf *mesh_create_tri_select_id(
}
}
else {
+ const int *p_origindex = NULL;
+ if (rdata->me != NULL) {
+ p_origindex = CustomData_get_layer(&rdata->me->pdata, CD_ORIGINDEX);
+ }
+
for (int i = 0; i < tri_len; i++) {
const MLoopTri *mlt = &rdata->mlooptri[i];
const int poly_index = mlt->poly;
if (!(use_hide && (rdata->mpoly[poly_index].flag & ME_HIDE))) {
- int select_id;
- GPU_select_index_get(poly_index + select_id_offset, &select_id);
- for (uint tri_corner = 0; tri_corner < 3; tri_corner++) {
- GPU_vertbuf_attr_set(vbo, attr_id.col, cidx++, &select_id);
+ int orig_index = p_origindex ? p_origindex[poly_index] : poly_index;
+ if (orig_index != ORIGINDEX_NONE) {
+ int select_id;
+ GPU_select_index_get(orig_index + select_id_offset, &select_id);
+ for (uint tri_corner = 0; tri_corner < 3; tri_corner++) {
+ GPU_vertbuf_attr_set(vbo, attr_id.col, cidx++, &select_id);
+ }
}
}
}