diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-05-07 15:17:59 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-05-07 15:17:59 +0300 |
commit | d2421cee5106e9a561ae38bafcafe1686fc7db86 (patch) | |
tree | 22c9fa4a84ab44f43709de54fffd64edf8fdf19b /source/blender/makesrna/intern/rna_object.c | |
parent | 249b3cca61f2d6978939ef7399a2a8183811af91 (diff) | |
parent | 1326240006f9b96fc81f62bd6a78d847415cef48 (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 | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 60f77165eed..7fe6289e69e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1690,11 +1690,10 @@ Strands *rna_DupliObject_strands_new(DupliObject *dob, ReportList *UNUSED(report /* use dupli cache for realtime dupli data if possible */ data = BKE_dupli_cache_find_data(parent->dup_cache, dob->ob); if (data) { - strands = BKE_dupli_object_data_find_strands(data, psys->name); /* TODO(sergey): Consider sharing the data between viewport and * render engine. */ - if (strands != NULL) { + if (BKE_dupli_object_data_find_strands(data, psys->name, &strands, NULL)) { strands = BKE_strands_copy(strands); } } @@ -1704,8 +1703,8 @@ Strands *rna_DupliObject_strands_new(DupliObject *dob, ReportList *UNUSED(report memset(&data, 0, sizeof(data)); if (BKE_cache_read_dupli_object(parent->cache_library, &data, scene, dob->ob, frame, eval_mode, true)) { - strands = BKE_dupli_object_data_find_strands(&data, psys->name); - BKE_dupli_object_data_acquire_strands(&data, strands); + if (BKE_dupli_object_data_find_strands(&data, psys->name, &strands, NULL)) + BKE_dupli_object_data_acquire_strands(&data, strands); } BKE_dupli_object_data_clear(&data); @@ -1745,11 +1744,10 @@ StrandsChildren *rna_DupliObject_strands_children_new(DupliObject *dob, ReportLi /* use dupli cache for realtime dupli data if possible */ data = BKE_dupli_cache_find_data(parent->dup_cache, dob->ob); if (data) { - strands = BKE_dupli_object_data_find_strands_children(data, psys->name); /* TODO(sergey): Consider sharing the data between viewport and * render engine. */ - if (strands != NULL) { + if (BKE_dupli_object_data_find_strands(data, psys->name, NULL, &strands)) { strands = BKE_strands_children_copy(strands); } } @@ -1759,8 +1757,16 @@ StrandsChildren *rna_DupliObject_strands_children_new(DupliObject *dob, ReportLi memset(&data, 0, sizeof(data)); if (BKE_cache_read_dupli_object(parent->cache_library, &data, scene, dob->ob, frame, eval_mode, true)) { - strands = BKE_dupli_object_data_find_strands_children(&data, psys->name); - BKE_dupli_object_data_acquire_strands_children(&data, strands); + Strands *parents; + if (BKE_dupli_object_data_find_strands(&data, psys->name, &parents, &strands)) { + BKE_dupli_object_data_acquire_strands_children(&data, strands); + + /* Deform child strands to follow parent motion. + * Note that this is an optional feature for viewport/render display, + * strand motion is not applied to raw child data in caches. + */ + BKE_strands_children_deform(strands, parents, true); + } } BKE_dupli_object_data_clear(&data); |