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.
This commit is contained in:
Campbell Barton
2013-01-30 11:06:02 +00:00
parent 43af754e4f
commit c8015a2788
3 changed files with 45 additions and 24 deletions

View File

@@ -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);
block = uiLayoutGetBlock(pa->layout);
if (WM_operator_poll((bContext *)C, op->type)) {
uiBlock *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)

View File

@@ -101,22 +101,33 @@ static void view3d_panel_operator_redo_operator(const bContext *C, Panel *pa, wm
static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
{
wmOperator *op = WM_operator_last_redo(C);
uiBlock *block;
if (op == NULL)
return;
if (WM_operator_poll((bContext *)C, op->type) == 0)
return;
block = uiLayoutGetBlock(pa->layout);
if (!WM_operator_check_ui_enabled(C, op->type->name))
uiLayoutSetEnabled(pa->layout, FALSE);
ARegion *ar;
ARegion *ar1;
/* note, blockfunc is a default but->func, use Handle func to allow button callbacks too */
uiBlockSetHandleFunc(block, ED_undo_operator_repeat_cb_evt, op);
view3d_panel_operator_redo_operator(C, pa, op);
if (op == NULL) {
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);
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);
view3d_panel_operator_redo_operator(C, pa, op);
}
/* set region back */
CTX_wm_region_set((bContext *)C, ar);
}
/* ******************* */

View File

@@ -339,6 +339,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
wmWindowManager *wm = CTX_wm_manager(C);
struct Scene *scene = CTX_data_scene(C);
/* keep in sync with logic in view3d_panel_operator_redo() */
ARegion *ar = CTX_wm_region(C);
ARegion *ar1 = BKE_area_find_region_type(CTX_wm_area(C), RGN_TYPE_WINDOW);