[Bf-blender-cvs] [655eb8eabd7] master: Fix T61690: Hidden curve vertices are drawn in edit-mode
Sebastian Parborg
noreply at git.blender.org
Tue Feb 19 15:45:55 CET 2019
Commit: 655eb8eabd7a2ba73d7bd7dedbd59ed6461c3989
Author: Sebastian Parborg
Date: Tue Feb 19 15:41:24 2019 +0100
Branches: master
https://developer.blender.org/rB655eb8eabd7a2ba73d7bd7dedbd59ed6461c3989
Fix T61690: Hidden curve vertices are drawn in edit-mode
When hiding the curve handles/points previously, the control points would still be drawn (loose verts).
Now we hide everything related to the handle if it is hidden.
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D4373
===================================================================
M source/blender/draw/intern/draw_cache_impl_curve.c
===================================================================
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c
index f41062d2018..aef24dd0a72 100644
--- a/source/blender/draw/intern/draw_cache_impl_curve.c
+++ b/source/blender/draw/intern/draw_cache_impl_curve.c
@@ -741,10 +741,14 @@ static void curve_create_edit_data_and_handles(
const BPoint *bp = nu->bp;
if (bezt) {
for (int a = 0; a < nu->pntsu; a++, bezt++) {
- if (elbp_verts && bezt->hide == false) {
+ if (bezt->hide == true) {
+ continue;
+ }
+
+ if (elbp_verts) {
GPU_indexbuf_add_point_vert(elbp_verts, vbo_len_used + 1);
}
- if (elbp_lines && bezt->hide == false) {
+ if (elbp_lines) {
GPU_indexbuf_add_line_verts(elbp_lines, vbo_len_used + 1, vbo_len_used + 0);
GPU_indexbuf_add_line_verts(elbp_lines, vbo_len_used + 1, vbo_len_used + 2);
}
@@ -770,14 +774,17 @@ static void curve_create_edit_data_and_handles(
else if (bp) {
int pt_len = nu->pntsu * nu->pntsv;
for (int a = 0; a < pt_len; a++, bp++) {
+ if (bp->hide == true) {
+ continue;
+ }
int u = (a % nu->pntsu);
int v = (a / nu->pntsu);
/* Use indexed rendering for bezier.
* Specify all points and use indices to hide/show. */
- if (elbp_verts && bp->hide == false) {
+ if (elbp_verts) {
GPU_indexbuf_add_point_vert(elbp_verts, vbo_len_used);
}
- if (elbp_lines && bp->hide == false) {
+ if (elbp_lines) {
const BPoint *bp_next_u = (u < (nu->pntsu - 1)) ? &nu->bp[a + 1] : NULL;
const BPoint *bp_next_v = (v < (nu->pntsv - 1)) ? &nu->bp[a + nu->pntsu] : NULL;
if (bp_next_u && (bp_next_u->hide == false)) {
More information about the Bf-blender-cvs
mailing list