Fix T62057: Particle settings keyframes not showing in Graph Editor channels
authorJoshua Leung <aligorith@gmail.com>
Fri, 1 Mar 2019 13:10:43 +0000 (02:10 +1300)
committerJoshua Leung <aligorith@gmail.com>
Fri, 1 Mar 2019 13:30:31 +0000 (02:30 +1300)
In short, the settings to expand/collapse the Particles Animation Dopesheet expander
were no longer getting exposed, so the F-Curves attached to the particle settings
were not showing up in the channels list as that section was collapsed and couldn't
be opened from the UI.

Early on during the development of 2.8, we originally wanted to completely remove
the Particle System. Eventually that decision got walked back, and so particles
were reinstated. Well... most of the relevant code was! One of the areas that was
the most messed up during this process was the animation editor support for these
channels. It seems that there was almost a two-step removal process here -
the first pass tried to keep the channel definitions while removing all references
to particle stuff, while the second pass tried to remove the definitions completely
and/or re-added them in the wrong places, etc. To say the removal/reverting history is
here is "colourful" is an understatement...

source/blender/editors/animation/anim_channels_defines.c

index 29ae22c..d1cef1c 100644 (file)
@@ -2028,7 +2028,7 @@ static int acf_dspart_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settin
 
        switch (setting) {
                case ACHANNEL_SETTING_EXPAND: /* expanded */
-                       return 0;
+                       return PART_DS_EXPAND;
 
                case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */
                        return ADT_NLA_EVAL_OFF;
@@ -2046,18 +2046,22 @@ static int acf_dspart_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settin
 }
 
 /* get pointer to the setting */
-static void *acf_dspart_setting_ptr(bAnimListElem *UNUSED(ale), eAnimChannel_Settings setting, short *type)
+static void *acf_dspart_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
 {
+       ParticleSettings *part = (ParticleSettings *)ale->data;
+
        /* clear extra return data first */
        *type = 0;
 
        switch (setting) {
                case ACHANNEL_SETTING_EXPAND: /* expanded */
-                       return NULL;
+                       return GET_ACF_FLAG_PTR(part->flag, type);
 
                case ACHANNEL_SETTING_SELECT: /* selected */
                case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
                case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+                       if (part->adt)
+                               return GET_ACF_FLAG_PTR(part->adt->flag, type);
                        return NULL;
 
                default: /* unsupported */