Page MenuHome

Fix T87401: Drop down can apply the wrong modifier
AbandonedPublic

Authored by Falk David (filedescriptor) on Apr 14 2021, 3:50 PM.

Details

Summary

The "Apply" button in the drop-down would always apply the
a modifier that was currently under the mouse cursor. If the modifiers
were collapsed, which meant that it would usually apply the modifier
just below the correct one (or even no modifier at all if the cursor
happened to be right inbetween the two modifier panels).

The fix makes sure that the right modifier name is passed to the
OBJECT_OT_modifier_apply operator, which prevents it from using
the mouse cursor to get the modifier.

Diff Detail

Repository
rB Blender
Branch
T87401 (branched from master)
Build Status
Buildable 14058
Build 14058: arc lint + arc unit

Event Timeline

Falk David (filedescriptor) requested review of this revision.Apr 14 2021, 3:50 PM
Falk David (filedescriptor) created this revision.

Thanks! I meant to look into this yesterday but ran out of time. What about the other operators in this menu, do you think it's a problem there too?

Actually, it seems the real problem here is that we can't use the modifier from the context here, since that will be overridden by the "active modifier".
(compare the invoke functions for modifiers and grease pencil modifiers, where there is no active modifier).

I wonder if instead of this fix we should separate the "active_modifier" and "modifier" context data, similar to what we do for objects?

I have to be honest, I don't know the code well enough to have a good opinion about that.

From my current understanding, the active modifier is irrelevant in this situation. The "apply", "duplicate", ... operators either get called via the menu (which "knows" about its modifier) or via the shortcut (which gets the modifier with the cursor position).

Falk David (filedescriptor) planned changes to this revision.Apr 14 2021, 4:24 PM

I tested the other operators and, yea they don't work properly as well. Makes sense.

I committed a different solution in rBfe79935f0021. Thanks for the patch.