[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13912] trunk/blender/source/blender: Particle weights weren't drawn properly in particle mode.

Janne Karhu jhkarh at utu.fi
Fri Feb 29 09:31:12 CET 2008


Revision: 13912
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13912
Author:   jhk
Date:     2008-02-29 09:31:11 +0100 (Fri, 29 Feb 2008)

Log Message:
-----------
Particle weights weren't drawn properly in particle mode. There also was some lag in updating the colors when changing particle edit brushes.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/particle.c
    trunk/blender/source/blender/src/buttons_editing.c

Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c	2008-02-28 23:14:55 UTC (rev 13911)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c	2008-02-29 08:31:11 UTC (rev 13912)
@@ -2508,6 +2508,38 @@
 			}
 
 			VECCOPY(ca->co, result.co);
+
+			/* selection coloring in edit mode */
+			if(edit){
+				if(pset->brushtype==PE_BRUSH_WEIGHT){
+					if(k==steps)
+						VecLerpf(ca->col, nosel_col, sel_col, hkey[0]->weight);
+					else
+						VecLerpf(ca->col, nosel_col, sel_col,
+						(1.0f - keytime) * hkey[0]->weight + keytime * hkey[1]->weight);
+				}
+				else{
+					if((ekey + (hkey[0] - pa->hair))->flag & PEK_SELECT){
+						if((ekey + (hkey[1] - pa->hair))->flag & PEK_SELECT){
+							VECCOPY(ca->col, sel_col);
+						}
+						else{
+							VecLerpf(ca->col, sel_col, nosel_col, keytime);
+						}
+					}
+					else{
+						if((ekey + (hkey[1] - pa->hair))->flag & PEK_SELECT){
+							VecLerpf(ca->col, nosel_col, sel_col, keytime);
+						}
+						else{
+							VECCOPY(ca->col, nosel_col);
+						}
+					}
+				}
+			}
+			else{
+				VECCOPY(ca->col, col);
+			}
 		}
 		
 		/*--modify paths--*/
@@ -2583,37 +2615,6 @@
 
 			}
 
-			/* selection coloring in edit mode */
-			if(edit){
-				if(pset->brushtype==PE_BRUSH_WEIGHT){
-					if(k==steps)
-						VecLerpf(ca->col, nosel_col, sel_col, hkey[0]->weight);
-					else
-						VecLerpf(ca->col,nosel_col,sel_col,
-						(1.0f - keytime) * hkey[0]->weight + keytime * hkey[1]->weight);
-				}
-				else{
-					if((ekey + (hkey[0] - pa->hair))->flag & PEK_SELECT){
-						if((ekey + (hkey[1] - pa->hair))->flag & PEK_SELECT){
-							VECCOPY(ca->col, sel_col);
-						}
-						else{
-							VecLerpf(ca->col, sel_col, nosel_col, keytime);
-						}
-					}
-					else{
-						if((ekey + (hkey[1] - pa->hair))->flag & PEK_SELECT){
-							VecLerpf(ca->col, nosel_col, sel_col, keytime);
-						}
-						else{
-							VECCOPY(ca->col, nosel_col);
-						}
-					}
-				}
-			}
-			else{
-				VECCOPY(ca->col, col);
-			}
 		}
 	}
 

Modified: trunk/blender/source/blender/src/buttons_editing.c
===================================================================
--- trunk/blender/source/blender/src/buttons_editing.c	2008-02-28 23:14:55 UTC (rev 13911)
+++ trunk/blender/source/blender/src/buttons_editing.c	2008-02-29 08:31:11 UTC (rev 13912)
@@ -6340,18 +6340,17 @@
 	if(psys->edit) {
 		edit= psys->edit;
 
-		/* brushes */
-		//uiDefBut(block, LABEL, 0, "Brush",	butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
+		/* brushes (the update evend needs to be B_BAKE_RECACHE so that path colors are updated properly) */
 		uiBlockBeginAlign(block);	
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"None",butx,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_NONE,0,0,"Disable brush");
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Comb",butx+75,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_COMB,0,0,"Comb hairs");
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Smooth",butx+150,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_SMOOTH,0,0,"Smooth hairs");
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Weight",butx+225,buty,75,19,&pset->brushtype,14,PE_BRUSH_WEIGHT,0,0,"Weight hairs");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"None",butx,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_NONE,0,0,"Disable brush");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"Comb",butx+75,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_COMB,0,0,"Comb hairs");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"Smooth",butx+150,buty,75,19,&pset->brushtype,14.0,PE_BRUSH_SMOOTH,0,0,"Smooth hairs");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"Weight",butx+225,buty,75,19,&pset->brushtype,14,PE_BRUSH_WEIGHT,0,0,"Weight hairs");
 		buty-= buth;
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Add", butx,buty,75,19,&pset->brushtype,14,PE_BRUSH_ADD,0,0,"Add hairs");
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Length", butx+75,buty,75,19,&pset->brushtype,14, PE_BRUSH_LENGTH,0,0,"Make hairs longer or shorter");
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Puff", butx+150,buty,75,19,&pset->brushtype,14, PE_BRUSH_PUFF,0,0,"Make hairs stand up");
-		uiDefButS(block,ROW,B_BAKE_REDRAWEDIT,"Cut", butx+225,buty,75,19,&pset->brushtype,14, PE_BRUSH_CUT,0,0,"Cut hairs");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"Add", butx,buty,75,19,&pset->brushtype,14,PE_BRUSH_ADD,0,0,"Add hairs");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"Length", butx+75,buty,75,19,&pset->brushtype,14, PE_BRUSH_LENGTH,0,0,"Make hairs longer or shorter");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"Puff", butx+150,buty,75,19,&pset->brushtype,14, PE_BRUSH_PUFF,0,0,"Make hairs stand up");
+		uiDefButS(block,ROW,B_BAKE_RECACHE,"Cut", butx+225,buty,75,19,&pset->brushtype,14, PE_BRUSH_CUT,0,0,"Cut hairs");
 		uiBlockEndAlign(block);
 
 		buty-= 10;





More information about the Bf-blender-cvs mailing list