46 const bool skip_camera,
50 *r_only_center =
false;
52 if (skip_camera && (ob == v3d->
camera)) {
59 *r_only_center =
true;
69 const bool only_center,
91 const int smooth_viewtx)
104 size =
max_fff(afm[0], afm[1], afm[2]);
118 if (size < 0.0001f) {
144 sview.
dist = ok_dist ? &new_dist :
nullptr;
166 const int smooth_viewtx)
207 float min[3], max[3];
208 bool changed =
false;
224 bool only_center =
false;
259 if (use_all_regions) {
314 bool ok =
false, ok_dist =
true;
332 base_eval = base_eval->
next)
343 ob_eval = base_eval->
object;
353 scene_eval, view_layer_eval, v3d, obedit->
type, obedit->
mode, ob_eval_iter)
361 scene_eval, view_layer_eval, v3d, ob_eval->
type, ob_eval->
mode, ob_eval_iter)
380 scene_eval, view_layer_eval, v3d, ob_eval->
type, ob_eval->
mode, ob_eval_iter)
397 bool only_center =
false;
419 if (use_all_regions) {
434 ot->
name =
"Frame Selected";
436 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)
Object * CTX_data_edit_object(const bContext *C)
RegionView3D * CTX_wm_region_view3d(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)
ViewLayer * CTX_data_view_layer(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, float r_min[3], float r_max[3])
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, float r_min[3], float r_max[3], bool use_hidden)
void BKE_paint_stroke_get_average(const Scene *scene, const Object *ob, float stroke[3])
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)
MINLINE float max_ff(float a, float b)
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])
MINLINE void zero_v3(float r[3])
#define INIT_MINMAX(min, max)
void DEG_id_tag_update(ID *id, unsigned int flags)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
Object * DEG_get_original_object(Object *object)
#define BASE_SELECTED(v3d, base)
#define BASE_SELECTED_EDITABLE(v3d, base)
#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)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
const Depsgraph * depsgraph
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)
static MatBase identity()
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
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 ok_dist, const int smooth_viewtx)
static void view3d_from_minmax(bContext *C, View3D *v3d, ARegion *region, const float min[3], const float max[3], bool ok_dist, const int smooth_viewtx)
static int viewselected_exec(bContext *C, wmOperator *op)
static bool view3d_object_skip_minmax(const View3D *v3d, const RegionView3D *rv3d, const Object *ob, const bool skip_camera, bool *r_only_center)
static int view3d_all_exec(bContext *C, wmOperator *op)
static void view3d_object_calc_minmax(Depsgraph *depsgraph, Scene *scene, Object *ob_eval, const bool only_center, float min[3], float max[3])
void VIEW3D_OT_view_all(wmOperatorType *ot)
void VIEW3D_OT_view_selected(wmOperatorType *ot)
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)