[Bf-blender-cvs] [6855c5dab66] hair_guides: Fix strand vertex init loop, use correct stop index.
Lukas Tönne
noreply at git.blender.org
Sat Nov 25 11:50:49 CET 2017
Commit: 6855c5dab667867cdf88d2425bc946caf4e1837a
Author: Lukas Tönne
Date: Sat Nov 25 10:49:51 2017 +0000
Branches: hair_guides
https://developer.blender.org/rB6855c5dab667867cdf88d2425bc946caf4e1837a
Fix strand vertex init loop, use correct stop index.
===================================================================
M source/blender/blenkernel/intern/hair_draw.c
===================================================================
diff --git a/source/blender/blenkernel/intern/hair_draw.c b/source/blender/blenkernel/intern/hair_draw.c
index 1430e3690dc..37de8bc742d 100644
--- a/source/blender/blenkernel/intern/hair_draw.c
+++ b/source/blender/blenkernel/intern/hair_draw.c
@@ -177,7 +177,8 @@ static void hair_strand_calc_vectors(const float (*positions)[3], int num_verts,
prev_tang, prev_nor,
strand[0].tang, strand[0].nor);
- for (int i = 1; i < num_verts - 1; ++i) {
+ for (int i = 1; i < num_verts - 1; ++i)
+ {
hair_strand_transport_frame(strand[i-1].co, strand[i+1].co,
prev_tang, prev_nor,
strand[i].tang, strand[i].nor);
@@ -195,7 +196,8 @@ static int hair_strand_subdivide(const HairSystem *hsys, const HairGuideCurve* c
/* Move vertex positions from the dense array to their initial configuration for subdivision. */
const int step = (1 << subdiv);
float (*dst)[3] = verts;
- for (int i = curve->vertstart; i < curve->numverts; ++i) {
+ int vertend = curve->vertstart + curve->numverts;
+ for (int i = curve->vertstart; i < vertend; ++i) {
copy_v3_v3(*dst, hsys->verts[i].co);
dst += step;
}
More information about the Bf-blender-cvs
mailing list