Revision: 17512
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17512
Author:   aligorith
Date:     2008-11-20 06:55:42 +0100 (Thu, 20 Nov 2008)

Log Message:
-----------
AnimSys2: Added data-type IPO's to DopeSheet 

* Added support for Material, Lamp, and Camera IPO's to DopeSheet
* Added appropriate filters for the added datatypes
* Fixed issues with Constraint Channels caused by a typo in an earlier commit

Modified Paths:
--------------
    branches/animsys2/source/blender/include/BIF_editaction.h
    branches/animsys2/source/blender/makesdna/DNA_action_types.h
    branches/animsys2/source/blender/makesdna/DNA_camera_types.h
    branches/animsys2/source/blender/makesdna/DNA_key_types.h
    branches/animsys2/source/blender/makesdna/DNA_lamp_types.h
    branches/animsys2/source/blender/makesdna/DNA_material_types.h
    branches/animsys2/source/blender/makesdna/DNA_object_types.h
    branches/animsys2/source/blender/src/drawaction.c
    branches/animsys2/source/blender/src/drawipo.c
    branches/animsys2/source/blender/src/editaction.c
    branches/animsys2/source/blender/src/editipo_lib.c
    branches/animsys2/source/blender/src/header_action.c

Modified: branches/animsys2/source/blender/include/BIF_editaction.h
===================================================================
--- branches/animsys2/source/blender/include/BIF_editaction.h   2008-11-20 
05:47:34 UTC (rev 17511)
+++ branches/animsys2/source/blender/include/BIF_editaction.h   2008-11-20 
05:55:42 UTC (rev 17512)
@@ -53,8 +53,13 @@
        ACTTYPE_FILLACTD,
        ACTTYPE_FILLIPOD,
        ACTTYPE_FILLCOND,
-       ACTTYPE_FILLSKED,
+       ACTTYPE_FILLMATD,
        
+       ACTTYPE_DSMAT,
+       ACTTYPE_DSLAM,
+       ACTTYPE_DSCAM,
+       ACTTYPE_DSSKEY,
+       
        ACTTYPE_ACHAN,
        ACTTYPE_CONCHAN,
        ACTTYPE_CONCHAN2,
@@ -71,7 +76,13 @@
 #define EXPANDED_OBJC(ob) ((ob->nlaflag & OB_ADS_COLLAPSED)==0)
 #define FILTER_IPO_OBJC(ob) ((ob->nlaflag & OB_ADS_SHOWIPO))
 #define FILTER_CON_OBJC(ob) ((ob->nlaflag & OB_ADS_SHOWCONS)) 
-#define FILTER_SKE_OBJC(key) ((key->flag & KEYBLOCK_EXPAND))
+#define FILTER_MAT_OBJC(ob) ((ob->nlaflag & OB_ADS_SHOWMATS))
+
+#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 SEL_ACTC(actc) ((actc->flag & ACTC_SELECTED))
 #define EXPANDED_ACTC(actc) ((actc->flag & ACTC_EXPANDED))
 

Modified: branches/animsys2/source/blender/makesdna/DNA_action_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_action_types.h        
2008-11-20 05:47:34 UTC (rev 17511)
+++ branches/animsys2/source/blender/makesdna/DNA_action_types.h        
2008-11-20 05:55:42 UTC (rev 17512)
@@ -255,6 +255,9 @@
        ADS_FILTER_NOIPOS                       = (1<<7),
        ADS_FILTER_NOACTS                       = (1<<8),
        ADS_FILTER_NOCONSTRAINTS        = (1<<9),
+       ADS_FILTER_NOCAM                        = (1<<10),
+       ADS_FILTER_NOMAT                        = (1<<11),
+       ADS_FILTER_NOLAM                        = (1<<12),
 } DOPESHEET_FILTERFLAG;        
 
 /* DopeSheet general flags */

