diff options
author | Janne Karhu <jhkarh@gmail.com> | 2009-07-24 23:36:08 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2009-07-24 23:36:08 +0400 |
commit | 9325f35d4c01fc6950a4d14badc8f8e5adbb276f (patch) | |
tree | ad6e2fd97a1539f82112066ac2dd457ec675d4a5 /source | |
parent | f24bcac43eab1238f933a227d8da84ee0d48a0c3 (diff) |
ParticleSettings animdata wasn't shown in graph editor, dope sheet and nla editor.
Tiny bug fix too: Had forgotten particle child length setting from do_versions so old files with child hair showed all hair with zero length.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 1 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels.c | 40 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 125 | ||||
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 4 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_draw.c | 39 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_header.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 38 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_header.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_channels.c | 19 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 42 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_header.c | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_particle_types.h | 3 |
14 files changed, 304 insertions, 15 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9f4a2456567..afab6fe608f 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9171,6 +9171,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } part->path_end = 1.0f; + part->clength = 1.0f; } /* set old pointcaches to have disk cache flag */ for(ob = main->object.first; ob; ob= ob->id.next) { diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 6cb00f9285b..6b31fbe25a9 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -48,6 +48,7 @@ #include "DNA_camera_types.h" #include "DNA_curve_types.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" @@ -981,6 +982,20 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode, } } break; + case ANIMTYPE_FILLPARTD: + { + Object *ob= (Object *)ale->data; + + // XXX - settings should really be moved out of ob->nlaflag + if ((onlysel == 0) || (ob->flag & SELECT)) { + if (setting == ACHANNEL_SETTING_EXPAND) { + if (mode == ACHANNEL_SETFLAG_TOGGLE) ob->nlaflag ^= OB_ADS_SHOWPARTS; + else if (mode == ACHANNEL_SETFLAG_ADD) ob->nlaflag |= OB_ADS_SHOWPARTS; + else ob->nlaflag &= ~OB_ADS_SHOWPARTS; + } + } + } + break; case ANIMTYPE_DSMAT: { @@ -1048,6 +1063,17 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode, } } break; + case ANIMTYPE_DSPART: + { + ParticleSettings *part= (ParticleSettings*)ale->data; + + if (ASUBCHANNEL_SEL_OK(ale)) { + if (setting == ACHANNEL_SETTING_EXPAND) { + ACHANNEL_SET_FLAG(part, mode, PART_DS_EXPAND); + } + } + } + break; case ANIMTYPE_GROUP: { @@ -1605,6 +1631,13 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh notifierFlags |= ND_ANIMCHAN_EDIT; } break; + case ANIMTYPE_FILLPARTD: + { + Object *ob= (Object *)ale->data; + ob->nlaflag ^= OB_ADS_SHOWPARTS; // XXX + notifierFlags |= ND_ANIMCHAN_EDIT; + } + break; case ANIMTYPE_DSMAT: { @@ -1648,6 +1681,13 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh notifierFlags |= ND_ANIMCHAN_EDIT; } break; + case ANIMTYPE_DSPART: + { + ParticleSettings *part= (ParticleSettings *)ale->data; + part->flag ^= PART_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; + } + break; case ANIMTYPE_GROUP: { diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index ecc8012f3ec..5676fee5bac 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -62,6 +62,7 @@ #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_space_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" @@ -484,6 +485,16 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s ale->datatype= ALE_NONE; } break; + case ANIMTYPE_FILLPARTD: + { + Object *ob= (Object *)data; + + ale->flag= FILTER_PART_OBJC(ob); + + ale->key_data= NULL; + ale->datatype= ALE_NONE; + } + break; case ANIMTYPE_DSMAT: { @@ -551,6 +562,17 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s ale->datatype= ALE_ACT; } break; + case ANIMTYPE_DSPART: + { + ParticleSettings *part= (ParticleSettings*)ale->data; + AnimData *adt= part->adt; + + ale->flag= FILTER_PART_OBJD(part); + + ale->key_data= (adt) ? adt->action : NULL; + ale->datatype= ALE_ACT; + } + break; case ANIMTYPE_GROUP: { @@ -1008,6 +1030,60 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads, return items; } +static int animdata_filter_dopesheet_particles (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode) +{ + bAnimListElem *ale=NULL; + Object *ob= base->object; + ParticleSystem *psys = ob->particlesystem.first; + int items= 0, first = 1; + + for(; psys; psys=psys->next) { + short ok = 0; + + if(ELEM(NULL, psys->part, psys->part->adt)) + continue; + + ANIMDATA_FILTER_CASES(psys->part, + { /* AnimData blocks - do nothing... */ }, + ok=1;, + ok=1;, + ok=1;) + if (ok == 0) continue; + + /* include particles-expand widget? */ + if (first && (filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) { + ale= make_new_animlistelem(ob, ANIMTYPE_FILLPARTD, base, ANIMTYPE_OBJECT, (ID *)ob); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + first = 0; + } + + /* add particle settings? */ + if (FILTER_PART_OBJC(ob) || (filter_mode & ANIMFILTER_CURVESONLY)) { + if ((filter_mode & ANIMFILTER_CHANNELS)){ + ale = make_new_animlistelem(psys->part, ANIMTYPE_DSPART, base, ANIMTYPE_OBJECT, (ID *)psys->part); + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } + } + + if (FILTER_PART_OBJD(psys->part) || (filter_mode & ANIMFILTER_CURVESONLY)) { + ANIMDATA_FILTER_CASES(psys->part, + { /* AnimData blocks - do nothing... */ }, + items += animdata_filter_nla(anim_data, psys->part->adt, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);, + items += animdata_filter_fcurves(anim_data, psys->part->adt->drivers.first, NULL, psys->part, ANIMTYPE_DSPART, filter_mode, (ID *)psys->part);, + items += animdata_filter_action(anim_data, psys->part->adt->action, filter_mode, psys->part, ANIMTYPE_DSPART, (ID *)psys->part);) + } + } + } + + /* return the number of items added to the list */ + return items; +} + static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode) { bAnimListElem *ale=NULL; @@ -1229,6 +1305,10 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B } if (obdata_ok) items += animdata_filter_dopesheet_obdata(anim_data, ads, base, filter_mode); + + /* particles */ + if(ob->particlesystem.first && !(ads->filterflag & ADS_FILTER_NOPART)) + items += animdata_filter_dopesheet_particles(anim_data, ads, base, filter_mode); /* return the number of items added to the list */ return items; @@ -1406,7 +1486,7 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int if (base->object) { Object *ob= base->object; Key *key= ob_get_key(ob); - short actOk=1, keyOk=1, dataOk=1, matOk=1; + short actOk=1, keyOk=1, dataOk=1, matOk=1, partOk=1; /* firstly, check if object can be included, by the following fanimors: * - if only visible, must check for layer and also viewport visibility @@ -1548,9 +1628,35 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int dataOk= 0; break; } + + /* particles */ + partOk = 0; + if(!(ads->filterflag & ADS_FILTER_NOPART) && ob->particlesystem.first) { + ParticleSystem *psys = ob->particlesystem.first; + for(; psys; psys=psys->next) { + if (psys->part) { + /* if particlesettings has relevant animation data, break */ + ANIMDATA_FILTER_CASES(psys->part, + { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(psys->part); + partOk=0; + }, + partOk= 1;, + partOk= 1;, + partOk= 1;) + } + + if (partOk) + break; + } + } + /* check if all bad (i.e. nothing to show) */ - if (!actOk && !keyOk && !dataOk && !matOk) + if (!actOk && !keyOk && !dataOk && !matOk && !partOk) continue; } else { @@ -1599,9 +1705,22 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bDopeSheet *ads, int dataOk= 0; break; } + + /* particles */ + partOk = 0; + if(ob->particlesystem.first) { + ParticleSystem *psys = ob->particlesystem.first; + for(; psys; psys=psys->next) { + if(psys->part && ANIMDATA_HAS_KEYS(psys->part)) { + partOk = 1; + break; + } + + } + } /* check if all bad (i.e. nothing to show) */ - if (!actOk && !keyOk && !dataOk && !matOk) + if (!actOk && !keyOk && !dataOk && !matOk && !partOk) continue; } diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 7cfc788177e..854b5390e8c 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -118,6 +118,7 @@ typedef enum eAnim_ChannelType { ANIMTYPE_FILLACTD, ANIMTYPE_FILLDRIVERS, ANIMTYPE_FILLMATD, + ANIMTYPE_FILLPARTD, ANIMTYPE_DSMAT, ANIMTYPE_DSLAM, @@ -125,6 +126,7 @@ typedef enum eAnim_ChannelType { ANIMTYPE_DSCUR, ANIMTYPE_DSSKEY, ANIMTYPE_DSWOR, + ANIMTYPE_DSPART, ANIMTYPE_SHAPEKEY, // XXX probably can become depreceated??? @@ -181,12 +183,14 @@ typedef enum eAnimFilter_Flags { #define EXPANDED_OBJC(ob) ((ob->nlaflag & OB_ADS_COLLAPSED)==0) /* 'Sub-object' channels (flags stored in Object block) */ #define FILTER_MAT_OBJC(ob) ((ob->nlaflag & OB_ADS_SHOWMATS)) +#define FILTER_PART_OBJC(ob) ((ob->nlaflag & OB_ADS_SHOWPARTS)) /* 'Sub-object' channels (flags stored in Data block) */ #define FILTER_SKE_OBJD(key) ((key->flag & KEYBLOCK_DS_EXPAND)) #define FILTER_MAT_OBJD(ma) ((ma->flag & MA_DS_EXPAND)) #define FILTER_LAM_OBJD(la) ((la->flag & LA_DS_EXPAND)) #define FILTER_CAM_OBJD(ca) ((ca->flag & CAM_DS_EXPAND)) #define FILTER_CUR_OBJD(cu) ((cu->flag & CU_DS_EXPAND)) +#define FILTER_PART_OBJD(part) ((part->flag & PART_DS_EXPAND)) /* 'Sub-object/Action' channels (flags stored in Action) */ #define SEL_ACTC(actc) ((actc->flag & ACT_SELECTED)) #define EXPANDED_ACTC(actc) ((actc->flag & ACT_COLLAPSED)==0) diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 2fd5b9bbd93..216ff3993dd 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -52,6 +52,7 @@ #include "DNA_camera_types.h" #include "DNA_curve_types.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" @@ -519,6 +520,22 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) strcpy(name, "Materials"); } break; + case ANIMTYPE_FILLPARTD: /* object particles (dopesheet) expand widget */ + { + Object *ob = (Object *)ale->data; + + group = 4; + indent = 1; + special = ICON_PARTICLE_DATA; + + if (FILTER_PART_OBJC(ob)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, "Particles"); + } + break; case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */ @@ -619,6 +636,23 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) strcpy(name, wo->id.name+2); } break; + case ANIMTYPE_DSPART: /* particle (dopesheet) expand widget */ + { + ParticleSettings *part= (ParticleSettings*)ale->data; + + group = 0; + indent = 0; + special = ICON_PARTICLE_DATA; + offset = 21; + + if (FILTER_PART_OBJD(part)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, part->id.name+2); + } + break; case ANIMTYPE_GROUP: /* action group */ @@ -671,8 +705,8 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) grp= fcu->grp; if (ale->id) { - /* special exception for materials */ - if (GS(ale->id->name) == ID_MA) { + /* special exception for materials and particles */ + if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) { offset= 21; indent= 1; } @@ -1083,6 +1117,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) case ANIMTYPE_FILLACTD: case ANIMTYPE_FILLMATD: + case ANIMTYPE_FILLPARTD: case ANIMTYPE_DSSKEY: case ANIMTYPE_DSWOR: { diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index f5c85d4d983..7820b231212 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -381,6 +381,7 @@ void action_header_buttons(const bContext *C, ARegion *ar) uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Lamps"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Cameras"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Curves"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(saction->ads.filterflag), 0, 0, 0, 0, "Display Particles"); uiBlockEndAlign(block); xco += 30; } diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index f8f613223db..67a93b2e786 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -52,6 +52,7 @@ #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" @@ -1038,6 +1039,22 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) strcpy(name, "Materials"); } break; + case ANIMTYPE_FILLPARTD: /* object particles (dopesheet) expand widget */ + { + Object *ob = (Object *)ale->data; + + group = 4; + indent = 1; + special = ICON_PARTICLE_DATA; + + if (FILTER_PART_OBJC(ob)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, "Particles"); + } + break; case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */ @@ -1138,6 +1155,23 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) strcpy(name, wo->id.name+2); } break; + case ANIMTYPE_DSPART: /* particle (dopesheet) expand widget */ + { + ParticleSettings *part= (ParticleSettings*)ale->data; + + group = 0; + indent = 0; + special = ICON_PARTICLE_DATA; + offset = 21; + + if (FILTER_PART_OBJD(part)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, part->id.name+2); + } + break; case ANIMTYPE_GROUP: /* action group */ @@ -1196,8 +1230,8 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) grp= fcu->grp; if (ale->id) { - /* special exception for materials */ - if (GS(ale->id->name) == ID_MA) { + /* special exception for materials and particles */ + if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) { offset= 21; indent= 1; } diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index eeede3ae95b..e4ce889a188 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -304,6 +304,7 @@ void graph_header_buttons(const bContext *C, ARegion *ar) uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Lamps"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Cameras"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Curves"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Particles"); uiBlockEndAlign(block); xco += 15; } diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 1ab348eb28e..79c2c94719c 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -38,6 +38,7 @@ #include "DNA_camera_types.h" #include "DNA_curve_types.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" @@ -185,6 +186,13 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho notifierFlags |= ND_ANIMCHAN_EDIT; } break; + case ANIMTYPE_FILLPARTD: + { + Object *ob= (Object *)ale->data; + ob->nlaflag ^= OB_ADS_SHOWPARTS; // XXX + notifierFlags |= ND_ANIMCHAN_EDIT; + } + break; case ANIMTYPE_DSMAT: { @@ -228,6 +236,13 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho notifierFlags |= ND_ANIMCHAN_EDIT; } break; + case ANIMTYPE_DSPART: + { + ParticleSettings *part= (ParticleSettings *)ale->data; + part->flag ^= PART_DS_EXPAND; + notifierFlags |= ND_ANIMCHAN_EDIT; + } + break; case ANIMTYPE_NLATRACK: { @@ -237,8 +252,8 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho /* offset for start of channel (on LHS of channel-list) */ if (ale->id) { - /* special exception for materials */ - if (GS(ale->id->name) == ID_MA) + /* special exception for materials and particles */ + if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) offset= 21 + NLACHANNEL_BUTTON_WIDTH; else offset= 14; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 9aa71187334..6809c7928ac 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -46,6 +46,7 @@ #include "DNA_key_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" +#include "DNA_particle_types.h" #include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" #include "DNA_world_types.h" @@ -693,6 +694,22 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) strcpy(name, "Materials"); } break; + case ANIMTYPE_FILLPARTD: /* object particles (dopesheet) expand widget */ + { + Object *ob = (Object *)ale->data; + + group = 4; + indent = 1; + special = ICON_PARTICLE_DATA; + + if (FILTER_PART_OBJC(ob)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, "Particles"); + } + break; case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */ @@ -793,6 +810,23 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) strcpy(name, wo->id.name+2); } break; + case ANIMTYPE_DSPART: /* particle (dopesheet) expand widget */ + { + ParticleSettings *part= (ParticleSettings*)ale->data; + + group = 0; + indent = 0; + special = ICON_PARTICLE_DATA; + offset = 21; + + if (FILTER_PART_OBJD(part)) + expand = ICON_TRIA_DOWN; + else + expand = ICON_TRIA_RIGHT; + + strcpy(name, part->id.name+2); + } + break; case ANIMTYPE_NLATRACK: /* NLA Track */ { @@ -801,8 +835,8 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) indent= 0; if (ale->id) { - /* special exception for materials */ - if (GS(ale->id->name) == ID_MA) { + /* special exception for materials and particles */ + if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) { offset= 21; indent= 1; } @@ -846,8 +880,8 @@ void draw_nla_channel_list (bAnimContext *ac, SpaceNla *snla, ARegion *ar) group = 5; if (ale->id) { - /* special exception for materials */ - if (GS(ale->id->name) == ID_MA) { + /* special exception for materials and particles */ + if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) { offset= 21; indent= 1; } diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index f159f440759..3f504441108 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -261,6 +261,7 @@ void nla_header_buttons(const bContext *C, ARegion *ar) uiDefIconButBitI(block, TOGN, ADS_FILTER_NOLAM, B_REDR, ICON_LAMP_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Lamps"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Cameras"); uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Curves"); + uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(snla->ads->filterflag), 0, 0, 0, 0, "Display Particles"); uiBlockEndAlign(block); xco += 15; } diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 4eddebc5b67..255b48bc9db 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -310,12 +310,13 @@ typedef enum DOPESHEET_FILTERFLAG { ADS_FILTER_NOCUR = (1<<13), ADS_FILTER_NOWOR = (1<<14), ADS_FILTER_NOSCE = (1<<15), + ADS_FILTER_NOPART = (1<<16), /* NLA-specific filters */ ADS_FILTER_NLA_NOACT = (1<<20), /* if the AnimData block has no NLA data, don't include to just show Action-line */ /* combination filters (some only used at runtime) */ - ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR), + ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR|ADS_FILTER_NOPART), } DOPESHEET_FILTERFLAG; /* DopeSheet general flags */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index ec4cad5c3b4..ae9d775a74a 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -487,6 +487,8 @@ extern Object workob; #define OB_ADS_SHOWCONS (1<<12) /* object's material channels */ #define OB_ADS_SHOWMATS (1<<13) + /* object's marticle channels */ +#define OB_ADS_SHOWPARTS (1<<14) /* ob->protectflag */ #define OB_LOCK_LOCX 1 diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 3d1dfff61cd..b71d390db5a 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -246,7 +246,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_REACT_MULTIPLE 2 #define PART_LOOP 4 -//#define PART_LOOP_INSTANT 8 + /* for dopesheet */ +#define PART_DS_EXPAND 8 #define PART_HAIR_GEOMETRY 16 |