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:
authorCampbell Barton <ideasman42@gmail.com>2012-08-09 00:38:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-09 00:38:55 +0400
commit5e0f254afa8caed1febbe02130cc313a53149efe (patch)
tree859b5590307db3310e070b258c04697dabaac2a1 /source/blender/editors/space_view3d/view3d_edit.c
parent6cfb7f50d2856068f74125321a348e43b7c9c3d4 (diff)
utility functions for getting/setting rectangles for operators.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index e8612d675a7..20afe42763d 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2471,10 +2471,7 @@ static int render_border_exec(bContext *C, wmOperator *op)
rctf vb;
/* get border select values using rna */
- rect.xmin = RNA_int_get(op->ptr, "xmin");
- rect.ymin = RNA_int_get(op->ptr, "ymin");
- rect.xmax = RNA_int_get(op->ptr, "xmax");
- rect.ymax = RNA_int_get(op->ptr, "ymax");
+ WM_operator_properties_border_to_rcti(op, &rect);
/* calculate range */
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
@@ -2528,10 +2525,7 @@ void VIEW3D_OT_render_border(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
- RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
+ WM_operator_properties_border(ot);
}
/* ********************* Border Zoom operator ****************** */
@@ -2562,10 +2556,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
view3d_operator_needs_opengl(C);
/* get border select values using rna */
- rect.xmin = RNA_int_get(op->ptr, "xmin");
- rect.ymin = RNA_int_get(op->ptr, "ymin");
- rect.xmax = RNA_int_get(op->ptr, "xmax");
- rect.ymax = RNA_int_get(op->ptr, "ymax");
+ WM_operator_properties_border_to_rcti(op, &rect);
/* check if zooming in/out view */
gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
@@ -2710,11 +2701,7 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot)
ot->flag = 0;
/* rna */
- RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
+ WM_operator_properties_gesture_border(ot, FALSE);
}
/* sets the view to 1:1 camera/render-pixel */
@@ -3325,10 +3312,7 @@ static int view3d_clipping_exec(bContext *C, wmOperator *op)
bglMats mats;
rcti rect;
- rect.xmin = RNA_int_get(op->ptr, "xmin");
- rect.ymin = RNA_int_get(op->ptr, "ymin");
- rect.xmax = RNA_int_get(op->ptr, "xmax");
- rect.ymax = RNA_int_get(op->ptr, "ymax");
+ WM_operator_properties_border_to_rcti(op, &rect);
rv3d->rflag |= RV3D_CLIPPING;
rv3d->clipbb = MEM_callocN(sizeof(BoundBox), "clipbb");
@@ -3381,10 +3365,7 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
ot->flag = 0;
/* rna */
- RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
- RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
+ WM_operator_properties_border(ot);
}
/* ***************** 3d cursor cursor op ******************* */