Page MenuHome

Fix T97529: NLA track option buttons can be interacted with when hidden
ClosedPublic

Authored by Colin Basnett (cmbasnett) on May 6 2022, 1:13 AM.

Details

Summary

This fixes T97529: NLA track option buttons can be interacted with even when hidden.

The bug stems from the fact that there was duplicate input handling going on for the buttons: once in the normal button UI system, and then again in the mouse_nla_channels function. The logic in mouse_nla_channels does not inspect whether or not the setting button is there or not, it just assumes that it is.

This function should no longer be handling mouse input for buttons (there is even comment suggesting that the button handling to be deprecated) since the button UI system already handles it. Therefore, the button handling code has been removed from that mouse_nla_channels.

In addition, the redundant mouse button handling for pressing the "Push Down Action" button has also been removed from this function as well.

Diff Detail

Event Timeline

Colin Basnett (cmbasnett) requested review of this revision.May 6 2022, 1:13 AM
Colin Basnett (cmbasnett) created this revision.

LGTM (assume the notifier/update thingies match with what happens in achannel_setting_flush_widget_cb? -- havent checked that).

Sybren A. Stüvel (sybren) requested changes to this revision.May 6 2022, 10:56 AM

There are some compiler warnings:

blender/source/blender/editors/space_nla/nla_channels.c: In function ‘mouse_nla_channels’:
blender/source/blender/editors/space_nla/nla_channels.c:207:13: warning: variable ‘offset’ set but not used [-Wunused-but-set-variable]
  207 |       short offset;
      |             ^~~~~~
blender/source/blender/editors/space_nla/nla_channels.c:206:17: warning: unused variable ‘adt’ [-Wunused-variable]
  206 |       AnimData *adt = ale->adt;
      |                 ^~~

Apart from that, LGTM!

This revision now requires changes to proceed.May 6 2022, 10:56 AM
Colin Basnett (cmbasnett) edited the summary of this revision. (Show Details)

This removes a number of newly unused variables.

In addition, the redundant mouse button handling for pressing the "Push Down Action" button has also been removed from this function as well.

This revision is now accepted and ready to land.May 9 2022, 12:10 PM
Sybren A. Stüvel (sybren) retitled this revision from Fix T97529: NLA track option buttons can no longer be interacted with when hidden to Fix T97529: NLA track option buttons can be interacted with when hidden.May 9 2022, 12:10 PM

One more warning, will fix when I land the patch:

blender/source/blender/editors/space_nla/nla_channels.c: In function ‘mouse_nla_channels’:
blender/source/blender/editors/space_nla/nla_channels.c:62:42: warning: unused parameter ‘x’ [-Wunused-parameter]
   62 |     bContext *C, bAnimContext *ac, float x, int channel_index, short selectmode)
      |                                    ~~~~~~^