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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-01-25 14:31:24 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-01-25 14:32:19 +0300
commitea5326df86cba7bb235f623d59cec87bdf9e41b6 (patch)
tree25a5c690c5801f286f1773d5e9716682212c8f39 /source
parentbfa8fcc542bffe68249e733dd48d23445733f931 (diff)
Fix T59958: Blender 2.80 - Removing second Particle System cache causes crash.
Usual DEG tag missing. Also do not tag/send notifiers when we do not change anything!
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/physics/physics_pointcache.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index 58bd761a2a9..e36f2f912bd 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -47,6 +47,8 @@
#include "BKE_particle.h"
#include "BKE_pointcache.h"
+#include "DEG_depsgraph.h"
+
#include "ED_particle.h"
#include "WM_api.h"
@@ -384,10 +386,11 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
PointCache *cache_new = BKE_ptcache_add(pid.ptcaches);
cache_new->step = pid.default_step;
*(pid.cache_ptr) = cache_new;
- }
- WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
- WM_event_add_notifier(C, NC_OBJECT|ND_POINTCACHE, ob);
+ DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
+ WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+ WM_event_add_notifier(C, NC_OBJECT|ND_POINTCACHE, ob);
+ }
return OPERATOR_FINISHED;
}
@@ -404,9 +407,10 @@ static int ptcache_remove_exec(bContext *C, wmOperator *UNUSED(op))
BLI_remlink(pid.ptcaches, pid.cache);
BKE_ptcache_free(pid.cache);
*(pid.cache_ptr) = pid.ptcaches->first;
- }
- WM_event_add_notifier(C, NC_OBJECT|ND_POINTCACHE, ob);
+ DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
+ WM_event_add_notifier(C, NC_OBJECT|ND_POINTCACHE, ob);
+ }
return OPERATOR_FINISHED;
}