[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31739] trunk/blender/source/blender/ editors/object/object_modifier.c: Fix for [#21101] Switch off collision at collision object is not recognised by falling softbody Object

Janne Karhu jhkarh at gmail.com
Fri Sep 3 09:50:22 CEST 2010


Revision: 31739
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31739
Author:   jhk
Date:     2010-09-03 09:50:22 +0200 (Fri, 03 Sep 2010)

Log Message:
-----------
Fix for [#21101] Switch off collision at collision object is not recognised by falling softbody Object
* When removing a modifier that effects the depsgraph the DAG_scene_sort has to be done after the update call so that dynamic systems can clear the collision surface properly.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_modifier.c

Modified: trunk/blender/source/blender/editors/object/object_modifier.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_modifier.c	2010-09-03 07:47:10 UTC (rev 31738)
+++ trunk/blender/source/blender/editors/object/object_modifier.c	2010-09-03 07:50:22 UTC (rev 31739)
@@ -142,6 +142,7 @@
 int ED_object_modifier_remove(ReportList *reports, Main *bmain, Scene *scene, Object *ob, ModifierData *md)
 {
 	ModifierData *obmd;
+	int sort_depsgraph = 0;
 
 	/* It seems on rapid delete it is possible to
 	 * get called twice on same modifier, so make
@@ -174,13 +175,13 @@
 		if(ob->pd)
 			ob->pd->deflect= 0;
 
-		DAG_scene_sort(bmain, scene);
+		sort_depsgraph = 1;
 	}
 	else if(md->type == eModifierType_Surface) {
 		if(ob->pd && ob->pd->shape == PFIELD_SHAPE_SURFACE)
 			ob->pd->shape = PFIELD_SHAPE_PLANE;
 
-		DAG_scene_sort(bmain, scene);
+		sort_depsgraph = 1;
 	}
 	else if(md->type == eModifierType_Smoke) {
 		ob->dt = OB_TEXTURE;
@@ -197,6 +198,10 @@
 
 	DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
 
+	/* sorting has to be done after the update so that dynamic systems can react properly */
+	if(sort_depsgraph)
+		DAG_scene_sort(bmain, scene);
+
 	return 1;
 }
 





More information about the Bf-blender-cvs mailing list