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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-03 20:40:21 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-03 20:40:21 +0300
commit5f056fb742fcc79df74d74911369e6b473ec10f0 (patch)
treeda59398448e3e46f0ff121d035c251a3588743d9
parent85776521f8d3e49abddfa35ae36c5074a88d8936 (diff)
parent3d6e7cd67c2dac8acbce585efed2fa34341f2676 (diff)
Merge branch 'blender-v2.82-release'
-rw-r--r--intern/cycles/blender/blender_curves.cpp17
-rw-r--r--source/blender/makesrna/intern/rna_particle.c4
2 files changed, 9 insertions, 12 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp
index 4dba8ffbe0e..78db1d5c832 100644
--- a/intern/cycles/blender/blender_curves.cpp
+++ b/intern/cycles/blender/blender_curves.cpp
@@ -173,19 +173,20 @@ static bool ObtainCacheParticleData(
CData->curve_firstkey.push_back_slow(keyno);
float curve_length = 0.0f;
- float3 pcKey;
+ float3 prev_co_world = make_float3(0.0f, 0.0f, 0.0f);
+ float3 prev_co_object = make_float3(0.0f, 0.0f, 0.0f);
for (int step_no = 0; step_no < ren_step; step_no++) {
- float nco[3];
- 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);
+ float3 co_world = prev_co_world;
+ b_psys.co_hair(*b_ob, pa_no, step_no, &co_world.x);
+ float3 co_object = transform_point(&itfm, co_world);
if (step_no > 0) {
- const float step_length = len(cKey - pcKey);
+ const float step_length = len(co_object - prev_co_object);
curve_length += step_length;
}
- CData->curvekey_co.push_back_slow(cKey);
+ CData->curvekey_co.push_back_slow(co_object);
CData->curvekey_time.push_back_slow(curve_length);
- pcKey = cKey;
+ prev_co_object = co_object;
+ prev_co_world = co_world;
keynum++;
}
keyno += keynum;
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 90658784b9a..29ec968fe2a 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -400,7 +400,6 @@ static void rna_ParticleSystem_co_hair(
}
}
else {
- zero_v3(n_co);
return;
}
@@ -410,9 +409,6 @@ static void rna_ParticleSystem_co_hair(
mul_m4_v3(particlesystem->imat, n_co);
mul_m4_v3(object->obmat, n_co);
}
- else {
- zero_v3(n_co);
- }
}
static const EnumPropertyItem *rna_Particle_Material_itemf(bContext *C,