[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25086] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: Fix for [#20168] Particle velocity display toggle issue

Matt Ebb matt at mke3.net
Thu Dec 3 01:42:02 CET 2009


Revision: 25086
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25086
Author:   broken
Date:     2009-12-03 01:42:02 +0100 (Thu, 03 Dec 2009)

Log Message:
-----------
Fix for [#20168] Particle velocity display toggle issue

Thanks Alan Taylor for the initial patch

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawobject.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2009-12-03 00:17:34 UTC (rev 25085)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2009-12-03 00:42:02 UTC (rev 25086)
@@ -3795,6 +3795,10 @@
 				pdd->vedata = MEM_callocN(2 * (totpart + totchild) * 3 * sizeof(float), "particle_vedata");
 
 			need_v = 1;
+		} else if (pdd->vedata) {
+			/* velocity data not needed, so free it */
+			MEM_freeN(pdd->vedata);
+			pdd->vedata= NULL;
 		}
 
 		pdd->vd= pdd->vdata;
@@ -3954,7 +3958,7 @@
 			if(drawn) {
 				/* additional things to draw for each particle	*/
 				/* (velocity, size and number)					*/
-				if(pdd->vedata){
+				if((part->draw & PART_DRAW_VEL) && pdd->vedata){
 					VECCOPY(pdd->ved,state.co);
 					pdd->ved+=3;
 					VECCOPY(vel,state.vel);
@@ -4193,14 +4197,8 @@
 		glDisable(GL_DEPTH_TEST);
 
 	/* get selection theme colors */
-	UI_GetThemeColor3ubv(TH_VERTEX_SELECT, sel);
-	UI_GetThemeColor3ubv(TH_VERTEX, nosel);
-	sel_col[0]=(float)sel[0]/255.0f;
-	sel_col[1]=(float)sel[1]/255.0f;
-	sel_col[2]=(float)sel[2]/255.0f;
-	nosel_col[0]=(float)nosel[0]/255.0f;
-	nosel_col[1]=(float)nosel[1]/255.0f;
-	nosel_col[2]=(float)nosel[2]/255.0f;
+	UI_GetThemeColor3fv(TH_VERTEX_SELECT, sel_col);
+	UI_GetThemeColor3fv(TH_VERTEX, nosel_col);
 
 	/* draw paths */
 	if(timed) {





More information about the Bf-blender-cvs mailing list