Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2020-12-11 14:04:30 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-12-15 21:10:35 +0300
commit3834dc2f7b38a8a29b8cd6dbcd55ac5be7890553 (patch)
tree28d4ba4eabd89723d2b7eca9c2c6756638dc24e3 /source/blender/editors/space_buttons
parentffe63b0440cb55dee7a0ec3c383cce99167b47a1 (diff)
Fix Adjust Last Operation popup for operators relying on button context
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/SCREEN_OT_redo_last, path is cleared when global undo does a file-read which clears the path (see lib_link_workspace_layout_restore). It can be recomputed though to be valid even from redo_last (at least when in the Properties Editor). This was likely causing other operators (relying on buttons context) from the Properties Editor to fail as well. Fixes T83317 Maniphest Tasks: T83317 Differential Revision: https://developer.blender.org/D9825
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 3a2b8cf0115..c1f29231f96 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -826,6 +826,11 @@ int /*eContextResult*/ buttons_context(const bContext *C,
bContextDataResult *result)
{
SpaceProperties *sbuts = CTX_wm_space_properties(C);
+ if (sbuts && sbuts->path == NULL) {
+ /* path is cleared for SCREEN_OT_redo_last, when global undo does a file-read which clears the
+ * path (see lib_link_workspace_layout_restore). */
+ buttons_context_compute(C, sbuts);
+ }
ButsContextPath *path = sbuts ? sbuts->path : NULL;
if (!path) {