Modified: branches/animsys2/source/blender/makesdna/DNA_camera_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_camera_types.h        
2008-11-20 05:47:34 UTC (rev 17511)
+++ branches/animsys2/source/blender/makesdna/DNA_camera_types.h        
2008-11-20 05:55:42 UTC (rev 17512)
@@ -76,6 +76,7 @@
 #define CAM_SHOWTITLESAFE      8
 #define CAM_SHOWNAME           16
 #define CAM_ANGLETOGGLE                32
+#define CAM_DS_EXPAND          64
 
 /* yafray: dof sampling switch */
 #define CAM_YF_NO_QMC  512

Modified: branches/animsys2/source/blender/makesdna/DNA_key_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_key_types.h   2008-11-20 
05:47:34 UTC (rev 17511)
+++ branches/animsys2/source/blender/makesdna/DNA_key_types.h   2008-11-20 
05:55:42 UTC (rev 17512)
@@ -85,8 +85,8 @@
 #define KEY_BSPLINE     2
 
 /* keyblock->flag */
-#define KEYBLOCK_MUTE  1
-#define KEYBLOCK_EXPAND        2
+#define KEYBLOCK_MUTE          1
+#define KEYBLOCK_DS_EXPAND     2
 
 #endif
 

Modified: branches/animsys2/source/blender/makesdna/DNA_lamp_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_lamp_types.h  2008-11-20 
05:47:34 UTC (rev 17511)
+++ branches/animsys2/source/blender/makesdna/DNA_lamp_types.h  2008-11-20 
05:55:42 UTC (rev 17512)
@@ -45,7 +45,7 @@
 typedef struct Lamp {
        ID id;
        
-       short type, pad3;
+       short type, flag;
        int mode;
        
        short colormodel, totex;
@@ -113,6 +113,9 @@
 
 /* **************** LAMP ********************* */
 
+/* flag */
+#define LA_DS_EXPAND   1
+
 /* type */
 #define LA_LOCAL               0
 #define LA_SUN                 1

Modified: branches/animsys2/source/blender/makesdna/DNA_material_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_material_types.h      
2008-11-20 05:47:34 UTC (rev 17511)
+++ branches/animsys2/source/blender/makesdna/DNA_material_types.h      
2008-11-20 05:55:42 UTC (rev 17512)
@@ -153,6 +153,8 @@
 /* flag */
                /* for render */
 #define MA_IS_USED             1
+               /* for dopesheet */
+#define MA_DS_EXPAND   2
 
 /* mode (is int) */
 #define MA_TRACEBLE            1

Modified: branches/animsys2/source/blender/makesdna/DNA_object_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_object_types.h        
2008-11-20 05:47:34 UTC (rev 17511)
+++ branches/animsys2/source/blender/makesdna/DNA_object_types.h        
2008-11-20 05:55:42 UTC (rev 17512)
@@ -477,9 +477,14 @@
 #define OB_NLA_OVERRIDE                (1<<0)
 #define OB_NLA_COLLAPSED       (1<<1)
 
+       /* object-channel expanded status */
 #define OB_ADS_COLLAPSED       (1<<10)
+       /* object's ipo-block */
 #define OB_ADS_SHOWIPO         (1<<11)
+       /* object's constraint channels */
 #define OB_ADS_SHOWCONS                (1<<12)
+       /* object's material channels */
+#define OB_ADS_SHOWMATS                (1<<13)
 
 /* ob->protectflag */
 #define OB_LOCK_LOCX   1

Modified: branches/animsys2/source/blender/src/drawaction.c
===================================================================
--- branches/animsys2/source/blender/src/drawaction.c   2008-11-20 05:47:34 UTC 
(rev 17511)
+++ branches/animsys2/source/blender/src/drawaction.c   2008-11-20 05:55:42 UTC 
(rev 17512)
@@ -49,6 +49,7 @@
 #include "DNA_listBase.h"
 #include "DNA_action_types.h"
 #include "DNA_armature_types.h"
+#include "DNA_camera_types.h"
 #include "DNA_curve_types.h"
 #include "DNA_ipo_types.h"
 #include "DNA_object_types.h"
@@ -57,6 +58,8 @@
 #include "DNA_space_types.h"
 #include "DNA_constraint_types.h"
 #include "DNA_key_types.h"
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
 #include "DNA_userdef_types.h"
 #include "DNA_gpencil_types.h"
 
@@ -616,38 +619,105 @@
                                        sprintf(name, "IPO Curves");
                                }
                                        break;
