[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24163] trunk/blender/source/blender/ blenkernel/intern: Smoke:
Daniel Genrich
daniel.genrich at gmx.net
Thu Oct 29 20:26:13 CET 2009
Revision: 24163
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24163
Author: genscher
Date: 2009-10-29 20:26:13 +0100 (Thu, 29 Oct 2009)
Log Message:
-----------
Smoke:
* Bugfix for crash when deleting particle system used by Smoke Flow modifier (reported by nudelZ).
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/particle.c
trunk/blender/source/blender/blenkernel/intern/smoke.c
Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c 2009-10-29 18:59:48 UTC (rev 24162)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c 2009-10-29 19:26:13 UTC (rev 24163)
@@ -35,20 +35,21 @@
#include "MEM_guardedalloc.h"
-#include "DNA_scene_types.h"
#include "DNA_boid_types.h"
+#include "DNA_curve_types.h"
#include "DNA_group_types.h"
-#include "DNA_particle_types.h"
+#include "DNA_ipo_types.h" // XXX old animation system stuff to remove!
+#include "DNA_key_types.h"
+#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_force.h"
+#include "DNA_object_types.h"
+#include "DNA_particle_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_smoke_types.h"
#include "DNA_texture_types.h"
-#include "DNA_material_types.h"
-#include "DNA_object_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_key_types.h"
-#include "DNA_ipo_types.h" // XXX old animation system stuff to remove!
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
@@ -3308,10 +3309,20 @@
{
ParticleSystem *psys = psys_get_current(ob);
ParticleSystemModifierData *psmd;
+ ModifierData *md;
if(!psys)
return;
+ /* clear all other appearances of this pointer (like on smoke flow modifier) */
+ if((md = modifiers_findByType(ob, eModifierType_Smoke)))
+ {
+ SmokeModifierData *smd = (SmokeModifierData *)md;
+ if((smd->type == MOD_SMOKE_TYPE_FLOW) && smd->flow && smd->flow->psys)
+ if(smd->flow->psys == psys)
+ smd->flow->psys = NULL;
+ }
+
/* clear modifier */
psmd= psys_get_modifier(ob, psys);
BLI_remlink(&ob->modifiers, psmd);
Modified: trunk/blender/source/blender/blenkernel/intern/smoke.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/smoke.c 2009-10-29 18:59:48 UTC (rev 24162)
+++ trunk/blender/source/blender/blenkernel/intern/smoke.c 2009-10-29 19:26:13 UTC (rev 24163)
@@ -823,7 +823,7 @@
// we got nice flow object
SmokeFlowSettings *sfs = smd2->flow;
- if(sfs->psys && sfs->psys->part && sfs->psys->part->type==PART_EMITTER) // is particle system selected
+ if(sfs && sfs->psys && sfs->psys->part && sfs->psys->part->type==PART_EMITTER) // is particle system selected
{
ParticleSystem *psys = sfs->psys;
ParticleSettings *part=psys->part;
More information about the Bf-blender-cvs
mailing list