Bugfix #21029: Animation editor's channel-group check boxes behave oddly
authorJoshua Leung <aligorith@gmail.com>
Tue, 9 Feb 2010 08:38:45 +0000 (08:38 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 9 Feb 2010 08:38:45 +0000 (08:38 +0000)
This commit fixes the first issue in the report - deselecting unselected channels does not flush the change in state - which resulted in the channels of collapsed and unselected groups not getting unselected too (a consistency issue).

source/blender/editors/animation/anim_channels_edit.c

index fba6d56fcc6ae94bfb660cbe98887c37ddb4fc6b..ff0755484e340ebf656587ca199ea84a61460b2e 100644 (file)
@@ -1064,21 +1064,26 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *op)
        if (ANIM_animdata_get_context(C, &ac) == 0)
                return OPERATOR_CANCELLED;
        
+       /* get list of all channels that selection may need to be flushed to */
+       filter= ANIMFILTER_CHANNELS;
+       ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
        
        /* hide all channels not selected */
        filter= (ANIMFILTER_VISIBLE | ANIMFILTER_UNSEL);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
-       for (ale= anim_data.first; ale; ale= ale->next)
+       for (ale= anim_data.first; ale; ale= ale->next) {
+               /* clear setting first */
                ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_CLEAR);
+               
+               /* now also flush selection status as appropriate 
+                * NOTE: in some cases, this may result in repeat flushing being performed
+                */
+               ANIM_flush_setting_anim_channels(&ac, &all_data, ale, ACHANNEL_SETTING_VISIBLE, 0);
+       }
        
        BLI_freelistN(&anim_data);
        
-       
-       /* get list of all channels that selection may need to be flushed to */
-       filter= ANIMFILTER_CHANNELS;
-       ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
-       
        /* make all the selected channels visible */
        filter= (ANIMFILTER_VISIBLE | ANIMFILTER_SEL);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);