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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-06-05 13:39:40 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-13 12:34:01 +0300
commit36faf739a71624b6ca10cec7233779f9eeace0bd (patch)
treead57fbc75b6bce4bdc590384a3fdf4eeb5fdbaf0 /source/blender/blenkernel/intern/object.c
parent27537daee1b62aab0fb0d01b89b7d2c044e796cd (diff)
Particle system: Move runtime data to runtime field
Allows it to be preserved during copy-on-write update when on-geometry related update is needed. This is a required part for T63537, where we need to preserve the entire evaluation data when object is tagged for only RECALC_COPY_ON_WRITE. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D5023
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 2a66edc8d42..e74b2b0f671 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -497,12 +497,13 @@ void BKE_object_free_caches(Object *object)
for (md = object->modifiers.first; md != NULL; md = md->next) {
if (md->type == eModifierType_ParticleSystem) {
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md;
- if (psmd->mesh_final) {
- BKE_id_free(NULL, psmd->mesh_final);
- psmd->mesh_final = NULL;
- if (psmd->mesh_original) {
- BKE_id_free(NULL, psmd->mesh_original);
- psmd->mesh_original = NULL;
+ ParticleSystemModifierDataRuntime *psmd_runtime = BKE_particle_modifier_runtime_ensure(psmd);
+ if (psmd_runtime->mesh_final) {
+ BKE_id_free(NULL, psmd_runtime->mesh_final);
+ psmd_runtime->mesh_final = NULL;
+ if (psmd_runtime->mesh_original) {
+ BKE_id_free(NULL, psmd_runtime->mesh_original);
+ psmd_runtime->mesh_original = NULL;
}
psmd->flag |= eParticleSystemFlag_file_loaded;
update_flag |= ID_RECALC_GEOMETRY;