Esempio n. 1
0
/* Repeat operator */
static int depthdropper_exec(bContext *C, wmOperator *op)
{
	/* init */
	if (depthdropper_init(C, op)) {
		/* cleanup */
		depthdropper_exit(C, op);

		return OPERATOR_FINISHED;
	}
	else {
		return OPERATOR_CANCELLED;
	}
}
/* Modal Operator init */
static int depthdropper_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
  /* init */
  if (depthdropper_init(C, op)) {
    WM_cursor_modal_set(CTX_wm_window(C), BC_EYEDROPPER_CURSOR);

    /* add temp handler */
    WM_event_add_modal_handler(C, op);

    return OPERATOR_RUNNING_MODAL;
  }
  else {
    return OPERATOR_CANCELLED;
  }
}