[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43357] trunk/blender/source/blender/ editors/physics/particle_edit.c: Bugfix: Editing baked cache in particle mode for Softbody and Cloth now shows changes in 3dview without having to exit + enter editmode .

Daniel Genrich daniel.genrich at gmx.net
Fri Jan 13 16:14:09 CET 2012


Revision: 43357
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43357
Author:   genscher
Date:     2012-01-13 15:14:08 +0000 (Fri, 13 Jan 2012)
Log Message:
-----------
Bugfix: Editing baked cache in particle mode for Softbody and Cloth now shows changes in 3dview without having to exit + enter editmode.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/physics/particle_edit.c

Modified: trunk/blender/source/blender/editors/physics/particle_edit.c
===================================================================
--- trunk/blender/source/blender/editors/physics/particle_edit.c	2012-01-13 14:56:51 UTC (rev 43356)
+++ trunk/blender/source/blender/editors/physics/particle_edit.c	2012-01-13 15:14:08 UTC (rev 43357)
@@ -254,13 +254,21 @@
 		}
 		else if(pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) {
 			if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
+			{
+				pset->flag |= PE_FADE_TIME;
+				// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
 				PE_create_particle_edit(scene, ob, pid->cache, NULL);
+			}
 			edit = pid->cache->edit;
 			break;
 		}
 		else if(pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) {
 			if(create && pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit)
+			{
+				pset->flag |= PE_FADE_TIME;
+				// NICE TO HAVE but doesn't work: pset->brushtype = PE_BRUSH_COMB;
 				PE_create_particle_edit(scene, ob, pid->cache, NULL);
+			}
 			edit = pid->cache->edit;
 			break;
 		}
@@ -3659,8 +3667,14 @@
 				PE_update_object(scene, ob, 1);
 		}
 
-		WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
-		
+		if(edit->psys)
+			WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
+		else
+		{
+			DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+			WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
+		}
+
 		bedit->lastmouse[0]= mouse[0];
 		bedit->lastmouse[1]= mouse[1];
 		bedit->first= 0;



More information about the Bf-blender-cvs mailing list