* Added 'Particle System' entries as children of particle system modifiers in the

outliner. Clicking on one activates it and takes you to the object buttons - it's a 
lot better to see what's going on than a little < 1 Part 5 > that gives very little 
indication.
This commit is contained in:
Matt Ebb 2008-11-25 23:14:00 +00:00
parent 376ba4ac14
commit 00fae51fc1
4 changed files with 48 additions and 0 deletions

@ -46,6 +46,7 @@ void PE_create_particle_edit(struct Object *ob, struct ParticleSystem *psys);
void PE_free_particle_edit(struct ParticleSystem *psys); void PE_free_particle_edit(struct ParticleSystem *psys);
void PE_change_act(void *ob_v, void *act_v); void PE_change_act(void *ob_v, void *act_v);
void PE_change_act_psys(struct Object *ob, struct ParticleSystem *psys);
int PE_can_edit(struct ParticleSystem *psys); int PE_can_edit(struct ParticleSystem *psys);
/* access */ /* access */

@ -80,6 +80,7 @@ typedef struct TreeElement {
#define TSE_SEQUENCE 26 #define TSE_SEQUENCE 26
#define TSE_SEQ_STRIP 27 #define TSE_SEQ_STRIP 27
#define TSE_SEQUENCE_DUP 28 #define TSE_SEQUENCE_DUP 28
#define TSE_LINKED_PSYS 29
/* outliner search flags */ /* outliner search flags */
#define OL_FIND 0 #define OL_FIND 0

@ -165,6 +165,22 @@ void PE_change_act(void *ob_v, void *act_v)
} }
} }
void PE_change_act_psys(Object *ob, ParticleSystem *psys)
{
ParticleSystem *p;
if((p=psys_get_current(ob)))
p->flag &= ~PSYS_CURRENT;
psys->flag |= PSYS_CURRENT;
if(psys_check_enabled(ob, psys)) {
if(G.f & G_PARTICLEEDIT && !psys->edit)
PE_create_particle_edit(ob, psys);
PE_recalc_world_cos(ob, psys);
}
}
/* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set */ /* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set */
ParticleSystem *PE_get_current(Object *ob) ParticleSystem *PE_get_current(Object *ob)
{ {

@ -50,6 +50,7 @@
#include "DNA_nla_types.h" #include "DNA_nla_types.h"
#include "DNA_object_types.h" #include "DNA_object_types.h"
#include "DNA_oops_types.h" #include "DNA_oops_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h" #include "DNA_scene_types.h"
#include "DNA_screen_types.h" #include "DNA_screen_types.h"
#include "DNA_space_types.h" #include "DNA_space_types.h"
@ -87,6 +88,7 @@
#include "BIF_editarmature.h" #include "BIF_editarmature.h"
#include "BIF_editdeform.h" #include "BIF_editdeform.h"
#include "BIF_editnla.h" #include "BIF_editnla.h"
#include "BIF_editparticle.h"
#include "BIF_editview.h" #include "BIF_editview.h"
#include "BIF_editconstraint.h" #include "BIF_editconstraint.h"
#include "BIF_gl.h" #include "BIF_gl.h"
@ -715,6 +717,13 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
outliner_add_element(soops, &te->subtree, ((ArmatureModifierData*) md)->object, te, TSE_LINKED_OB, 0); outliner_add_element(soops, &te->subtree, ((ArmatureModifierData*) md)->object, te, TSE_LINKED_OB, 0);
} else if (md->type==eModifierType_Hook) { } else if (md->type==eModifierType_Hook) {
outliner_add_element(soops, &te->subtree, ((HookModifierData*) md)->object, te, TSE_LINKED_OB, 0); outliner_add_element(soops, &te->subtree, ((HookModifierData*) md)->object, te, TSE_LINKED_OB, 0);
} else if (md->type==eModifierType_ParticleSystem) {
TreeElement *ten;
ParticleSystem *psys= ((ParticleSystemModifierData*) md)->psys;
ten = outliner_add_element(soops, &te->subtree, ob, te, TSE_LINKED_PSYS, 0);
ten->directdata = psys;
ten->name = psys->part->id.name+2;
} }
} }
} }
@ -1965,6 +1974,19 @@ static int tree_element_active_modifier(TreeElement *te, TreeStoreElem *tselem,
return 0; return 0;
} }
static int tree_element_active_psys(TreeElement *te, TreeStoreElem *tselem, int set)
{
if(set) {
Object *ob= (Object *)tselem->id;
ParticleSystem *psys= te->directdata;
PE_change_act_psys(ob, psys);
extern_set_butspace(F7KEY, 0);
}
return 0;
}
static int tree_element_active_constraint(TreeElement *te, TreeStoreElem *tselem, int set) static int tree_element_active_constraint(TreeElement *te, TreeStoreElem *tselem, int set)
{ {
if(set) { if(set) {
@ -2094,6 +2116,9 @@ static int tree_element_type_active(SpaceOops *soops, TreeElement *te, TreeStore
if(set) tree_element_active_object(soops, te); if(set) tree_element_active_object(soops, te);
else if(tselem->id==(ID *)OBACT) return 1; else if(tselem->id==(ID *)OBACT) return 1;
break; break;
case TSE_LINKED_PSYS:
return tree_element_active_psys(te, tselem, set);
break;
case TSE_POSE_BASE: case TSE_POSE_BASE:
return tree_element_active_pose(te, tselem, set); return tree_element_active_pose(te, tselem, set);
break; break;
@ -3203,6 +3228,8 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen
BIF_icon_draw(x, y, ICON_MODIFIER); break; BIF_icon_draw(x, y, ICON_MODIFIER); break;
case TSE_LINKED_OB: case TSE_LINKED_OB:
BIF_icon_draw(x, y, ICON_OBJECT); break; BIF_icon_draw(x, y, ICON_OBJECT); break;
case TSE_LINKED_PSYS:
BIF_icon_draw(x, y, ICON_PARTICLES); break;
case TSE_MODIFIER: case TSE_MODIFIER:
{ {
Object *ob= (Object *)tselem->id; Object *ob= (Object *)tselem->id;
@ -3230,6 +3257,9 @@ static void tselem_draw_icon(float x, float y, TreeStoreElem *tselem, TreeElemen
BIF_icon_draw(x, y, ICON_MOD_SOFT); break; BIF_icon_draw(x, y, ICON_MOD_SOFT); break;
case eModifierType_Boolean: case eModifierType_Boolean:
BIF_icon_draw(x, y, ICON_MOD_BOOLEAN); break; BIF_icon_draw(x, y, ICON_MOD_BOOLEAN); break;
case eModifierType_ParticleSystem:
case eModifierType_ParticleInstance:
BIF_icon_draw(x, y, ICON_PARTICLES); break;
default: default:
BIF_icon_draw(x, y, ICON_DOT); break; BIF_icon_draw(x, y, ICON_DOT); break;
} }