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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-04-20 18:56:35 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-04-20 18:56:35 +0300
commita7880dd5c8df6890e572aadd160949e81f6f1b51 (patch)
tree485617e06849832ad72b393fd70cdeeab08a41bc
parent8a9dc8451d14bfc0aa81818b7d9d7b5804f81122 (diff)
Fix 'Children' draw option showing nothing when no children in hairsim/cache
If number of children is zero, even if we do have "valid" children cache, do not generate children strands from cache...
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c2
-rw-r--r--source/blender/pointcache/alembic/abc_particles.cpp15
2 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index ff919e863bf..af3b02da539 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -1457,7 +1457,7 @@ void BKE_dupli_object_data_add_strands_children(DupliObjectData *data, const cha
BKE_strands_children_free(link->strands_children);
link->strands_children = children;
}
-
+
dupli_cache_calc_boundbox(data);
}
diff --git a/source/blender/pointcache/alembic/abc_particles.cpp b/source/blender/pointcache/alembic/abc_particles.cpp
index 648264bbb81..89ab4e64533 100644
--- a/source/blender/pointcache/alembic/abc_particles.cpp
+++ b/source/blender/pointcache/alembic/abc_particles.cpp
@@ -698,12 +698,14 @@ PTCReadSampleResult AbcStrandsChildrenReader::read_sample(float frame)
{
ISampleSelector ss = abc_archive()->get_frame_sample_selector(frame);
- if (!m_curves.valid())
+ if (!m_curves.valid()) {
return PTC_READ_SAMPLE_INVALID;
+ }
ICurvesSchema &schema = m_curves.getSchema();
- if (schema.getNumSamples() == 0)
+ if (schema.getNumSamples() == 0) {
return PTC_READ_SAMPLE_INVALID;
+ }
ICurvesSchema::Sample sample;
schema.get(sample, ss);
@@ -716,12 +718,17 @@ PTCReadSampleResult AbcStrandsChildrenReader::read_sample(float frame)
Int32ArraySamplePtr sample_parents = m_prop_parents.getValue(ss);
FloatArraySamplePtr sample_parent_weights = m_prop_parent_weights.getValue(ss);
- if (!sample_co || !sample_numvert)
+ if (!sample_co || !sample_numvert) {
return PTC_READ_SAMPLE_INVALID;
+ }
int totcurves = sample_numvert->size();
int totverts = sample_co->size();
-
+
+ if (!totcurves) {
+ return PTC_READ_SAMPLE_INVALID;
+ }
+
if (sample_root_matrix->size() != totcurves ||
sample_root_positions->size() != totcurves ||
sample_parents->size() != 4 * totcurves ||