diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-10 20:21:57 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-08-10 20:21:57 +0400 |
commit | 29e15926b180b34a2ee0ab7e12edda67b1b0839c (patch) | |
tree | 36f24aa35c6ad769952bab7faf39e708ebc1aa58 | |
parent | 93ed7799500765116fa0c87fedfbb17d2da5df37 (diff) |
Fix for rB3cd2c6145ae1.
ID using EffectorWeight is not always a scene...
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 925672071bb..84eb94cfef4 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -598,11 +598,20 @@ static char *rna_FieldSettings_path(PointerRNA *ptr) static void rna_EffectorWeight_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; - Base *base; + ID *id = ptr->id.data; + + if (id && GS(id->name) == ID_SCE) { + Scene *scene = (Scene *)id; + Base *base; - for (base = scene->base.first; base; base = base->next) - BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH); + for (base = scene->base.first; base; base = base->next) { + BKE_ptcache_object_reset(scene, base->object, PTCACHE_RESET_DEPSGRAPH); + } + } + else { + DAG_id_tag_update(id, OB_RECALC_DATA | PSYS_RECALC_RESET); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); + } } static void rna_EffectorWeight_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) |