[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25466] trunk/blender/source/blender/ editors/physics/particle_edit.c: Fix #20401: hair combing with limit selection to visible does not comb

Brecht Van Lommel brecht at blender.org
Fri Dec 18 14:35:30 CET 2009


Revision: 25466
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25466
Author:   blendix
Date:     2009-12-18 14:35:30 +0100 (Fri, 18 Dec 2009)

Log Message:
-----------
Fix #20401: hair combing with limit selection to visible does not comb
all particles.

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	2009-12-18 13:28:03 UTC (rev 25465)
+++ trunk/blender/source/blender/editors/physics/particle_edit.c	2009-12-18 13:35:30 UTC (rev 25466)
@@ -373,7 +373,6 @@
 static int key_test_depth(PEData *data, float co[3])
 {
 	View3D *v3d= data->vc.v3d;
-	RegionView3D *rv3d= data->vc.rv3d;
 	double ux, uy, uz;
 	float depth;
 	short wco[3], x,y;
@@ -393,26 +392,16 @@
 	x=wco[0];
 	y=wco[1];
 
-	// XXX verify ..
+	x+= (short)data->vc.ar->winrct.xmin;
+	y+= (short)data->vc.ar->winrct.ymin;
 
-	if(rv3d->depths && x<rv3d->depths->w && y<rv3d->depths->h) {
-		/* the 0.0001 is an experimental threshold to make selecting keys right next to a surface work better */
-		if((float)uz - 0.0001 > rv3d->depths->depths[y*rv3d->depths->w+x])
-			return 0;
-		else
-			return 1;
-	}
-	else {
-		x+= (short)data->vc.ar->winrct.xmin;
-		y+= (short)data->vc.ar->winrct.ymin;
+	view3d_validate_backbuf(&data->vc);
+	glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
 
-		glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
-
-		if((float)uz - 0.0001 > depth)
-			return 0;
-		else
-			return 1;
-	}
+	if((float)uz - 0.0001 > depth)
+		return 0;
+	else
+		return 1;
 }
 
 static int key_inside_circle(PEData *data, float rad, float co[3], float *distance)





More information about the Bf-blender-cvs mailing list