Page MenuHome

Grease Pencil Dope Sheet can fail to display active GP object
Closed, ResolvedPublic

Description

Version: 2.80 stable (linux 64)

Like other Dope Sheet modes, the Grease Pencil Dope Sheet can be made to only display the keyframes/channels of selected objects, by using the "show_only_selected" option. This works as expected. However, an object can be not selected, but still active. In this context, it is possible to enter edit/draw/sculpt mode for a grease pencil object that is not selected, leading to an issue where the user may find themselves editing a GP object with no animation data visible in the dope sheet!

How to reproduce

  1. Open the attached file (with UI loading enabled)
  2. In object mode, select the GP Monkey
  3. tap A to deselect monkey
  4. Tab into edit mode
  5. Observe how the dope sheet does not display any info about Suzanne

It's pretty easy to run into this issue accidentally. Technically it makes sense, but from a design perspective, it is not helpful for the "show_only_selected" feature to hide an active GP object, especially if the user can still enter edit/draw/sculpt mode for that object.

Event Timeline

Antonio Vazquez (antoniov) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.

Changing this would probably mean that the active object should always to handled as selected in the context of this setting (so also for bones etc.). I'm not sure if there is any good reason for the current behavior. I agree it does make sense to show the active as well as the selected objects.

@William Reynish (billreynish), is there any reason for why the active object should not be handled as selected objects in this context?

Ooops, you were faster :D

There is one point here. The Dopesheet is reused for Annotations and this is not related to Active Object, so we need be careful about that.

Proposed fix (now when you enter in any mode, the object is always dsiplayed in Dopesheet):

diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 625a52fc800..5e0a4c70157 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1830,12 +1830,13 @@ static size_t animdata_filter_gpencil(bAnimContext *ac,
         }
 
         /* check selection and object type filters */
-        if ((ads->filterflag & ADS_FILTER_ONLYSEL) &&
-            !((base->flag & BASE_SELECTED) /*|| (base == scene->basact)*/)) {
-          /* only selected should be shown */
-          continue;
+        if (ob->mode == OB_MODE_OBJECT) {
+          if ((ads->filterflag & ADS_FILTER_ONLYSEL) &&
+              !((base->flag & BASE_SELECTED) /*|| (base == scene->basact)*/)) {
+            /* only selected should be shown */
+            continue;
+          }
         }
-
         /* check if object belongs to the filtering group if option to filter
          * objects by the grouped status is on
          * - used to ease the process of doing multiple-character choreographies

I have seen the Active Onlyis implemented for Annotations mainly.

It does make sense. Two notes however:

  • You should also update the comment.
  • The commented out (base == scene->basact) seems to have solved the same problem. Either remove this code, or use it again.