-                               case ACTTYPE_FILLSKED: /* shapekeys (dopesheet) 
expand widget */
+                               case ACTTYPE_FILLCOND: /* constraint channels 
(dopesheet) expand widget */
                                {
-                                       Key *key= (Key *)ale->data;
+                                       Object *ob = (Object *)ale->data;
                                        
                                        group = 4;
                                        indent = 1;
-                                       special = ICON_EDIT;
+                                       special = ICON_CONSTRAINT;
                                        
-                                       if (FILTER_SKE_OBJC(key))       
+                                       if (FILTER_CON_OBJC(ob))        
                                                expand = ICON_TRIA_DOWN;
                                        else
                                                expand = ICON_TRIA_RIGHT;
                                                
                                        //sel = SEL_OBJC(base);
-                                       sprintf(name, "Shape Keys");
+                                       sprintf(name, "Constraints");
                                }
                                        break;
-                               case ACTTYPE_FILLCOND: /* constraint channels 
(dopesheet) expand widget */
+                               case ACTTYPE_FILLMATD: /* object materials 
(dopesheet) expand widget */
                                {
                                        Object *ob = (Object *)ale->data;
                                        
                                        group = 4;
                                        indent = 1;
-                                       special = ICON_CONSTRAINT;
+                                       special = ICON_MATERIAL;
                                        
-                                       if (FILTER_CON_OBJC(ob))        
+                                       if (FILTER_MAT_OBJC(ob))
                                                expand = ICON_TRIA_DOWN;
                                        else
                                                expand = ICON_TRIA_RIGHT;
                                                
+                                       sprintf(name, "Materials");
+                               }
+                                       break;
+                               
+                               
+                               case ACTTYPE_DSMAT: /* single material 
(dopesheet) expand widget */
+                               {
+                                       Material *ma = (Material *)ale->data;
+                                       
+                                       group = 0;
+                                       indent = 0;
+                                       special = ICON_MATERIAL;
+                                       offset = 21;
+                                       
+                                       if (FILTER_MAT_OBJD(ma))
+                                               expand = ICON_TRIA_DOWN;
+                                       else
+                                               expand = ICON_TRIA_RIGHT;
+                                       
+                                       sprintf(name, ma->id.name+2);
+                               }
+                                       break;
+                               case ACTTYPE_DSLAM: /* lamp (dopesheet) expand 
widget */
+                               {
+                                       Lamp *la = (Lamp *)ale->data;
+                                       
+                                       group = 4;
+                                       indent = 1;
+                                       special = ICON_LAMP;
+                                       
+                                       if (FILTER_LAM_OBJD(la))
+                                               expand = ICON_TRIA_DOWN;
+                                       else
+                                               expand = ICON_TRIA_RIGHT;
+                                       
+                                       sprintf(name, la->id.name+2);
+                               }
+                                       break;
+                               case ACTTYPE_DSCAM: /* camera (dopesheet) 
expand widget */
+                               {
+                                       Camera *ca = (Camera *)ale->data;
+                                       
+                                       group = 4;
+                                       indent = 1;
+                                       special = ICON_CAMERA;
+                                       
+                                       if (FILTER_CAM_OBJD(ca))
+                                               expand = ICON_TRIA_DOWN;
+                                       else
+                                               expand = ICON_TRIA_RIGHT;
+                                       
+                                       sprintf(name, ca->id.name+2);
+                               }
+                                       break;
+                               case ACTTYPE_DSSKEY: /* shapekeys (dopesheet) 
expand widget */
+                               {
+                                       Key *key= (Key *)ale->data;
+                                       
+                                       group = 4;
+                                       indent = 1;
+                                       special = ICON_EDIT;
+                                       
+                                       if (FILTER_SKE_OBJD(key))       
+                                               expand = ICON_TRIA_DOWN;
+                                       else
+                                               expand = ICON_TRIA_RIGHT;
+                                               
                                        //sel = SEL_OBJC(base);
-                                       sprintf(name, "Constraints");
+                                       sprintf(name, "Shape Keys");
                                }
                                        break;
                                        
