[Bf-blender-cvs] [82e5e246ba2] hair_guides_grooming: Use correct curvecache verts for drawing the center curve.

Lukas Tönne noreply at git.blender.org
Thu Jun 28 11:17:36 CEST 2018


Commit: 82e5e246ba20089516492f8cbccf4e8c48e7cf3b
Author: Lukas Tönne
Date:   Thu Jun 28 10:17:19 2018 +0100
Branches: hair_guides_grooming
https://developer.blender.org/rB82e5e246ba20089516492f8cbccf4e8c48e7cf3b

Use correct curvecache verts for drawing the center curve.

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

M	source/blender/draw/intern/draw_cache_impl_groom.c

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

diff --git a/source/blender/draw/intern/draw_cache_impl_groom.c b/source/blender/draw/intern/draw_cache_impl_groom.c
index 216a8ac7bc5..6191ac0a75f 100644
--- a/source/blender/draw/intern/draw_cache_impl_groom.c
+++ b/source/blender/draw/intern/draw_cache_impl_groom.c
@@ -499,7 +499,8 @@ static void groom_get_verts(
 			GroomBundle *bundle = &region->bundle;
 			if (use_curve_cache)
 			{
-				GroomCurveCache *cache = bundle->curvecache;
+				/* curvecache has numverts+1 curves, the last one is the center curve */
+				GroomCurveCache *cache = bundle->curvecache + bundle->curvesize * region->numverts;
 				for (int i = 0; i < bundle->curvesize; ++i, ++cache)
 				{
 					if (id_pos != GM_ATTR_ID_UNUSED)
@@ -652,8 +653,7 @@ static void groom_get_edges(
 			GroomBundle *bundle = &region->bundle;
 			if (use_curve_cache)
 			{
-				GroomCurveCache *cache = bundle->curvecache;
-				for (int i = 0; i < bundle->curvesize - 1; ++i, ++cache)
+				for (int i = 0; i < bundle->curvesize - 1; ++i)
 				{
 					GWN_indexbuf_add_line_verts(&elb, idx + i, idx + i + 1);
 				}



More information about the Bf-blender-cvs mailing list