Merge with trunk r39750
[blender.git] / source / blender / blenkernel / intern / particle.c
index 86c646fa2571cea7f9b5c786a163ff30ed8d6062..9478f9c65184fdbc2db9039e4c9ed295672ee06d 100644 (file)
@@ -49,6 +49,7 @@
 #include "DNA_particle_types.h"
 #include "DNA_smoke_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_dynamicpaint_types.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
@@ -3453,6 +3454,14 @@ void object_remove_particle_system(Scene *scene, Object *ob)
                                smd->flow->psys = NULL;
        }
 
+       if((md = modifiers_findByType(ob, eModifierType_DynamicPaint)))
+       {
+               DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
+               if(pmd->brush && pmd->brush->psys)
+                       if(pmd->brush->psys == psys)
+                               pmd->brush->psys = NULL;
+       }
+
        /* clear modifier */
        psmd= psys_get_modifier(ob, psys);
        BLI_remlink(&ob->modifiers, psmd);