Page MenuHome

Fix Adjust Last Operation popup for operators relying on button context
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 11 2020, 12:05 PM.

Details

Summary

This was reported for duplicating particle systems, then using F9 to
enable the 'Duplicate Settings' option (see T83317).
In this case, the operator gets the particle_system from (buttons)
context and if none can get found will duplicate all settings instead.

The reason why none gets found here is that buttons_context() doesnt
have a valid path when called from F9, it can be recomputed though to be
valid even from F9.

Not totally sure at which point ButsContextPath get invalid tbh, but it
seems safe to recompute if it is?

This was likely causing other operators (relying on buttons context)
from the Properties Editor to fail as well.

Fixes T83317

Diff Detail

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

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Dec 11 2020, 12:05 PM
Philipp Oeser (lichtwerk) created this revision.

This seems fine to initialize, temporary button space created for search properly handles freeing properly. I didn't see any other issues this could cause.

The comment should be expanded on though, path is cleared when global undo does a file-read which clears the path (see lib_link_workspace_layout_restore).

source/blender/editors/space_buttons/buttons_context.c
826

Better reference SCREEN_OT_redo_last as key bindings might change, and are more of a hassle to look up compared to operator ID's.

This revision is now accepted and ready to land.Dec 15 2020, 5:14 AM