Blender V5.3
view3d_navigate_view_all.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BKE_armature.hh"
10#include "BKE_context.hh"
11#include "BKE_layer.hh"
12#include "BKE_library.hh"
13#include "BKE_object.hh"
14#include "BKE_paint.hh"
15#include "BKE_paint_types.hh"
16#include "BKE_scene.hh"
17#include "BKE_screen.hh"
18
19#include "BLI_bounds.hh"
20#include "BLI_listbase.hh"
21#include "BLI_math_matrix.hh"
22#include "BLI_math_vector_c.hh"
23
25
26#include "ED_mesh.hh"
27#include "ED_particle.hh"
28#include "ED_screen.hh"
29
30#include "WM_api.hh"
31#include "WM_message.hh"
32
33#include "RNA_access.hh"
34#include "RNA_define.hh"
35
36#include "view3d_intern.hh"
37#include "view3d_navigate.hh" /* own include */
38
39namespace blender {
40
41/* -------------------------------------------------------------------- */
46
47static bool view3d_object_skip_minmax(const View3D *v3d,
48 const RegionView3D *rv3d,
49 const Object *ob,
50 const bool skip_camera,
51 bool *r_only_center)
52{
53 BLI_assert(ob->id.orig_id == nullptr);
54 *r_only_center = false;
55
56 if (skip_camera && (ob == v3d->camera)) {
57 return true;
58 }
59
60 if ((ob->type == OB_EMPTY) && (ob->empty_drawtype == OB_EMPTY_IMAGE) &&
62 {
63 *r_only_center = true;
64 return false;
65 }
66
67 return false;
68}
69
71 Depsgraph *depsgraph, Object *ob_eval, const bool only_center, float3 &min, float3 &max)
72{
73 /* Account for duplis. */
74 if (BKE_object_minmax_dupli(depsgraph, ob_eval, min, max, false) == 0) {
75 /* Use if duplis aren't found. */
76 if (only_center) {
77 minmax_v3v3_v3(min, max, ob_eval->object_to_world().location());
78 }
79 else {
80 BKE_object_minmax(ob_eval, min, max);
81 }
82 }
83}
84
86 View3D *v3d,
87 ARegion *region,
88 const float min[3],
89 const float max[3],
90 bool do_zoom,
91 const int smooth_viewtx)
92{
93 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
94 float afm[3];
95 float size;
96
98
99 /* SMOOTHVIEW */
100 float ofs_new[3];
101 float dist_new;
102
103 sub_v3_v3v3(afm, max, min);
104 size = std::max({afm[0], afm[1], afm[2]});
105
106 if (do_zoom) {
108
109 if (rv3d->is_persp) {
110 if (rv3d->persp == RV3D_CAMOB && ED_view3d_camera_lock_check(v3d, rv3d)) {
111 persp = RV3D_CAMOB;
112 }
113 else {
114 persp = RV3D_PERSP;
115 }
116 }
117 else { /* ortho */
118 if (size < 0.0001f) {
119 /* bounding box was a single point so do not zoom */
120 do_zoom = false;
121 }
122 else {
123 /* adjust zoom so it looks nicer */
124 persp = RV3D_ORTHO;
125 }
126 }
127
128 if (do_zoom) {
129 Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
130 dist_new = ED_view3d_radius_to_dist(
131 v3d, region, depsgraph, persp, true, (size / 2) * VIEW3D_MARGIN);
132 if (rv3d->is_persp) {
133 /* Don't zoom closer than the near clipping plane. */
134 const float dist_min = ED_view3d_dist_soft_min_get(v3d, true);
135 CLAMP_MIN(dist_new, dist_min);
136 }
137 }
138 }
139
140 mid_v3_v3v3(ofs_new, min, max);
141 negate_v3(ofs_new);
142
143 V3D_SmoothParams sview = {nullptr};
144 sview.ofs = ofs_new;
145 sview.dist = do_zoom ? &dist_new : nullptr;
146 /* The caller needs to use undo begin/end calls. */
147 sview.undo_str = nullptr;
148
149 if (rv3d->persp == RV3D_CAMOB && !ED_view3d_camera_lock_check(v3d, rv3d)) {
150 rv3d->persp = RV3D_PERSP;
151 sview.camera_old = v3d->camera;
152 }
153
154 ED_view3d_smooth_view(C, v3d, region, smooth_viewtx, &sview);
155
156 /* Smooth-view does view-lock #RV3D_BOXVIEW copy. */
157}
158
163 View3D *v3d,
164 const float min[3],
165 const float max[3],
166 const bool do_zoom,
167 const int smooth_viewtx)
168{
169 ScrArea *area = CTX_wm_area(C);
170 for (ARegion &region : area->regionbase) {
171 if (region.regiontype == RGN_TYPE_WINDOW) {
172 RegionView3D *rv3d = static_cast<RegionView3D *>(region.regiondata);
173 /* when using all regions, don't jump out of camera view,
174 * but _do_ allow locked cameras to be moved */
175 if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) {
176 view3d_from_minmax(C, v3d, &region, min, max, do_zoom, smooth_viewtx);
177 }
178 }
179 }
180}
181
183
184/* -------------------------------------------------------------------- */
189
190std::optional<Bounds<float3>> view3d_calc_minmax_visible(Depsgraph *depsgraph,
191 ScrArea *area,
192 ARegion *region,
193 const bool use_all_regions,
194 const bool clip_bounds)
195{
196 /* NOTE: we could support calculating this without requiring a #View3D or #RegionView3D
197 * Currently this isn't needed. */
198
199 const View3D *v3d = area->spacedata.first_as<View3D>();
200 const RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
201 ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
202
203 float3 min, max;
205
206 bool changed = false;
207
208 const bool skip_camera = (ED_view3d_camera_lock_check(v3d, rv3d) ||
209 /* any one of the regions may be locked */
210 (use_all_regions && v3d->flag2 & V3D_LOCK_CAMERA));
211
212 /* Evaluated view layers should always be in sync with the evaluated scene and its collections.
213 */
214 BLI_assert(BKE_view_layer_is_synced(*view_layer_eval));
215 for (Base &base_eval : *BKE_view_layer_object_bases_get(view_layer_eval)) {
216 if (BASE_VISIBLE(v3d, &base_eval)) {
217 bool only_center = false;
218 Object *ob = DEG_get_original(base_eval.object);
219 if (view3d_object_skip_minmax(v3d, rv3d, ob, skip_camera, &only_center)) {
220 continue;
221 }
222 view3d_object_calc_minmax(depsgraph, base_eval.object, only_center, min, max);
223 changed = true;
224 }
225 }
226
227 if (changed) {
228 if (clip_bounds && RV3D_CLIPPING_ENABLED(v3d, rv3d)) {
229 /* This is an approximation, see function documentation for details. */
231 }
232 }
233
234 if (!changed) {
235 return std::nullopt;
236 }
237 return Bounds<float3>(min, max);
238}
239
240std::optional<Bounds<float3>> view3d_calc_minmax_selected(Depsgraph *depsgraph,
241 ScrArea *area,
242 ARegion *region,
243 const bool use_all_regions,
244 const bool clip_bounds,
245 bool *r_do_zoom)
246{
247 /* NOTE: we could support calculating this without requiring a #View3D or #RegionView3D
248 * Currently this isn't needed. */
249
250 const View3D *v3d = area->spacedata.first_as<View3D>();
251 const RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
252
253 Scene *scene = DEG_get_input_scene(depsgraph);
254 ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph);
255
256 const Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
257 ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
258
259 /* NOTE: evaluated data is _always_ expected to have up-to-date view-layers/collections data. */
260 BLI_assert(BKE_view_layer_is_synced(*view_layer_eval));
261 Object *ob_eval = BKE_view_layer_active_object_get(view_layer_eval);
262 Object *obedit = OBEDIT_FROM_OBACT(ob_eval);
263 const bool is_face_map = (region->runtime->gizmo_map &&
265 const bool skip_camera = (ED_view3d_camera_lock_check(v3d, rv3d) ||
266 /* any one of the regions may be locked */
267 (use_all_regions && v3d->flag2 & V3D_LOCK_CAMERA));
268
269 float3 min, max;
271 bool changed = false;
272
273 *r_do_zoom = true;
274
275 if (is_face_map) {
276 ob_eval = nullptr;
277 }
278
279 if (ob_eval && (ob_eval->mode & OB_MODE_WEIGHT_PAINT)) {
280 /* hard-coded exception, we look for the one selected armature */
281 /* this is weak code this way, we should make a generic
282 * active/selection callback interface once... */
283 Base *base_eval;
284 for (base_eval = BKE_view_layer_object_bases_get(view_layer_eval)->first(); base_eval;
285 base_eval = base_eval->next)
286 {
287 if (BASE_SELECTED_EDITABLE(v3d, base_eval)) {
288 if (base_eval->object->type == OB_ARMATURE) {
289 if (base_eval->object->mode & OB_MODE_POSE) {
290 break;
291 }
292 }
293 }
294 }
295 if (base_eval) {
296 ob_eval = base_eval->object;
297 }
298 }
299
300 constexpr Main *null_bmain = nullptr;
301 if (is_face_map) {
302 changed = WM_gizmomap_minmax(region->runtime->gizmo_map, true, true, min, max);
303 }
304 else if (obedit) {
305 /* only selected */
307 null_bmain, scene_eval, view_layer_eval, v3d, obedit->type, obedit->mode, ob_eval_iter)
308 {
309 changed |= ED_view3d_minmax_verts(scene_eval, ob_eval_iter, min, max);
310 }
312 }
313 else if (ob_eval && (ob_eval->mode & OB_MODE_POSE)) {
314 /* NOTE: Passing `bmain` here because this iterator ensures that view-layers are in sync.
315 * We already assert about it in code above. */
317 null_bmain, scene_eval, view_layer_eval, v3d, ob_eval->type, ob_eval->mode, ob_eval_iter)
318 {
319 const std::optional<Bounds<float3>> bounds = BKE_pose_minmax(ob_eval_iter, true);
320 if (bounds) {
322 ob_eval->object_to_world(), *bounds);
323 minmax_v3v3_v3(min, max, world_bounds.min);
324 minmax_v3v3_v3(min, max, world_bounds.max);
325 changed = true;
326 }
327 }
329 }
330 else if (BKE_paint_select_face_test(ob_eval)) {
331 changed = paintface_minmax(ob_eval, min, max);
332 }
333 else if (ob_eval && (ob_eval->mode & OB_MODE_PARTICLE_EDIT)) {
334 changed = PE_minmax(depsgraph, scene, view_layer, min, max);
335 }
336 else if (ob_eval && (ob_eval->mode & OB_MODE_SCULPT_CURVES)) {
337 /* NOTE: Passing `bmain` here because this iterator ensures that view-layers are in sync.
338 * We already assert about it in code above. */
340 null_bmain, scene_eval, view_layer_eval, v3d, ob_eval->type, ob_eval->mode, ob_eval_iter)
341 {
342 changed |= ED_view3d_minmax_verts(scene_eval, ob_eval_iter, min, max);
343 }
345 }
346 else if (ob_eval && (ob_eval->mode & (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT |
348 {
350 if (ob_eval->mode & OB_MODE_SCULPT) {
351 mode = PaintMode::Sculpt;
352 }
353 else if (ob_eval->mode & OB_MODE_VERTEX_PAINT) {
354 mode = PaintMode::Vertex;
355 }
356 else if (ob_eval->mode & OB_MODE_WEIGHT_PAINT) {
357 mode = PaintMode::Weight;
358 }
359 else if (ob_eval->mode & OB_MODE_TEXTURE_PAINT) {
361 }
365 changed = true;
366 *r_do_zoom = false;
367 }
368 else {
369 for (Base &base_eval : *BKE_view_layer_object_bases_get(view_layer_eval)) {
370 if (BASE_SELECTED(v3d, &base_eval)) {
371 bool only_center = false;
372 Object *ob = DEG_get_original(base_eval.object);
373 if (view3d_object_skip_minmax(v3d, rv3d, ob, skip_camera, &only_center)) {
374 continue;
375 }
376 view3d_object_calc_minmax(depsgraph, base_eval.object, only_center, min, max);
377 changed = true;
378 }
379 }
380 }
381
382 if (changed) {
383 if (clip_bounds && RV3D_CLIPPING_ENABLED(v3d, rv3d)) {
384 /* This is an approximation, see function documentation for details. */
386 }
387 }
388
389 if (!changed) {
390 return std::nullopt;
391 }
392 return Bounds<float3>(min, max);
393}
394
395bool view3d_calc_point_in_selected_bounds(Depsgraph *depsgraph,
396 ViewLayer *view_layer,
397 const View3D *v3d,
398 const float3 &point,
399 const float scale_margin)
400{
401 for (const Base &base : *BKE_view_layer_object_bases_get(view_layer)) {
402 if (!BASE_SELECTED(v3d, &base)) {
403 continue;
404 }
405 Object *ob = base.object;
407
408 float3 min, max;
409 view3d_object_calc_minmax(depsgraph, ob, false, min, max);
410
412
413 bounds.scale_from_center(float3(scale_margin));
414
415 float3 local_min = math::transform_point(ob->object_to_world(), bounds.min);
416 float3 local_max = math::transform_point(ob->object_to_world(), bounds.max);
417
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])
420 {
421 return true;
422 }
423 }
424 return false;
425}
426
428
429/* -------------------------------------------------------------------- */
434
436{
437 ScrArea *area = CTX_wm_area(C);
438 ARegion *region = CTX_wm_region(C);
439 View3D *v3d = CTX_wm_view3d(C);
440 Scene *scene = CTX_data_scene(C);
441
442 const bool use_all_regions = RNA_boolean_get(op->ptr, "use_all_regions");
443 const bool center = RNA_boolean_get(op->ptr, "center");
444 const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
445
446 Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
447 std::optional<Bounds<float3>> bounds = view3d_calc_minmax_visible(
448 depsgraph, area, region, use_all_regions, true);
449 if (center) {
450 /* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */
451 View3DCursor *cursor = &scene->cursor;
452
453 cursor->set_matrix(float4x4::identity(), false);
454
456 WM_msg_publish_rna_prop(mbus, &scene->id, &scene->cursor, View3DCursor, location);
457
459 }
460
461 if (!bounds.has_value()) {
462 ED_region_tag_redraw(region);
463 /* TODO: should this be cancel?
464 * I think no, because we always move the cursor, with or without
465 * object, but in this case there is no change in the scene,
466 * only the cursor so I choice a ED_region_tag like
467 * view3d_smooth_view do for the center_cursor.
468 * See bug #22640.
469 */
470 return OPERATOR_FINISHED;
471 }
472
473 float3 &min = bounds.value().min;
474 float3 &max = bounds.value().max;
475
476 if (center) {
477 minmax_v3v3_v3(min, max, float3(0.0f));
478 }
479
481 if (use_all_regions) {
482 view3d_from_minmax_multi(C, v3d, min, max, true, smooth_viewtx);
483 }
484 else {
485 view3d_from_minmax(C, v3d, region, min, max, true, smooth_viewtx);
486 }
487
488 ED_view3d_smooth_view_undo_end(C, area, op->type->name, false);
489
490 return OPERATOR_FINISHED;
491}
492
494{
495 /* identifiers */
496 ot->name = "Frame All";
497 ot->description = "View all objects in scene";
498 ot->idname = "VIEW3D_OT_view_all";
499
500 /* API callbacks. */
501 ot->exec = view3d_all_exec;
503
504 /* flags */
505 ot->flag = 0;
506
507 /* properties */
509 RNA_def_boolean(ot->srna, "center", false, "Center", "");
510}
511
513
514/* -------------------------------------------------------------------- */
519
521{
522 ScrArea *area = CTX_wm_area(C);
523 ARegion *region = CTX_wm_region(C);
524 View3D *v3d = CTX_wm_view3d(C);
525 bool do_zoom = true;
526 const bool use_all_regions = RNA_boolean_get(op->ptr, "use_all_regions");
527 const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
528
529 Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
530 const std::optional<Bounds<float3>> bounds = view3d_calc_minmax_selected(
531 depsgraph, area, region, use_all_regions, true, &do_zoom);
532
533 if (!bounds.has_value()) {
534 return OPERATOR_FINISHED;
535 }
536
537 const float3 &min = bounds.value().min;
538 const float3 &max = bounds.value().max;
539
541 if (use_all_regions) {
542 view3d_from_minmax_multi(C, v3d, min, max, do_zoom, smooth_viewtx);
543 }
544 else {
545 view3d_from_minmax(C, v3d, region, min, max, do_zoom, smooth_viewtx);
546 }
547
548 ED_view3d_smooth_view_undo_end(C, area, op->type->name, false);
549
550 return OPERATOR_FINISHED;
551}
552
554{
555 /* identifiers */
556 ot->name = "Frame Selected";
557 ot->description = "Move the view to the selection center";
558 ot->idname = "VIEW3D_OT_view_selected";
559
560 /* API callbacks. */
563
564 /* flags */
565 ot->flag = 0;
566
567 /* properties */
569}
570
572
573} // namespace blender
#define FOREACH_OBJECT_IN_MODE_BEGIN(_bmain, _scene, _view_layer, _v3d, _object_type, _object_mode, _instance)
Definition BKE_layer.hh:470
#define FOREACH_OBJECT_IN_MODE_END
Definition BKE_layer.hh:477
General operations, lookup, etc. for blender objects.
#define BASE_SELECTED_EDITABLE(v3d, base)
#define OBEDIT_FROM_OBACT(ob)
#define BASE_VISIBLE(v3d, base)
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
#define VIEW3D_MARGIN
#define C
Definition RandGen.cpp:29
#define INIT_MINMAX(min, max)
#define CLAMP_MIN(a, b)
btScalar max
float3 stroke_get_average(const Paint *paint, const Object *ob)
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)
BMesh Iterators.
void VIEW3D_OT_view_selected(wmOperatorType *ot)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ScrArea * CTX_wm_area(const bContext *C)
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
bool BKE_object_empty_image_frame_is_visible_in_view3d(const Object *ob, const RegionView3D *rv3d)
Definition object.cc:3877
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3])
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)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
float ED_view3d_radius_to_dist(const View3D *v3d, const ARegion *region, const Depsgraph *depsgraph, eRegionView3D_Persp persp, bool use_aspect, float radius)
void view3d_operator_properties_common(wmOperatorType *ot, const enum eV3D_OpPropFlag flag)
std::optional< Bounds< float3 > > BKE_pose_minmax(const Object *ob, bool use_select)
int WM_operator_smooth_viewtx_get(const wmOperator *op)
void VIEW3D_OT_view_all(wmOperatorType *ot)
void ED_view3d_smooth_view_undo_end(bContext *C, const ScrArea *area, const char *undo_str, bool undo_grouped)
static wmOperatorStatus viewselected_exec(bContext *C, wmOperator *op)
void ED_region_tag_redraw(ARegion *region)
Definition area.cc:681
int PE_minmax(Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, float3 &min, float3 &max)
float ED_view3d_dist_soft_min_get(const View3D *v3d, bool use_persp_range)
bool DEG_is_original(const T *id)
bool WM_gizmomap_minmax(const wmGizmoMap *gzmap, bool, bool use_select, float r_min[3], float r_max[3])
void BKE_object_minmax(Object *ob, float3 &r_min, float3 &r_max)
Definition object.cc:3842
ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
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)
bool paintface_minmax(Object *ob, float r_min[3], float r_max[3])
Definition editface.cc:671
void DEG_id_tag_update(ID *id, unsigned int flags)
@ OB_MODE_TEXTURE_PAINT
@ OB_MODE_SCULPT_CURVES
@ OB_MODE_PARTICLE_EDIT
bool BKE_view_layer_is_synced(const ViewLayer &view_layer)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
bool view3d_calc_point_in_selected_bounds(Depsgraph *depsgraph, struct ViewLayer *view_layer_eval, const View3D *v3d, const float3 &point, const float scale_margin)
MINLINE void negate_v3(float r[3])
ViewLayer * DEG_get_evaluated_view_layer(const Depsgraph *graph)
static wmOperatorStatus view3d_all_exec(bContext *C, wmOperator *op)
bool BKE_paint_select_face_test(const Object *ob)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
std::optional< Bounds< float3 > > view3d_calc_minmax_visible(Depsgraph *depsgraph, ScrArea *area, ARegion *region, bool use_all_regions, bool clip_bounds)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
std::optional< Bounds< float3 > > view3d_calc_minmax_selected(Depsgraph *depsgraph, ScrArea *area, ARegion *region, bool use_all_regions, bool clip_bounds, bool *r_do_zoom)
void ED_view3d_smooth_view_undo_begin(bContext *C, const ScrArea *area)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
T * DEG_get_original(T *id)
bool view3d_zoom_or_dolly_poll(bContext *C)
static void view3d_object_calc_minmax(Depsgraph *depsgraph, Object *ob_eval, const bool only_center, float3 &min, float3 &max)
Paint * BKE_paint_get_active_from_paintmode(Scene *sce, PaintMode mode)
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
Scene * DEG_get_input_scene(const Depsgraph *graph)
bool BKE_object_minmax_dupli(Depsgraph *depsgraph, Object *ob, float3 &r_min, float3 &r_max, bool use_hidden)
Definition object.cc:3999
bool ED_operator_region_view3d_active(bContext *C)
void ED_view3d_smooth_view_force_finish(bContext *C, View3D *v3d, ARegion *region)
Scene * CTX_data_scene(const bContext *C)
@ V3D_OP_PROP_USE_ALL_REGIONS
bool ED_view3d_minmax_verts(const Scene *scene, Object *obedit, float min[3], float max[3])
VecBase< float, 3 > float3
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
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)
bool WM_gizmomap_is_any_selected(const wmGizmoMap *gzmap)
ListBaseT< Base > * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
View3D * CTX_wm_view3d(const bContext *C)
static bool view3d_object_skip_minmax(const View3D *v3d, const RegionView3D *rv3d, const Object *ob, const bool skip_camera, bool *r_only_center)
#define min(a, b)
Definition sort.cc:38
bke::ARegionRuntime * runtime
eRegion_Type regiontype
struct Object * object
struct Base * next
Bounds()=default
struct ID * orig_id
Definition DNA_ID.h:502
eObject_EmptyDrawType empty_drawtype
eRegionView3D_Persp persp
View3DCursor cursor
ListBaseT< ARegion > regionbase
ListBaseT< SpaceLink > spacedata
eView3D_Flag2 flag2
struct Object * camera
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
struct wmOperatorType * type
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)