Commit: 29e15926b180b34a2ee0ab7e12edda67b1b0839c
Author: Bastien Montagne
Date:   Sun Aug 10 18:21:57 2014 +0200
Branches: master
https://developer.blender.org/rB29e15926b180b34a2ee0ab7e12edda67b1b0839c

Fix for rB3cd2c6145ae1.

ID using EffectorWeight is not always a scene...

===================================================================

M       source/blender/makesrna/intern/rna_object_force.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_object_force.c 
b/source/blender/makesrna/intern/rna_object_force.c
index 9256720..84eb94c 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)

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to