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
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-10 21:33:27 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-10 21:33:27 +0400
commita0c54d71d8a432e85fbcd9b01d05a52dee2659c3 (patch)
tree2f073b4424ca5b5675f531fcab266ae8504da14c /intern
parentc046cb80ed06e349fd38cdf02c72dd50cd97c325 (diff)
Fix part of T38304: cycles render problem with zero length curve segments.
Now these are removed from the curve.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/blender/blender_curves.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index fb3e968e034..49728c577cc 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -174,8 +174,8 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
CData->curvekey_time.reserve(CData->curvekey_time.size() + num_add*(ren_step+1));
for(; pa_no < totparts+totchild; pa_no++) {
+ int keynum = 0;
CData->curve_firstkey.push_back(keyno);
- CData->curve_keynum.push_back(ren_step+1);
float curve_length = 0.0f;
float3 pcKey;
@@ -184,14 +184,20 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
b_psys.co_hair(*b_ob, pa_no, step_no, nco);
float3 cKey = make_float3(nco[0], nco[1], nco[2]);
cKey = transform_point(&itfm, cKey);
- if(step_no > 0)
- curve_length += len(cKey - pcKey);
+ if(step_no > 0) {
+ float step_length = len(cKey - pcKey);
+ if(step_length == 0.0f)
+ continue;
+ curve_length += step_length;
+ }
CData->curvekey_co.push_back(cKey);
CData->curvekey_time.push_back(curve_length);
pcKey = cKey;
keyno++;
+ keynum++;
}
+ CData->curve_keynum.push_back(keynum);
CData->curve_length.push_back(curve_length);
curvenum++;
}