From c8015a27888a4c87360b1af158fc9b70bd4112ae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 30 Jan 2013 11:06:02 +0000 Subject: fix [#33740] Incorecct UV mapping from camera view Bug was in fact that the options for this operator couldn't be accessed (unless you knew to press f6), now the redo panel sets the window area before polling. Now other operators that use the window region will show settings too. --- source/blender/editors/space_clip/clip_toolbar.c | 27 ++++++++++++++++-------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/space_clip') diff --git a/source/blender/editors/space_clip/clip_toolbar.c b/source/blender/editors/space_clip/clip_toolbar.c index 1bdf5214192..ad70abf5732 100644 --- a/source/blender/editors/space_clip/clip_toolbar.c +++ b/source/blender/editors/space_clip/clip_toolbar.c @@ -219,23 +219,32 @@ static void clip_panel_operator_redo_operator(const bContext *C, Panel *pa, wmOp static void clip_panel_operator_redo(const bContext *C, Panel *pa) { wmOperator *op = WM_operator_last_redo(C); - uiBlock *block; + ARegion *ar; + ARegion *ar1; if (op == NULL) return; - if (WM_operator_poll((bContext *)C, op->type) == 0) - return; + /* keep in sync with logic in ED_undo_operator_repeat() */ + ar = CTX_wm_region(C); + ar1 = BKE_area_find_region_type(CTX_wm_area(C), RGN_TYPE_WINDOW); + if (ar1) + CTX_wm_region_set((bContext *)C, ar1); + + if (WM_operator_poll((bContext *)C, op->type)) { + uiBlock *block = uiLayoutGetBlock(pa->layout); - block = uiLayoutGetBlock(pa->layout); + if (!WM_operator_check_ui_enabled(C, op->type->name)) + uiLayoutSetEnabled(pa->layout, FALSE); - if (!WM_operator_check_ui_enabled(C, op->type->name)) - uiLayoutSetEnabled(pa->layout, FALSE); + /* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */ + uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op); - /* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */ - uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op); + clip_panel_operator_redo_operator(C, pa, op); + } - clip_panel_operator_redo_operator(C, pa, op); + /* set region back */ + CTX_wm_region_set((bContext *)C, ar); } void ED_clip_tool_props_register(ARegionType *art) -- cgit v1.2.3