|
Blender V5.0
|
#include "MEM_guardedalloc.h"#include "BLI_linklist.h"#include "BLI_listbase.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_rect.h"#include "BKE_action.hh"#include "BKE_context.hh"#include "BKE_global.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "BKE_modifier.hh"#include "BKE_object.hh"#include "BKE_report.hh"#include "BKE_scene.hh"#include "DEG_depsgraph_query.hh"#include "UI_resources.hh"#include "GPU_matrix.hh"#include "GPU_select.hh"#include "GPU_state.hh"#include "WM_api.hh"#include "ED_info.hh"#include "ED_object.hh"#include "ED_screen.hh"#include "DRW_engine.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "view3d_intern.hh"#include "view3d_navigate.hh"#include "DNA_camera_types.h"Go to the source code of this file.
Classes | |
| struct | DrawSelectLoopUserData |
|
static |
Implement VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK.
Definition at line 534 of file view3d_view.cc.
References BKE_object_is_mode_compat(), and Object::mode.
Referenced by view3d_gpu_select_ex().
|
static |
Implement VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK for special case when we want to select pose bones (this doesn't switch modes).
Definition at line 544 of file view3d_view.cc.
References BLI_linklist_index(), and DEG_get_original().
Referenced by view3d_gpu_select_ex().
|
static |
Definition at line 497 of file view3d_view.cc.
References BLI_assert, data, DRW_SELECT_PASS_POST, DRW_SELECT_PASS_PRE, GPU_select_begin_next(), and GPU_select_end().
Referenced by view3d_gpu_select_ex().
| bool ED_localview_exit_if_empty | ( | const Depsgraph * | depsgraph, |
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| wmWindowManager * | wm, | ||
| wmWindow * | win, | ||
| View3D * | v3d, | ||
| ScrArea * | area, | ||
| bool | frame_selected = true, | ||
| int | smooth_viewtx = 0 ) |
Exit 'local view' of given View3D editor, if it is active and there is nothing to display in it anymore.
| depsgraph | Optional, only required for #frame_selected. |
| frame_selected | Frame the newly out-of-local view to show currently visible selected objects. Will only do something if a valid depsgraph pointer is also provided. |
| smooth_viewtx | Smooth transition time (in milliseconds) between current view and final view, if changes are happening. Currently only used if #frame_selected is enabled. |
Definition at line 1032 of file view3d_view.cc.
References BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), depsgraph, View3D_Runtime::flag, LISTBASE_FOREACH, View3D::local_view_uid, View3D::localvd, View3D::runtime, V3D_RUNTIME_LOCAL_MAYBE_EMPTY, and view3d_localview_exit().
Referenced by localview_remove_from_exec(), and space_view3d_refresh().
| bool ED_operator_rv3d_user_region_poll | ( | bContext * | C | ) |
Definition at line 284 of file view3d_view.cc.
References C, and ED_view3d_context_user_region().
Referenced by VIEW3D_OT_object_as_camera(), VIEW3D_OT_view_axis(), VIEW3D_OT_view_camera(), VIEW3D_OT_view_orbit(), VIEW3D_OT_view_persportho(), and VIEW3D_OT_view_roll().
| void ED_view3d_local_collections_reset | ( | const bContext * | C, |
| const bool | reset_all ) |
Definition at line 1289 of file view3d_view.cc.
References BKE_layer_collection_local_sync(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), DEG_id_tag_update(), View3D::flag, ID_RECALC_BASE_FLAGS, LISTBASE_FOREACH, View3D::local_collections_uid, Main::screens, SPACE_VIEW3D, V3D_LOCAL_COLLECTIONS, and view3d_local_collections_reset().
Referenced by wm_open_mainfile__open().
See if current UUID is valid, otherwise set a valid UUID to v3d, Try to keep the same UUID previously used to allow users to quickly toggle back and forth.
Definition at line 1265 of file view3d_view.cc.
References View3D::flag, free_localcollection_bit(), View3D::local_collections_uid, reset(), V3D_LOCAL_COLLECTIONS, and view3d_local_collections_reset().
| eV3DSelectObjectFilter ED_view3d_select_filter_from_mode | ( | const Scene * | scene, |
| const Object * | obact ) |
Definition at line 520 of file view3d_view.cc.
References BKE_object_pose_armature_get(), Object::mode, OB_MODE_ALL_WEIGHT_PAINT, ToolSettings::object_flag, SCE_OBJECT_MODE_LOCK, Scene::toolsettings, VIEW3D_SELECT_FILTER_NOP, VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK, and VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK.
Referenced by do_object_box_select(), do_pose_box_select(), and ed_object_select_pick().
|
static |
Definition at line 1203 of file view3d_view.cc.
References View3D::flag, i, LISTBASE_FOREACH, View3D::local_collections_uid, Main::screens, SPACE_VIEW3D, and V3D_LOCAL_COLLECTIONS.
Referenced by ED_view3d_local_collections_set().
Definition at line 776 of file view3d_view.cc.
References i, LISTBASE_FOREACH, View3D::local_view_uid, View3D::localvd, SpaceLink::next, Main::screens, SPACE_VIEW3D, and SpaceLink::spacetype.
Referenced by view3d_localview_init().
|
static |
Definition at line 1239 of file view3d_view.cc.
References LayerCollection::flag, LAYER_COLLECTION_HIDE, LayerCollection::layer_collections, LISTBASE_FOREACH, LayerCollection::local_collections_bits, and local_collections_reset_uuid().
Referenced by local_collections_reset_uuid(), and view3d_local_collections_reset().
|
static |
Definition at line 1059 of file view3d_view.cc.
References C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_view3d(), CTX_wm_window(), DEG_id_tag_update(), DEG_id_type_tag(), depsgraph, ED_area_tag_redraw(), Scene::id, ID_OB, ID_RECALC_BASE_FLAGS, ID_RECALC_SELECT, View3D::localvd, NC_SCENE, ND_OB_SELECT, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), view3d_localview_exit(), view3d_localview_init(), WM_event_add_notifier(), and WM_operator_smooth_viewtx_get().
Referenced by VIEW3D_OT_localview().
|
static |
Definition at line 1129 of file view3d_view.cc.
References blender::ed::object::BA_DESELECT, ViewLayer::basact, blender::ed::object::base_select(), BASE_SELECTED, BKE_report(), BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_view3d(), CTX_wm_window(), DEG_id_tag_update(), DEG_tag_on_visible_update(), ED_localview_exit_if_empty(), Scene::id, ID_RECALC_SELECT, LISTBASE_FOREACH, NC_SCENE, ND_OB_ACTIVE, ND_OB_SELECT, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, WM_event_add_notifier(), and WM_operator_smooth_viewtx_get().
Referenced by VIEW3D_OT_localview_remove_from().
|
static |
Definition at line 1174 of file view3d_view.cc.
References C, CTX_data_edit_object(), CTX_wm_view3d(), and View3D::localvd.
Referenced by VIEW3D_OT_localview_remove_from().
|
static |
Definition at line 377 of file view3d_view.cc.
References invert_m4_m4(), mat4_normalized_to_quat(), normalize_m4_m4(), RV3D_VIEW_USER, RegionView3D::view, RegionView3D::viewmat, and RegionView3D::viewquat.
Referenced by view3d_viewmatrix_set().
|
static |
Definition at line 175 of file view3d_view.cc.
References C, V3D_SmoothParams::camera, View3D::camera, V3D_SmoothParams::camera_old, CTX_data_main(), RegionView3D::dist, V3D_SmoothParams::dist, ED_view3d_lastview_store(), ED_view3d_smooth_view(), V3D_SmoothParams::lens, View3D::lens, LISTBASE_FOREACH, RegionView3D::ofs, V3D_SmoothParams::ofs, RegionView3D::persp, V3D_SmoothParams::quat, RGN_TYPE_WINDOW, RV3D_CAMOB, View3D::scenelock, Main::screens, SPACE_VIEW3D, V3D_SmoothParams::undo_str, and RegionView3D::viewquat.
Referenced by view3d_setobjectascamera_exec().
|
static |
Definition at line 60 of file view3d_view.cc.
References BKE_object_tfm_protected_backup(), BKE_object_tfm_protected_restore(), C, View3D::camera, CTX_data_ensure_evaluated_depsgraph(), DEG_id_tag_update(), depsgraph, RegionView3D::dist, ED_view3d_context_user_region(), ED_view3d_lastview_store(), ED_view3d_smooth_view_force_finish(), ED_view3d_to_object(), Object::id, ID_RECALC_TRANSFORM, NC_OBJECT, ND_TRANSFORM, RegionView3D::ofs, OPERATOR_FINISHED, RegionView3D::persp, Object::protectflag, ARegion::regiondata, RV3D_CAMOB, RegionView3D::viewquat, and WM_event_add_notifier().
Referenced by VIEW3D_OT_camera_to_view().
|
static |
Definition at line 90 of file view3d_view.cc.
References BKE_id_is_editable(), C, View3D::camera, CTX_data_main(), ED_view3d_context_user_region(), Object::id, RegionView3D::persp, ARegion::regiondata, RV3D_CAMOB, RV3D_LOCK_ANY_TRANSFORM, and RV3D_LOCK_FLAGS.
Referenced by VIEW3D_OT_camera_to_view().
|
static |
Unlike VIEW3D_OT_view_selected this is for framing a render and not meant to take into account vertex/bone selection for eg.
Definition at line 134 of file view3d_view.cc.
References BKE_report(), C, Scene::camera, View3D::camera, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_view3d(), depsgraph, ED_view3d_camera_to_view_selected(), NC_OBJECT, ND_TRANSFORM, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, and WM_event_add_notifier().
Referenced by VIEW3D_OT_camera_to_view_selected().
| int view3d_gpu_select | ( | const ViewContext * | vc, |
| GPUSelectBuffer * | buffer, | ||
| const rcti * | input, | ||
| eV3DSelectMode | select_mode, | ||
| eV3DSelectObjectFilter | select_filter ) |
Definition at line 739 of file view3d_view.cc.
References input, and view3d_gpu_select_ex().
Referenced by do_armature_box_select(), do_meta_box_select(), do_object_box_select(), do_pose_box_select(), ed_mball_findnearest_metaelem(), mixed_bones_object_selectbuffer(), and view3d_gpu_select_with_id_filter().
| void view3d_gpu_select_cache_begin | ( | ) |
Optionally cache data for multiple calls to view3d_gpu_select
just avoid GPU_select headers outside this file
Definition at line 479 of file view3d_view.cc.
References GPU_select_cache_begin().
Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().
| void view3d_gpu_select_cache_end | ( | ) |
Definition at line 484 of file view3d_view.cc.
References GPU_select_cache_end().
Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().
| int view3d_gpu_select_ex | ( | const ViewContext * | vc, |
| GPUSelectBuffer * | buffer, | ||
| const rcti * | input, | ||
| eV3DSelectMode | select_mode, | ||
| eV3DSelectObjectFilter | select_filter, | ||
| bool | do_material_slot_selection ) |
Definition at line 550 of file view3d_view.cc.
References BKE_modifiers_get_virtual_modifierlist(), BKE_view_layer_edit_object_get(), BKE_view_layer_synced_ensure(), BLI_assert, BLI_linklist_prepend_alloca, BLI_rcti_init_pt_radius(), DrawSelectLoopUserData::buffer, ViewContext::C, CTX_wm_manager(), depsgraph, ViewContext::depsgraph, DRW_draw_select_loop(), DRW_gpu_context_disable(), DRW_gpu_context_enable(), drw_select_filter_object_mode_lock(), drw_select_filter_object_mode_lock_for_weight_paint(), drw_select_loop_pass(), ED_view3d_draw_setup_view(), eModifierType_Armature, eModifierType_GreasePencilArmature, G, G_FLAG_PICKSEL, GPU_DEPTH_LESS_EQUAL, GPU_DEPTH_NONE, GPU_depth_test(), GPU_SELECT_ALL, GPU_select_begin_next(), GPU_select_cache_end(), GPU_select_cache_load_id(), GPU_select_end(), GPU_SELECT_INVALID, GPU_select_is_cached(), DrawSelectLoopUserData::gpu_select_mode, GPU_SELECT_PICK_ALL, GPU_SELECT_PICK_NEAREST, DrawSelectLoopUserData::hits, input, Object::mode, ModifierData::next, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_OBJECT, OB_MODE_POSE, OB_WIRE, ViewContext::obact, ViewContext::obedit, ArmatureModifierData::object, GreasePencilArmatureModifierData::object, DrawSelectLoopUserData::pass, DrawSelectLoopUserData::rect, ViewContext::region, RGN_TYPE_WINDOW, ViewContext::rv3d, ViewContext::scene, View3D::shading, SPACE_VIEW3D, ModifierData::type, View3DShading::type, UI_SetTheme(), UI_Theme_Restore(), UI_Theme_Store(), ViewContext::v3d, VIEW3D_SELECT_FILTER_NOP, VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK, VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK, VIEW3D_SELECT_PICK_ALL, VIEW3D_SELECT_PICK_NEAREST, ViewContext::view_layer, RegionView3D::viewmat, ViewContext::win, XRAY_ACTIVE, XRAY_ENABLED, and xy.
Referenced by mixed_bones_object_selectbuffer(), and view3d_gpu_select().
| int view3d_gpu_select_with_id_filter | ( | const ViewContext * | vc, |
| GPUSelectBuffer * | buffer, | ||
| const rcti * | input, | ||
| eV3DSelectMode | select_mode, | ||
| eV3DSelectObjectFilter | select_filter, | ||
| uint | select_id ) |
Definition at line 748 of file view3d_view.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), GPU_select_buffer_remove_by_id(), input, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), GPUSelectBuffer::storage, and view3d_gpu_select().
Referenced by ed_armature_pick_bone_impl(), and get_nearest_editbonepoint().
Definition at line 1254 of file view3d_view.cc.
References LayerCollection::layer_collections, LISTBASE_FOREACH, local_collections_reset_uuid(), and Main::scenes.
Referenced by ED_view3d_local_collections_reset(), and ED_view3d_local_collections_set().
|
static |
Definition at line 947 of file view3d_view.cc.
References BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), V3D_SmoothParams::camera, View3D::camera, V3D_SmoothParams::camera_old, RegionView3D::camzoom, depsgraph, RegionView3D::dist, V3D_SmoothParams::dist, ED_view3d_local_stats_free(), ED_view3d_smooth_view_ex(), ED_view3d_smooth_view_force_finish_no_camera_lock(), ListBase::first, LISTBASE_FOREACH, View3D::local_view_uid, RegionView3D::localvd, View3D::localvd, MEM_freeN(), RegionView3D::ofs, V3D_SmoothParams::ofs, RegionView3D::persp, V3D_SmoothParams::quat, ScrArea::regionbase, RGN_TYPE_WINDOW, RV3D_CAMOB, RegionView3D::sms, ScrArea::spacedata, V3D_SmoothParams::undo_str, RegionView3D::view, RegionView3D::view_axis_roll, and RegionView3D::viewquat.
Referenced by ED_localview_exit_if_empty(), and localview_exec().
|
static |
Definition at line 805 of file view3d_view.cc.
References BASE_SELECTED, BKE_object_minmax(), BKE_report(), BKE_view_layer_edit_object_get(), BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), CAM_ORTHO, View3D::camera, V3D_SmoothParams::camera_old, CLAMP_MIN, Object::data, DEG_get_evaluated(), depsgraph, V3D_SmoothParams::dist, ED_view3d_dist_soft_min_get(), ED_view3d_radius_to_dist(), ED_view3d_smooth_view_ex(), ED_view3d_smooth_view_force_finish_no_camera_lock(), ListBase::first, FOREACH_BASE_IN_EDIT_MODE_BEGIN, FOREACH_BASE_IN_EDIT_MODE_END, free_localview_bit(), INIT_MINMAX, V3D_SmoothParams::lens, View3D::lens, LISTBASE_FOREACH, View3D::local_view_uid, RegionView3D::localvd, View3D::localvd, max, max_fff(), MEM_mallocN(), mid_v3_v3v3(), min, negate_v3_v3(), V3D_SmoothParams::ofs, RegionView3D::persp, V3D_SmoothParams::quat, ScrArea::regionbase, RGN_TYPE_WINDOW, RPT_ERROR, RV3D_CAMOB, RV3D_ORTHO, RV3D_PERSP, size(), RegionView3D::sms, ScrArea::spacedata, sub_v3_v3v3(), Camera::type, V3D_SmoothParams::undo_str, VIEW3D_MARGIN, and RegionView3D::viewquat.
Referenced by localview_exec().
| void VIEW3D_OT_camera_to_view | ( | wmOperatorType * | ot | ) |
Definition at line 109 of file view3d_view.cc.
References OPTYPE_REGISTER, OPTYPE_UNDO, ot, view3d_camera_to_view_exec(), and view3d_camera_to_view_poll().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_camera_to_view_selected | ( | wmOperatorType * | ot | ) |
Definition at line 154 of file view3d_view.cc.
References ED_operator_scene_editable(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and view3d_camera_to_view_selected_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_localview | ( | wmOperatorType * | ot | ) |
Definition at line 1108 of file view3d_view.cc.
References ED_operator_view3d_active(), localview_exec(), OPTYPE_UNDO, ot, and RNA_def_boolean().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_localview_remove_from | ( | wmOperatorType * | ot | ) |
Definition at line 1184 of file view3d_view.cc.
References localview_remove_from_exec(), localview_remove_from_poll(), OPTYPE_UNDO, and ot.
Referenced by view3d_operatortypes().
| void VIEW3D_OT_object_as_camera | ( | wmOperatorType * | ot | ) |
Definition at line 292 of file view3d_view.cc.
References ED_operator_rv3d_user_region_poll(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and view3d_setobjectascamera_exec().
Referenced by view3d_operatortypes().
|
static |
Definition at line 231 of file view3d_view.cc.
References C, Scene::camera, V3D_SmoothParams::camera, View3D::camera, V3D_SmoothParams::camera_old, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), DEG_id_tag_update(), DEG_relations_tag_update(), RegionView3D::dist, V3D_SmoothParams::dist, ED_view3d_context_user_region(), ED_view3d_lastview_store(), ED_view3d_smooth_view(), ED_view3d_smooth_view_force_finish(), Scene::id, ID_RECALC_SYNC_TO_EVAL, V3D_SmoothParams::lens, View3D::lens, NC_OBJECT, NC_SCENE, ND_DRAW, RegionView3D::ofs, V3D_SmoothParams::ofs, OPERATOR_FINISHED, RegionView3D::persp, V3D_SmoothParams::quat, ARegion::regiondata, RV3D_CAMOB, View3D::scenelock, sync_viewport_camera_smoothview(), V3D_SmoothParams::undo_str, V3D_CAMERA_SCENE, RegionView3D::viewquat, WM_event_add_notifier(), and WM_operator_smooth_viewtx_get().
Referenced by VIEW3D_OT_object_as_camera().
| void view3d_viewmatrix_set | ( | const Depsgraph * | depsgraph, |
| const Scene * | scene, | ||
| const View3D * | v3d, | ||
| RegionView3D * | rv3d, | ||
| const float | rect_scale[2] ) |
Sets RegionView3D.viewmat
| depsgraph | Depsgraph. |
| scene | Scene for camera and cursor location. |
| v3d | View 3D space data. |
| rv3d | 3D region which stores the final matrices. |
| rect_scale | Optional 2D scale argument, Use when displaying a sub-region, eg: when view3d_winmatrix_set takes a 'rect' argument. |
Definition at line 390 of file view3d_view.cc.
References BKE_pose_channel_find_name(), View3D::camera, copy_v3_v3(), Scene::cursor, DEG_get_evaluated(), depsgraph, RegionView3D::dist, ED_view3d_lock(), invert_m4_m4(), RegionView3D::is_persp, View3DCursor::location, mul_m4_m4m4(), mul_m4_v3(), mul_mat3_m4_v3(), mul_v2_v2fl(), OB_ARMATURE, View3D::ob_center, View3D::ob_center_bone, View3D::ob_center_cursor, obmat_to_viewmat(), RegionView3D::ofs, RegionView3D::ofs_lock, RegionView3D::persp, Object::pose, bPoseChannel::pose_mat, quat_to_mat4(), RV3D_CAMOB, RV3D_LOCK_FLAGS, RV3D_LOCK_ROTATION, RV3D_PERSP, translate_m4(), Object::type, RegionView3D::viewmat, RegionView3D::viewquat, and RegionView3D::winmat.
Referenced by ED_view3d_update_viewmat().
| void view3d_winmatrix_set | ( | const Depsgraph * | depsgraph, |
| ARegion * | region, | ||
| const View3D * | v3d, | ||
| const rcti * | rect ) |
| rect | optional for picking (can be NULL). |
Definition at line 313 of file view3d_view.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), depsgraph, ED_view3d_viewplane_get(), float, GPU_matrix_frustum_set(), GPU_matrix_ortho_set(), GPU_matrix_projection_get, RegionView3D::is_persp, printf, ARegion::regiondata, RegionView3D::winmat, ARegion::winx, ARegion::winy, rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.
Referenced by ED_view3d_update_viewmat().