@@ -716,12 +786,26 @@
                                {
                                        bConstraintChannel *conchan = 
(bConstraintChannel *)ale->data;
                                        
-                                       indent = 2;
-                                       
                                        group= (ale->grp) ? 1 : 0;
                                        grp= ale->grp;
                                        
-                                       offset= (ale->id) ? 21 : 0;
+                                       if (ale->id) {
+                                               if (ale->ownertype == 
ACTTYPE_ACHAN) {
+                                                       /* for constraint 
channels under Action in Dopesheet */
+                                                       indent= 2;
+                                                       offset= 21;
+                                               }
+                                               else {
+                                                       /* for constraint 
channels under Object in Dopesheet */
+                                                       indent= 2;
+                                                       offset = 0;
+                                               }
+                                       }
+                                       else {
+                                               /* for normal constraint 
channels in Action Editor */
+                                               indent= 2;
+                                               offset= 0;
+                                       }
                                        
                                        if (EDITABLE_CONCHAN(conchan))
                                                protect = ICON_UNLOCKED;
@@ -749,8 +833,17 @@
                                        group= (ale->grp) ? 1 : 0;
                                        grp= ale->grp;
                                        
-                                       offset= (ale->id) ? 21 : 0;
+                                       //offset= ((ale->id) && 
(GS(ale->id->name) == ID_MA)) ? 21 : 0;
+                                       if (ale->id) {
+                                               if ((GS(ale->id->name)==ID_MA) 
|| (ale->ownertype == ACTTYPE_ACHAN))
+                                                       offset= 21;
+                                               else
+                                                       offset= 0;
+                                       }
+                                       else
+                                               offset= 0;
                                        
+                                       
                                        if (icu->flag & IPO_MUTE)
                                                mute = ICON_MUTE_IPO_ON;
                                        else    
@@ -1195,7 +1288,7 @@
                                        if (sel) glColor4ub(col1b[0], col1b[1], 
col1b[2], 0x45); 
                                        else glColor4ub(col1b[0], col1b[1], 
col1b[2], 0x22); 
                                }
-                               else if (ELEM3(ale->type, ACTTYPE_FILLIPOD, 
ACTTYPE_FILLACTD, ACTTYPE_FILLCOND)) {
+                               else if (ELEM4(ale->type, ACTTYPE_FILLIPOD, 
ACTTYPE_FILLACTD, ACTTYPE_FILLCOND, ACTTYPE_DSSKEY)) {
                                        // FIXME... how do we differentiate 
between the two modes?
                                        if (sel) glColor4ub(col2b[0], col2b[1], 
col2b[2], 0x45); 
                                        else glColor4ub(col2b[0], col2b[1], 
col2b[2], 0x22); 

Modified: branches/animsys2/source/blender/src/drawipo.c
===================================================================
--- branches/animsys2/source/blender/src/drawipo.c      2008-11-20 05:47:34 UTC 
(rev 17511)
+++ branches/animsys2/source/blender/src/drawipo.c      2008-11-20 05:55:42 UTC 
(rev 17512)
@@ -1334,8 +1334,8 @@
 /* draw lines for IPO-curve handles only (this is only done in EditMode) */
 static void draw_ipohandles(int sel)
 {
+       EditIpo *ei;

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to