[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14260] trunk/blender/source/blender/src/ editparticle.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Mar 27 12:10:18 CET 2008


Revision: 14260
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14260
Author:   blendix
Date:     2008-03-27 12:10:18 +0100 (Thu, 27 Mar 2008)

Log Message:
-----------

Fix for bug #8771: hide deselected in particle editmode didn't work
correct. Also made it not do a depth test when editing in wire mode,
was using outdated depth buffer even.

Modified Paths:
--------------
    trunk/blender/source/blender/src/editparticle.c

Modified: trunk/blender/source/blender/src/editparticle.c
===================================================================
--- trunk/blender/source/blender/src/editparticle.c	2008-03-27 05:12:14 UTC (rev 14259)
+++ trunk/blender/source/blender/src/editparticle.c	2008-03-27 11:10:18 UTC (rev 14260)
@@ -280,7 +280,7 @@
 	float depth;
 	short wco[3], x,y;
 
-	if((G.vd->flag & V3D_ZBUF_SELECT)==0) return 1;
+	if((G.vd->drawtype<=OB_WIRE) || (G.vd->flag & V3D_ZBUF_SELECT)==0) return 1;
 
 	gluProject(co[0],co[1],co[2], mats->modelview, mats->projection,
 			(GLint *)mats->viewport, &ux, &uy, &uz );
@@ -1503,10 +1503,12 @@
 }
 void PE_hide(int mode)
 {
-	ParticleSystem *psys = PE_get_current(OBACT);
+	Object *ob = OBACT;
+	ParticleSystem *psys = PE_get_current(ob);
 	ParticleEdit *edit;
+	ParticleEditKey *key;
 	ParticleData *pa;
-	int i,totpart;
+	int i, k, totpart;
 
 	if(!PE_can_edit(psys)) return;
 
@@ -1514,21 +1516,40 @@
 	totpart = psys->totpart;
 	
 	if(mode == 0){ /* reveal all particles */
-		LOOP_PARTICLES(i,pa){
-			pa->flag &= ~PARS_HIDE;
+		LOOP_PARTICLES(i, pa){
+			if(pa->flag & PARS_HIDE) {
+				pa->flag &= ~PARS_HIDE;
+				pa->flag |= PARS_EDIT_RECALC;
+
+				LOOP_KEYS(k, key)
+					key->flag |= PEK_SELECT;
+			}
 		}
 	}
 	else if(mode == 1){ /* hide unselected particles */
-		LOOP_PARTICLES(i,pa)
-			if(particle_is_selected(psys, pa))
+		LOOP_PARTICLES(i, pa) {
+			if(!particle_is_selected(psys, pa)) {
 				pa->flag |= PARS_HIDE;
+				pa->flag |= PARS_EDIT_RECALC;
+
+				LOOP_KEYS(k, key)
+					key->flag &= ~PEK_SELECT;
+			}
+		}
 	}
 	else{ /* hide selected particles */
-		LOOP_PARTICLES(i,pa)
-			if(particle_is_selected(psys, pa))
+		LOOP_PARTICLES(i, pa) {
+			if(particle_is_selected(psys, pa)) {
 				pa->flag |= PARS_HIDE;
+				pa->flag |= PARS_EDIT_RECALC;
+
+				LOOP_KEYS(k, key)
+					key->flag &= ~PEK_SELECT;
+			}
+		}
 	}
 
+	PE_update_selection(ob, 1);
 	BIF_undo_push("(Un)hide elements");
 	
 	allqueue(REDRAWVIEW3D, 1);





More information about the Bf-blender-cvs mailing list