Animation Editors - Bugfixes:
authorJoshua Leung <aligorith@gmail.com>
Thu, 9 Apr 2009 07:26:49 +0000 (07:26 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 9 Apr 2009 07:26:49 +0000 (07:26 +0000)
* Collapse selected channels should now work for most channels. It still doesn't work for Action Groups for some reason...
* Objects are now deemed to only be selected in Animation Editors if the are selected (i.e. if they are active but not selected, they are no longer considered to be selected)
* Outliner updates when scrubbing the TimeLine. As a consequence, anim playback with an Outliner open is a bit slower now.

source/blender/editors/animation/anim_channels.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/space_outliner/space_outliner.c

index dfe093641c198b6226f39ad76fb20124ff56864e..4d200ca392de8a7e8676fddfeb4795fb8b991c77 100644 (file)
                else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag |= (sflag); \
                else                                                                    (channel)->flag &= ~(sflag); \
        }
+       
+/* set/clear/toggle macro, where the flag is negative 
+ *     - channel - channel with a 'flag' member that we're setting
+ *     - smode - 0=clear, 1=set, 2=toggle
+ *     - sflag - bitflag to set
+ */
+#define ACHANNEL_SET_FLAG_NEG(channel, smode, sflag) \
+       { \
+               if (smode == ACHANNEL_SETFLAG_TOGGLE)   (channel)->flag ^= (sflag); \
+               else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag &= ~(sflag); \
+               else                                                                    (channel)->flag |= (sflag); \
+       }
 
 /* -------------------------- Exposed API ----------------------------------- */
 
@@ -716,6 +728,10 @@ EnumPropertyItem prop_animchannel_settings_types[] = {
 
 /* ------------------- */
 
+/* macro to be used in setflag_anim_channels */
+#define ASUBCHANNEL_SEL_OK(ale) ( (onlysel == 0) || \
+               ((ale->id) && (GS(ale->id->name)==ID_OB) && (((Object *)ale->id)->flag & SELECT)) ) 
+
 /* Set/clear a particular flag (setting) for all selected + visible channels 
  *     setting: the setting to modify
  *     mode: eAnimChannels_SetFlag
@@ -748,6 +764,111 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
                                }
                        }
                                break;
+                       
+                       case ANIMTYPE_FILLACTD:
+                       {
+                               bAction *act= (bAction *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG_NEG(act, mode, ACT_COLLAPSED);
+                                       }
+                               }
+                       }
+                               break;
+                       case ANIMTYPE_FILLDRIVERS:
+                       {
+                               AnimData *adt= (AnimData *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG_NEG(adt, mode, ADT_DRIVERS_COLLAPSED);
+                                       }
+                               }
+                       }
+                               break;
+                       case ANIMTYPE_FILLMATD:
+                       {
+                               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_SHOWMATS;
+                                               else if (mode == ACHANNEL_SETFLAG_ADD)  ob->nlaflag |= OB_ADS_SHOWMATS;
+                                               else                                                                    ob->nlaflag &= ~OB_ADS_SHOWMATS;
+                                       }
+                               }
+                       }
+                               break;
+                                       
+                       case ANIMTYPE_DSMAT:
+                       {
+                               Material *ma= (Material *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG(ma, mode, MA_DS_EXPAND);
+                                       }
+                               }
+                       }
+                               break;
+                       case ANIMTYPE_DSLAM:
+                       {
+                               Lamp *la= (Lamp *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG(la, mode, LA_DS_EXPAND);
+                                       }
+                               }
+                       }
+                               break;
+                       case ANIMTYPE_DSCAM:
+                       {
+                               Camera *ca= (Camera *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG(ca, mode, CAM_DS_EXPAND);
+                                       }
+                               }
+                       }
+                               break;
+                       case ANIMTYPE_DSCUR:
+                       {
+                               Curve *cu= (Curve *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG(cu, mode, CU_DS_EXPAND);
+                                       }
+                               }
+                       }
+                               break;
+                       case ANIMTYPE_DSSKEY:
+                       {
+                               Key *key= (Key *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG(key, mode, KEYBLOCK_DS_EXPAND);
+                                       }
+                               }
+                       }
+                               break;
+                       case ANIMTYPE_DSWOR:
+                       {
+                               World *wo= (World *)ale->data;
+                               
+                               if (ASUBCHANNEL_SEL_OK(ale)) {
+                                       if (setting == ACHANNEL_SETTING_EXPAND) {
+                                               ACHANNEL_SET_FLAG(wo, mode, WO_DS_EXPAND);
+                                       }
+                               }
+                       }
+                               break;
+                               
                        case ANIMTYPE_GROUP:
                        {
                                bActionGroup *agrp= (bActionGroup *)ale->data;
index ea30fe83f3581a2df51d7bf6792d1b87fc1790ea..f8bf3f08bde7be6c145d8b82c8b2c04d340a7332 100644 (file)
@@ -869,7 +869,6 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad
 static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
 {
        bAnimListElem *ale=NULL;
-       Scene *sce= (Scene *)ads->source;
        Object *ob= base->object;
        Key *key= ob_get_key(ob);
        int items = 0;
@@ -877,7 +876,7 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
        /* add this object as a channel first */
        if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) {
                /* check if filtering by selection */
-               if (ANIMCHANNEL_SELOK( ((base->flag & SELECT) || (base == sce->basact)) )) {
+               if ANIMCHANNEL_SELOK((base->flag & SELECT)) {
                        ale= make_new_animlistelem(base, ANIMTYPE_OBJECT, NULL, ANIMTYPE_NONE, NULL);
                        if (ale) {
                                BLI_addtail(anim_data, ale);
index 991349d3ed83f1414bcd1895446d007d5e2becb2..b7a59822e71258b65de7e26e78851c9488d07abd 100644 (file)
@@ -327,7 +327,7 @@ static int toggle_time_exec(bContext *C, wmOperator *op)
                        saction->flag ^= SACTION_DRAWTIME;
                }
                        break;
-               case SPACE_IPO: /* IPO Editor */
+               case SPACE_IPO: /* Graph Editor */
                {
                        SpaceIpo *sipo= (SpaceIpo *)CTX_wm_space_data(C);
                        sipo->flag ^= SIPO_DRAWTIME;
index 4add1e889860cea11086b31d5007a50b04c10442..e0dc54ee3779315f61b39a2b5f0606c961adc114 100644 (file)
@@ -120,6 +120,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
                                case ND_OB_SELECT:
                                case ND_MODE:
                                case ND_KEYINGSET:
+                               case ND_FRAME:
                                        ED_region_tag_redraw(ar);
                                        break;
                        }