diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-03-27 14:10:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-03-27 14:10:18 +0300 |
commit | 4dee3dc0ef64f66cef57861bc4c2045be9d0f136 (patch) | |
tree | 46613cb2cd014bf819830a73084504213e86d49d /source/blender/src/editparticle.c | |
parent | bc518579a6f670d6624d606ebe6ccfb0b5208f06 (diff) |
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.
Diffstat (limited to 'source/blender/src/editparticle.c')
-rw-r--r-- | source/blender/src/editparticle.c | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/source/blender/src/editparticle.c b/source/blender/src/editparticle.c index d70b8620ae8..3981dd791fe 100644 --- a/source/blender/src/editparticle.c +++ b/source/blender/src/editparticle.c @@ -280,7 +280,7 @@ static int test_key_depth(float *co, bglMats *mats){ 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_do_lasso_select(short mcords[][2], short moves, short select) } 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 @@ void PE_hide(int mode) 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); |