diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-05-27 16:22:57 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-05-27 16:22:57 +0300 |
commit | 96e878b6cc717d44b1b27ea56a83589acb321c0e (patch) | |
tree | 09fa0684045c67d73266211035f11cf593199524 /source/blender/makesrna/intern/rna_object.c | |
parent | 62fd4395ac594dd02a61982d2bf92839d9810f1b (diff) | |
parent | 2aa75bb1061d9c7327f219396efd01aea1bdedae (diff) |
Merge branch 'alembic' into gooseberry
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 1183126d94f..dc4cfd7cc20 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1676,16 +1676,12 @@ Strands *rna_DupliObject_strands_new(DupliObject *dob, ReportList *UNUSED(report if (is_cached) { float frame = (float)scene->r.cfra; - eCacheLibrary_EvalMode eval_mode; + bool use_render = (settings == 2); - if (settings == 1) - eval_mode = CACHE_LIBRARY_EVAL_REALTIME; - else if (settings == 2) - eval_mode = CACHE_LIBRARY_EVAL_RENDER; - else + if (!ELEM(settings, 1, 2)) return NULL; - if (settings == 1 && parent->dup_cache) { + if (!use_render && parent->dup_cache) { DupliObjectData *data; /* use dupli cache for realtime dupli data if possible */ @@ -1704,7 +1700,7 @@ Strands *rna_DupliObject_strands_new(DupliObject *dob, ReportList *UNUSED(report DupliObjectData data; memset(&data, 0, sizeof(data)); - if (BKE_cache_read_dupli_object(parent->cache_library, &data, scene, dob->ob, frame, eval_mode, true)) { + if (BKE_cache_read_dupli_object(parent->cache_library, &data, scene, dob->ob, frame, use_render, true)) { BKE_dupli_object_data_find_strands(&data, psys->name, &strands, NULL); if (strands) BKE_dupli_object_data_acquire_strands(&data, strands); @@ -1732,16 +1728,12 @@ StrandsChildren *rna_DupliObject_strands_children_new(DupliObject *dob, ReportLi if (is_cached) { float frame = (float)scene->r.cfra; - eCacheLibrary_EvalMode eval_mode; + bool use_render = (settings == 2); - if (settings == 1) - eval_mode = CACHE_LIBRARY_EVAL_REALTIME; - else if (settings == 2) - eval_mode = CACHE_LIBRARY_EVAL_RENDER; - else + if (!ELEM(settings, 1, 2)) return NULL; - if (settings == 1 && parent->dup_cache) { + if (!use_render && parent->dup_cache) { DupliObjectData *data; /* use dupli cache for realtime dupli data if possible */ @@ -1760,7 +1752,7 @@ StrandsChildren *rna_DupliObject_strands_children_new(DupliObject *dob, ReportLi DupliObjectData data; memset(&data, 0, sizeof(data)); - if (BKE_cache_read_dupli_object(parent->cache_library, &data, scene, dob->ob, frame, eval_mode, true)) { + if (BKE_cache_read_dupli_object(parent->cache_library, &data, scene, dob->ob, frame, use_render, true)) { Strands *parents; BKE_dupli_object_data_find_strands(&data, psys->name, &parents, &strands); if (strands) { |