[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40947] trunk/blender/source/blender/ makesrna/intern/rna_sculpt_paint.c: fix [#28883] redraw problems for particle mode's brush menu

Campbell Barton ideasman42 at gmail.com
Wed Oct 12 03:36:07 CEST 2011


Revision: 40947
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40947
Author:   campbellbarton
Date:     2011-10-12 01:36:06 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
fix [#28883] redraw problems for particle mode's brush menu

The enum items for getting the brush tool (which the UI draws), would change after the 3D view first draws on exiting editmode.

Since the panel draws before the 3D view does, the UI had a glitch.

Fix by using psys_get_current() for the enum, rather then PE_get_current() which depends on an updated particle system.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c	2011-10-12 00:47:50 UTC (rev 40946)
+++ trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c	2011-10-12 01:36:06 UTC (rev 40947)
@@ -131,13 +131,23 @@
 {
 	Scene *scene= CTX_data_scene(C);
 	Object *ob= (scene->basact)? scene->basact->object: NULL;
+#if 0
 	PTCacheEdit *edit = PE_get_current(scene, ob);
-	
-	if(edit && edit->psys) {
-		if(edit->psys->flag & PSYS_GLOBAL_HAIR)
+	ParticleSystem *psys= edit ? edit->psys : NULL;
+#else
+	/* use this rather than PE_get_current() - because the editing cache is
+	 * dependant on the cache being updated which can happen after this UI
+	 * draws causing a glitch [#28883] */
+	ParticleSystem *psys= psys_get_current(ob);
+#endif
+
+	if(psys) {
+		if(psys->flag & PSYS_GLOBAL_HAIR) {
 			return particle_edit_disconnected_hair_brush_items;
-		else
+		}
+		else {
 			return particle_edit_hair_brush_items;
+		}
 	}
 
 	return particle_edit_cache_brush_items;




More information about the Bf-blender-cvs mailing list