Fix T87264: Button to remove physics modifier doesn't work

This is caused by rB9f323e9bf79f. When hover shortcuts are used,
we cannot use the modifier from the context (which will be the
active modifier), or they won't be hover shortcuts anymore!

There didn't use to be an editor-level "modifier" context variable,
which is why this worked before.

The fix is simple, just specify the modifier name for this particular
remove button.

Differential Revision: https://developer.blender.org/D10870
This commit is contained in:
Hans Goudey 2021-04-07 09:12:34 -05:00
parent 15670ebb95
commit 02a7289fe3
Notes: blender-bot 2023-02-13 19:02:40 +01:00
Referenced by issue #87264, Physics (Collision, Cloth, Dynamic Paint, Soft Body, Fluid) cannot be removed (X button disfunctional)
1 changed files with 1 additions and 2 deletions

View File

@ -38,13 +38,12 @@ class PhysicButtonsPanel:
def physics_add(layout, md, name, type, typeicon, toggles):
row = layout.row(align=True)
if md:
row.context_pointer_set("modifier", md)
row.operator(
"object.modifier_remove",
text=name,
text_ctxt=i18n_contexts.default,
icon='X',
)
).modifier = md.name
if toggles:
row.prop(md, "show_viewport", text="")
row.prop(md, "show_render", text="")