|
Blender V4.3
|
#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_idprop.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_platform.hh"#include "GPU_select.hh"#include "GPU_state.hh"#include "WM_api.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"Go to the source code of this file.
Classes | |
| struct | DrawSelectLoopUserData |
|
static |
Implement VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK.
Definition at line 528 of file view3d_view.cc.
References BKE_object_is_mode_compat(), and Object::mode.
Referenced by view3d_opengl_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 538 of file view3d_view.cc.
References BLI_linklist_index(), and DEG_get_original_object().
Referenced by view3d_opengl_select_ex().
|
static |
Definition at line 487 of file view3d_view.cc.
References BLI_assert, DRW_SELECT_PASS_POST, DRW_SELECT_PASS_PRE, GPU_select_begin_next(), GPU_select_end(), GPU_SELECT_NEAREST_FIRST_PASS, GPU_SELECT_NEAREST_SECOND_PASS, and stage.
Referenced by view3d_opengl_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. |
true if the local view was actually exited. Definition at line 1038 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, 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 274 of file view3d_view.cc.
References 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 1294 of file view3d_view.cc.
References BKE_layer_collection_local_sync(), 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 1270 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 514 of file view3d_view.cc.
References BKE_object_pose_armature_get(), Object::mode, OB_MODE_ALL_WEIGHT_PAINT, SCE_OBJECT_MODE_LOCK, 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 1208 of file view3d_view.cc.
References View3D::flag, LISTBASE_FOREACH, View3D::local_collections_uid, Main::screens, SPACE_VIEW3D, and V3D_LOCAL_COLLECTIONS.
Referenced by ED_view3d_local_collections_set().
Definition at line 783 of file view3d_view.cc.
References 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 1244 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 1065 of file view3d_view.cc.
References 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(), 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 1134 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(), 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(), 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 1179 of file view3d_view.cc.
References CTX_data_edit_object(), CTX_wm_view3d(), and View3D::localvd.
Referenced by VIEW3D_OT_localview_remove_from().
|
static |
Definition at line 367 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 167 of file view3d_view.cc.
References 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 56 of file view3d_view.cc.
References BKE_object_tfm_protected_backup(), BKE_object_tfm_protected_restore(), 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_to_object(), Object::id, ID_RECALC_TRANSFORM, NC_OBJECT, ND_TRANSFORM, RegionView3D::ofs, OPERATOR_FINISHED, RegionView3D::persp, Object::protectflag, RV3D_CAMOB, RegionView3D::viewquat, and WM_event_add_notifier().
Referenced by VIEW3D_OT_camera_to_view().
|
static |
Definition at line 84 of file view3d_view.cc.
References BKE_id_is_editable(), View3D::camera, CTX_data_main(), ED_view3d_context_user_region(), Object::id, RegionView3D::persp, RV3D_CAMOB, RV3D_LOCK_ANY_TRANSFORM, and RV3D_LOCK_FLAGS.
Referenced by VIEW3D_OT_camera_to_view().
|
static |
Definition at line 126 of file view3d_view.cc.
References BKE_report(), 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().
Definition at line 1259 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 953 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_smooth_view_ex(), ED_view3d_smooth_view_force_finish_no_camera_lock(), LISTBASE_FOREACH, View3D_Runtime::local_stats, View3D::local_view_uid, RegionView3D::localvd, View3D::localvd, MEM_freeN(), MEM_SAFE_FREE, RegionView3D::ofs, V3D_SmoothParams::ofs, RegionView3D::persp, V3D_SmoothParams::quat, RGN_TYPE_WINDOW, View3D::runtime, RV3D_CAMOB, RegionView3D::sms, 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 812 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(), View3D::camera, V3D_SmoothParams::camera_old, View3D::clip_start, DEG_get_evaluated_object(), depsgraph, V3D_SmoothParams::dist, ED_view3d_radius_to_dist(), ED_view3d_smooth_view_ex(), ED_view3d_smooth_view_force_finish_no_camera_lock(), 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_ff(), max_fff(), MEM_mallocN, mid_v3_v3v3(), min, negate_v3_v3(), V3D_SmoothParams::ofs, RegionView3D::persp, V3D_SmoothParams::quat, RGN_TYPE_WINDOW, RPT_ERROR, RV3D_CAMOB, RV3D_ORTHO, RV3D_PERSP, RegionView3D::sms, sub_v3_v3v3(), V3D_SmoothParams::undo_str, VIEW3D_MARGIN, and RegionView3D::viewquat.
Referenced by localview_exec().
| int view3d_opengl_select | ( | const ViewContext * | vc, |
| GPUSelectBuffer * | buffer, | ||
| const rcti * | input, | ||
| eV3DSelectMode | select_mode, | ||
| eV3DSelectObjectFilter | select_filter ) |
Definition at line 746 of file view3d_view.cc.
References view3d_opengl_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_opengl_select_with_id_filter().
| void view3d_opengl_select_cache_begin | ( | ) |
Optionally cache data for multiple calls to view3d_opengl_select
just avoid GPU_select headers outside this file
Definition at line 469 of file view3d_view.cc.
References GPU_select_cache_begin().
Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().
| void view3d_opengl_select_cache_end | ( | ) |
Definition at line 474 of file view3d_view.cc.
References GPU_select_cache_end().
Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().
| int view3d_opengl_select_ex | ( | const ViewContext * | vc, |
| GPUSelectBuffer * | buffer, | ||
| const rcti * | input, | ||
| eV3DSelectMode | select_mode, | ||
| eV3DSelectObjectFilter | select_filter, | ||
| bool | do_material_slot_selection ) |
Definition at line 544 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, G, G_FLAG_PICKSEL, GPU_BACKEND_VULKAN, GPU_DEPTH_LESS_EQUAL, GPU_DEPTH_NONE, GPU_depth_test(), GPU_DEVICE_ATI, GPU_DEVICE_NVIDIA, GPU_DRIVER_OFFICIAL, GPU_OS_ANY, GPU_SELECT_ALL, GPU_select_begin_next(), GPU_select_cache_end(), GPU_select_cache_load_id(), GPU_select_end(), GPU_select_is_cached(), DrawSelectLoopUserData::gpu_select_mode, GPU_SELECT_NEAREST_FIRST_PASS, GPU_SELECT_PICK_ALL, GPU_SELECT_PICK_NEAREST, GPU_type_matches_ex(), DrawSelectLoopUserData::hits, Object::mode, ModifierData::next, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_OBJECT, OB_MODE_POSE, OB_WIRE, ViewContext::obact, ViewContext::obedit, ArmatureModifierData::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(), USER_GPU_FLAG_NO_DEPT_PICK, 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_opengl_select().
| int view3d_opengl_select_with_id_filter | ( | const ViewContext * | vc, |
| GPUSelectBuffer * | buffer, | ||
| const rcti * | input, | ||
| eV3DSelectMode | select_mode, | ||
| eV3DSelectObjectFilter | select_filter, | ||
| uint | select_id ) |
Definition at line 755 of file view3d_view.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), GPU_select_buffer_remove_by_id(), blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), GPUSelectBuffer::storage, and view3d_opengl_select().
Referenced by ed_armature_pick_bone_impl(), and get_nearest_editbonepoint().
| void VIEW3D_OT_camera_to_view | ( | wmOperatorType * | ot | ) |
Definition at line 103 of file view3d_view.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, 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 146 of file view3d_view.cc.
References wmOperatorType::description, ED_operator_scene_editable(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and view3d_camera_to_view_selected_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_localview | ( | wmOperatorType * | ot | ) |
Definition at line 1114 of file view3d_view.cc.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, localview_exec(), wmOperatorType::name, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by view3d_operatortypes().
| void VIEW3D_OT_localview_remove_from | ( | wmOperatorType * | ot | ) |
Definition at line 1189 of file view3d_view.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, localview_remove_from_exec(), localview_remove_from_poll(), wmOperatorType::name, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by view3d_operatortypes().
| void VIEW3D_OT_object_as_camera | ( | wmOperatorType * | ot | ) |
Definition at line 282 of file view3d_view.cc.
References wmOperatorType::description, ED_operator_rv3d_user_region_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and view3d_setobjectascamera_exec().
Referenced by view3d_operatortypes().
|
static |
Definition at line 223 of file view3d_view.cc.
References 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(), 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, 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 380 of file view3d_view.cc.
References BKE_pose_channel_find_name(), View3D::camera, copy_v3_v3(), DEG_get_evaluated_object(), depsgraph, RegionView3D::dist, ED_view3d_lock(), invert_m4_m4(), RegionView3D::is_persp, 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 303 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, RegionView3D::winmat, rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.
Referenced by ED_view3d_update_viewmat().