42 float dvec[3], vb[2], xscale, yscale;
80 MEM_SAFE_DELETE(depth_temp.
depths);
122 vb[0] = region->
winx;
123 vb[1] = region->
winy;
125 dist_new = rv3d->
dist;
145 xy_delta[0] = (rect.
xmin + rect.
xmax - vb[0]) / 2.0f;
146 xy_delta[1] = (rect.
ymin + rect.
ymax - vb[1]) / 2.0f;
155 dist_new *=
max_ff(xscale, yscale);
160 dist_new = rv3d->
dist * (rv3d->
dist / dist_new);
170 if (is_camera_lock) {
178 sview_params.
ofs = ofs_new;
179 sview_params.
dist = &dist_new;
203 ot->
name =
"Zoom to Border";
204 ot->
description =
"Zoom in the view to the nearest object contained in the border";
205 ot->
idname =
"VIEW3D_OT_zoom_border";
#define DEFAULT_SENSOR_WIDTH
#define RV3D_LOCK_FLAGS(rv3d)
Read Blender memory allocation and freeing.
MINLINE void negate_v3_v3(float r[3], const float a[3])
ScrArea * CTX_wm_area(const bContext *C)
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
void BLI_rcti_resize_y(struct rcti *rect, int y)
void VIEW3D_OT_zoom_border(wmOperatorType *ot)
wmOperatorStatus WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void view3d_depths_rect_create(ARegion *region, rcti *rect, ViewDepths *r_d)
int WM_operator_smooth_viewtx_get(const wmOperator *op)
void BLI_rcti_resize_x(struct rcti *rect, int x)
void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, eRegionView3D_Persp persp)
void view3d_operator_needs_gpu(const bContext *C)
bool ED_view3d_unproject_v3(const ARegion *region, float regionx, float regiony, float regionz, float world[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BKE_report(ReportList *reports, eReportType type, const char *message)
static wmOperatorStatus view3d_zoom_border_exec(bContext *C, wmOperator *op)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
void WM_operator_properties_border_to_rcti(wmOperator *op, rcti *r_rect)
void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
void WM_operator_properties_gesture_box_zoom(wmOperatorType *ot)
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3])
RegionView3D * CTX_wm_region_view3d(const bContext *C)
static bool view3d_zoom_border_poll(bContext *C)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Bounds< float > ED_view3d_dist_soft_range_get(const View3D *v3d, bool use_persp_range)
wmOperatorStatus WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
bool view3d_zoom_or_dolly_poll(bContext *C)
MINLINE float max_ff(float a, float b)
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
float view3d_depth_near(ViewDepths *d)
ARegion * CTX_wm_region(const bContext *C)
void ED_view3d_smooth_view(bContext *C, View3D *v3d, ARegion *region, int smooth_viewtx, const V3D_SmoothParams *sview)
void view3d_boxview_sync(ScrArea *area, ARegion *region)
void ED_view3d_win_to_delta(const ARegion *region, const float xy_delta[2], float zfac, float r_out[3], bool precise=false)
View3D * CTX_wm_view3d(const bContext *C)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eRegionView3D_Persp persp
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(*) cancel(bContext *C, wmOperator *op)
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) modal(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type