From 64109d8a0d0bd5dbb5a87aa37397a8f4c575e03c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 24 Jan 2008 21:32:36 +0000 Subject: [PATCH] Select linked particles (Shift+L) --- source/blender/src/editobject.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 2e96ea464fa..4e90fbac5ac 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -5142,7 +5142,7 @@ void selectlinks_menu(void) /* If you modify this menu, please remember to update view3d_select_linksmenu * in header_view3d.c and the menu in toolbox.c */ - nr= pupmenu("Select Linked%t|Object Ipo%x1|ObData%x2|Material%x3|Texture%x4|DupliGroup%x5"); + nr= pupmenu("Select Linked%t|Object Ipo%x1|ObData%x2|Material%x3|Texture%x4|DupliGroup%x5|ParticleSystem%x6"); if (nr <= 0) return; @@ -5165,6 +5165,7 @@ void selectlinks(int nr) * Current Material: 3 * Current Texture: 4 * DupliGroup: 5 + * PSys: 6 */ @@ -5190,6 +5191,9 @@ void selectlinks(int nr) else if(nr==5) { if(ob->dup_group==NULL) return; } + else if(nr==6) { + if(ob->particlesystem.first==NULL) return; + } else return; base= FIRSTBASE; @@ -5218,6 +5222,7 @@ void selectlinks(int nr) if(tex==mat1->mtex[b]->tex) { base->flag |= SELECT; changed = 1; + break; } } } @@ -5230,6 +5235,25 @@ void selectlinks(int nr) changed = 1; } } + else if(nr==6) { + /* loop through other, then actives particles*/ + ParticleSystem *psys; + ParticleSystem *psys_act; + + for(psys=base->object->particlesystem.first; psys; psys=psys->next) { + for(psys_act=ob->particlesystem.first; psys_act; psys_act=psys_act->next) { + if (psys->part == psys_act->part) { + base->flag |= SELECT; + changed = 1; + break; + } + } + + if (base->flag & SELECT) { + break; + } + } + } base->object->flag= base->flag; } base= base->next;