50 const bool skip_camera,
54 *r_only_center =
false;
56 if (skip_camera && (ob == v3d->
camera)) {
63 *r_only_center =
true;
73 const bool only_center,
95 const int smooth_viewtx)
122 if (
size < 0.0001f) {
149 sview.
dist = do_zoom ? &dist_new :
nullptr;
171 const int smooth_viewtx)
197 const bool use_all_regions,
198 const bool clip_bounds)
212 bool changed =
false;
221 bool only_center =
false;
247 const bool use_all_regions,
248 const bool clip_bounds,
266 const bool is_face_map = (region->
runtime->gizmo_map &&
274 bool changed =
false;
288 base_eval = base_eval->
next)
299 ob_eval = base_eval->
object;
309 scene_eval, view_layer_eval, v3d, obedit->
type, obedit->
mode, ob_eval_iter)
317 scene_eval, view_layer_eval, v3d, ob_eval->
type, ob_eval->
mode, ob_eval_iter)
322 ob_eval->object_to_world(), *
bounds);
338 scene_eval, view_layer_eval, v3d, ob_eval->
type, ob_eval->
mode, ob_eval_iter)
369 bool only_center =
false;
397 const float scale_margin)
405 Object *ob = base->object;
418 if (point[0] >= local_min[0] && point[1] >= local_min[1] && point[2] >= local_min[2] &&
419 point[0] <= local_max[0] && point[1] <= local_max[1] && point[2] <= local_max[2])
448 depsgraph, area, region, use_all_regions,
true);
461 if (!
bounds.has_value()) {
481 if (use_all_regions) {
496 ot->name =
"Frame All";
497 ot->description =
"View all objects in scene";
498 ot->idname =
"VIEW3D_OT_view_all";
531 depsgraph, area, region, use_all_regions,
true, &do_zoom);
533 if (!
bounds.has_value()) {
541 if (use_all_regions) {
556 ot->name =
"Frame Selected";
557 ot->description =
"Move the view to the selection center";
558 ot->idname =
"VIEW3D_OT_view_selected";
std::optional< blender::Bounds< blender::float3 > > BKE_pose_minmax(const Object *ob, bool use_select)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
#define FOREACH_OBJECT_IN_MODE_END
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
#define FOREACH_OBJECT_IN_MODE_BEGIN(_scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
ListBase * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
General operations, lookup, etc. for blender objects.
void BKE_object_minmax(Object *ob, blender::float3 &r_min, blender::float3 &r_max)
bool BKE_object_empty_image_frame_is_visible_in_view3d(const Object *ob, const RegionView3D *rv3d)
bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Scene *scene, Object *ob, blender::float3 &r_min, blender::float3 &r_max, bool use_hidden)
void BKE_paint_stroke_get_average(const Paint *paint, const Object *ob, float stroke[3])
Paint * BKE_paint_get_active_from_paintmode(Scene *sce, PaintMode mode)
bool BKE_paint_select_face_test(const Object *ob)
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_fff(float a, float b, float c)
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3(float r[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
#define INIT_MINMAX(min, max)
void DEG_id_tag_update(ID *id, unsigned int flags)
bool DEG_is_original(const T *id)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
T * DEG_get_original(T *id)
Scene * DEG_get_input_scene(const Depsgraph *graph)
#define BASE_SELECTED(v3d, base)
#define BASE_SELECTED_EDITABLE(v3d, base)
#define OBEDIT_FROM_OBACT(ob)
#define BASE_VISIBLE(v3d, base)
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
bool paintface_minmax(Object *ob, float r_min[3], float r_max[3])
int PE_minmax(Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, blender::float3 &min, blender::float3 &max)
bool ED_operator_region_view3d_active(bContext *C)
void ED_region_tag_redraw(ARegion *region)
float ED_view3d_radius_to_dist(const View3D *v3d, const ARegion *region, const Depsgraph *depsgraph, char persp, bool use_aspect, float radius)
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3])
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
float ED_view3d_dist_soft_min_get(const View3D *v3d, bool use_persp_range)
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Bounds< VecBase< T, 3 > > transform_bounds(const MatBase< T, D, D > &matrix, const Bounds< VecBase< T, 3 > > &bounds)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
VecBase< float, 3 > float3
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
ARegionRuntimeHandle * runtime
static MatBase identity()
struct wmOperatorType * type
bool ED_view3d_minmax_verts(const Scene *scene, Object *obedit, float min[3], float max[3])
void view3d_operator_properties_common(wmOperatorType *ot, const enum eV3D_OpPropFlag flag)
bool view3d_zoom_or_dolly_poll(bContext *C)
void ED_view3d_smooth_view_undo_begin(bContext *C, const ScrArea *area)
void ED_view3d_smooth_view(bContext *C, View3D *v3d, ARegion *region, int smooth_viewtx, const V3D_SmoothParams *sview)
@ V3D_OP_PROP_USE_ALL_REGIONS
void ED_view3d_smooth_view_force_finish(bContext *C, View3D *v3d, ARegion *region)
void ED_view3d_smooth_view_undo_end(bContext *C, const ScrArea *area, const char *undo_str, bool undo_grouped)
static void view3d_from_minmax_multi(bContext *C, View3D *v3d, const float min[3], const float max[3], const bool do_zoom, const int smooth_viewtx)
std::optional< blender::Bounds< float3 > > view3d_calc_minmax_visible(Depsgraph *depsgraph, ScrArea *area, ARegion *region, const bool use_all_regions, const bool clip_bounds)
bool view3d_calc_point_in_selected_bounds(Depsgraph *depsgraph, ViewLayer *view_layer, const View3D *v3d, const blender::float3 &point, const float scale_margin)
std::optional< blender::Bounds< float3 > > view3d_calc_minmax_selected(Depsgraph *depsgraph, ScrArea *area, ARegion *region, const bool use_all_regions, const bool clip_bounds, bool *r_do_zoom)
static bool view3d_object_skip_minmax(const View3D *v3d, const RegionView3D *rv3d, const Object *ob, const bool skip_camera, bool *r_only_center)
static void view3d_from_minmax(bContext *C, View3D *v3d, ARegion *region, const float min[3], const float max[3], bool do_zoom, const int smooth_viewtx)
void VIEW3D_OT_view_all(wmOperatorType *ot)
void VIEW3D_OT_view_selected(wmOperatorType *ot)
static wmOperatorStatus viewselected_exec(bContext *C, wmOperator *op)
static void view3d_object_calc_minmax(Depsgraph *depsgraph, Scene *scene, Object *ob_eval, const bool only_center, float3 &min, float3 &max)
static wmOperatorStatus view3d_all_exec(bContext *C, wmOperator *op)
bool WM_gizmomap_is_any_selected(const wmGizmoMap *gzmap)
bool WM_gizmomap_minmax(const wmGizmoMap *gzmap, bool, bool use_select, float r_min[3], float r_max[3])
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
int WM_operator_smooth_viewtx_get(const wmOperator *op)