ParticleSettings animdata wasn't shown in graph editor, dope sheet and nla editor.
authorJanne Karhu <jhkarh@gmail.com>
Fri, 24 Jul 2009 19:36:08 +0000 (19:36 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Fri, 24 Jul 2009 19:36:08 +0000 (19:36 +0000)
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.

14 files changed:
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_channels.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_header.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_header.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_nla/nla_header.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_particle_types.h

index 9f4a24565671e23b297ecbd8590947f8542d2581..afab6fe608f1195886fda39c3ba5e464e3c4d10a 100644 (file)
@@ -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) {
index 6cb00f9285b7c47a68b8c9ee461aa455df29655c..6b31fbe25a9fa72a7b9aad47b7f17773b5afa74f 100644 (file)
@@ -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: 
                {
index ecc8012f3ec9dd6e7505a12f00b0600b01c6f078..5676fee5bac4ac9495ef2b2cf1fb51e881856f22 100644 (file)
@@ -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"
@@ -480,6 +481,16 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
                                
                                ale->flag= FILTER_MAT_OBJC(ob);
                                
+                               ale->key_data= NULL;
+                               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;
                        }
@@ -547,6 +558,17 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s
                                
                                ale->flag= FILTER_WOR_SCED(wo); 
                                
+                               ale->key_data= (adt) ? adt->action : NULL;
+                               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;
                        }
@@ -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;
                        }
                        
index 7cfc788177e43d04473782ee494787be15f8fd06..854b5390e8c81f8830d286acf165b3689cd468b0 100644 (file)
@@ -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)
index 2fd5b9bbd93983037c49bb7a199a86255e59a6d5..216ff3993dde69613d431958bd5ec866ca951b62 100644 (file)
@@ -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:
                                                {
index f5c85d4d9834b0f68790b8534b7057ff6cdfacd7..7820b231212bac48bbf39ea6c4f9a54567b3969a 100644 (file)
@@ -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;
                }
index f8f613223db2c3cb035bf81d09ff66fec91ca0b4..67a93b2e786a859b7fb5c10923ae87492fca5af3 100644 (file)
@@ -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;
                                                }
index eeede3ae95bac53e8a7b9ffe59779ba661be0ec4..e4ce889a188a18b5cc79e680691cee3f2633d05a 100644 (file)
@@ -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;
        }
index 1ab348eb28ea034cfb0092920317dbf3d298a2fd..79c2c94719c4a9ac9e38a4e506f06468e74fbc4a 100644 (file)
@@ -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;
index 9aa7118733414a53536fc76fe8390dc8cf9b4db8..6809c7928ac23abfff3e67c5038d6ec299daa494 100644 (file)
@@ -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;
                                                }
index f159f440759acd7385d04d5a2b11fd14f2fb4d84..3f5044411081a96e2a2120a58c55c5bc30da0fb1 100644 (file)
@@ -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;
        }
index 4eddebc5b6796f61e6aa2f19b1bdb00e6ef2e5e0..255b48bc9dbb92dcd88d870a3c607355c3d4b50c 100644 (file)
@@ -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 */
index ec4cad5c3b4aa5348eac17adb7a2606e4fc4db3a..ae9d775a74aee6f31f3eb1d5693221140846fc2e 100644 (file)
@@ -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
index 3d1dfff61cdb79243e26eba85f1c16ef0e0ad27a..b71d390db5a89b79cf45a144127b56efd275bc37 100644 (file)
@@ -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