Page MenuHome

Fix T101547: Add update notifiers in dopesheet and timeline selection operators
ClosedPublic

Authored by Amelie Fondevilla (afonde) on Oct 3 2022, 2:51 PM.

Details

Summary

Fix T101547

In multiframe mode, selected grease pencil keyframes were not displayed on viewport when selected from the timeline or the dopesheet in main mode.
Update notifiers were added for grease pencil in selection operators when called from dopesheet (grease pencil or main mode) and timeline, which are the only animation containers that may contain grease pencil keyframes.

Diff Detail

Repository
rB Blender

Event Timeline

Amelie Fondevilla (afonde) requested review of this revision.Oct 3 2022, 2:51 PM
Amelie Fondevilla (afonde) created this revision.
Amelie Fondevilla (afonde) edited the summary of this revision. (Show Details)
  • notify change in channel anim fix for non gp containers

Nice catch. Although it solves the immediate problem, to me it feels like it doesn't address the underlying issue. The old if (ac.datatype == ANIMCONT_GPENCIL) basically asks the question "can this datatype be showing grease pencil data?". It would be good to apply the "single responsibility" principle here, and move the responsibility of answering this question to its own function. I'm thinking something like bool BKE_animdata_can_have_greasepencil(eAnimCont_Types type). That way, if GP data is ever shown in other anim contexts as well, there's just one place to adjust this.

Do you think you can add that to this patch? It might be cleaner to first introduce

bool BKE_animdata_can_have_greasepencil(eAnimCont_Types type) {
  return ac.datatype == ANIMCONT_GPENCIL;
}

as a non-functional change in one patch, and then change the condition in that function in another patch. That's more work though, so I'll leave the call to you.

The new function is now written : D16168

  • notify change in channel anim fix for non gp containers
  • update can have grease pencil function
This revision is now accepted and ready to land.Oct 7 2022, 11:38 AM