|
Blender V5.0
|
#include "DNA_mesh_types.h"#include "DNA_view3d_types.h"#include "BKE_context.hh"#include "BKE_editmesh.hh"#include "BKE_global.hh"#include "BKE_layer.hh"#include "BKE_mesh.hh"#include "BKE_mesh_wrapper.hh"#include "BKE_object.hh"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "WM_api.hh"#include "WM_types.hh"#include "bmesh.hh"#include "ED_gizmo_library.hh"#include "ED_mesh.hh"#include "ED_screen.hh"#include "ED_view3d.hh"Go to the source code of this file.
Classes | |
| struct | MeshElemGizmo3D |
| struct | MeshEdgeRingGizmo3D |
Typedefs | |
Pre-selection Gizmo | |
Use for tools to hover over data before activation.
| |
| using | float3 |
| using blender::float3 |
Definition at line 619 of file BLI_math_vector_types.hh.
| void ED_gizmotypes_preselect_3d | ( | ) |
Definition at line 485 of file view3d_gizmo_preselect_type.cc.
References GIZMO_GT_mesh_preselect_edgering_3d(), GIZMO_GT_mesh_preselect_elem_3d(), and WM_gizmotype_append().
Referenced by ED_spacetypes_init().
| void ED_view3d_gizmo_mesh_preselect_clear | ( | wmGizmo * | gz | ) |
Definition at line 550 of file view3d_gizmo_preselect_type.cc.
References ARRAY_SIZE, MeshEdgeRingGizmo3D::base_index, MeshElemGizmo3D::base_index, BLI_assert_unreachable, MeshEdgeRingGizmo3D::edge_index, MeshElemGizmo3D::edge_index, MeshElemGizmo3D::face_index, i, wmGizmoType::idname, wmGizmo::ptr, RNA_property_int_set(), RNA_struct_find_property(), STREQ, wmGizmo::type, and MeshElemGizmo3D::vert_index.
Referenced by gizmo_preselect_poll_for_draw().
| void ED_view3d_gizmo_mesh_preselect_get_active | ( | const bContext * | C, |
| const wmGizmo * | gz, | ||
| Base ** | r_base, | ||
| BMElem ** | r_ele ) |
Definition at line 500 of file view3d_gizmo_preselect_type.cc.
References BKE_editmesh_from_object(), BKE_view_layer_array_from_bases_in_edit_mode(), bm, BMEditMesh::bm, BM_edge_at_index_find(), BM_face_at_index_find(), BM_vert_at_index_find(), C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Base::object, wmGizmo::ptr, RNA_int_get(), RNA_property_int_get(), RNA_struct_find_property(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by edbm_preselect_or_active().
|
static |
Definition at line 461 of file view3d_gizmo_preselect_type.cc.
References wmGizmoType::draw, wmGizmoType::free, gizmo_preselect_edgering_draw(), gizmo_preselect_edgering_free(), gizmo_preselect_edgering_invoke(), gizmo_preselect_edgering_setup(), gizmo_preselect_edgering_test_select(), wmGizmoType::idname, wmGizmoType::invoke, RNA_def_int(), wmGizmoType::setup, wmGizmoType::srna, wmGizmoType::struct_size, and wmGizmoType::test_select.
Referenced by ED_gizmotypes_preselect_3d().
|
static |
Definition at line 300 of file view3d_gizmo_preselect_type.cc.
References wmGizmoType::draw, wmGizmoType::free, gizmo_preselect_elem_draw(), gizmo_preselect_elem_free(), gizmo_preselect_elem_invoke(), gizmo_preselect_elem_setup(), gizmo_preselect_elem_test_select(), wmGizmoType::idname, wmGizmoType::invoke, RNA_def_int(), wmGizmoType::setup, wmGizmoType::srna, wmGizmoType::struct_size, and wmGizmoType::test_select.
Referenced by ED_gizmotypes_preselect_3d().
Definition at line 334 of file view3d_gizmo_preselect_type.cc.
References MeshEdgeRingGizmo3D::base_index, MeshEdgeRingGizmo3D::bases, C, EDBM_preselect_edgering_draw(), gizmo_preselect_poll_for_draw(), and MeshEdgeRingGizmo3D::psel.
Referenced by GIZMO_GT_mesh_preselect_edgering_3d().
|
static |
Definition at line 446 of file view3d_gizmo_preselect_type.cc.
References MeshEdgeRingGizmo3D::bases, EDBM_preselect_edgering_destroy(), and MeshEdgeRingGizmo3D::psel.
Referenced by GIZMO_GT_mesh_preselect_edgering_3d().
|
static |
Definition at line 454 of file view3d_gizmo_preselect_type.cc.
References OPERATOR_PASS_THROUGH.
Referenced by GIZMO_GT_mesh_preselect_edgering_3d().
|
static |
Definition at line 432 of file view3d_gizmo_preselect_type.cc.
References MeshEdgeRingGizmo3D::base_index, MeshEdgeRingGizmo3D::bases, EDBM_preselect_edgering_create(), wmGizmo::flag, MeshEdgeRingGizmo3D::psel, and WM_GIZMO_HIDDEN_KEYMAP.
Referenced by GIZMO_GT_mesh_preselect_edgering_3d().
Definition at line 347 of file view3d_gizmo_preselect_type.cc.
References MeshEdgeRingGizmo3D::base_index, MeshEdgeRingGizmo3D::bases, BKE_editmesh_from_object(), BKE_editmesh_vert_coords_when_deformed(), BKE_view_layer_active_base_get(), BKE_view_layer_array_from_bases_in_edit_mode(), BKE_view_layer_synced_ensure(), bm, BMEditMesh::bm, BM_EDGE, BM_elem_index_get, BM_mesh_elem_index_ensure(), C, copy_v2_v2_int(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_view3d(), DEG_get_evaluated(), ViewContext::depsgraph, ED_region_tag_redraw_editor_overlays(), ED_view3d_select_dist_px(), EDBM_edge_find_nearest_ex(), EDBM_preselect_edgering_clear(), EDBM_preselect_edgering_update_from_edge(), MeshEdgeRingGizmo3D::edge_index, em_setup_viewcontext(), ViewContext::mval, MeshEdgeRingGizmo3D::psel, wmGizmo::ptr, RNA_int_set(), and ViewContext::scene.
Referenced by GIZMO_GT_mesh_preselect_edgering_3d().
Definition at line 97 of file view3d_gizmo_preselect_type.cc.
References MeshElemGizmo3D::base_index, MeshElemGizmo3D::bases, C, EDBM_preselect_elem_draw(), gizmo_preselect_poll_for_draw(), and MeshElemGizmo3D::psel.
Referenced by GIZMO_GT_mesh_preselect_elem_3d().
|
static |
Definition at line 285 of file view3d_gizmo_preselect_type.cc.
References MeshElemGizmo3D::bases, EDBM_preselect_elem_destroy(), and MeshElemGizmo3D::psel.
Referenced by GIZMO_GT_mesh_preselect_elem_3d().
|
static |
Definition at line 293 of file view3d_gizmo_preselect_type.cc.
References OPERATOR_PASS_THROUGH.
Referenced by GIZMO_GT_mesh_preselect_elem_3d().
|
static |
Definition at line 271 of file view3d_gizmo_preselect_type.cc.
References MeshElemGizmo3D::base_index, MeshElemGizmo3D::bases, EDBM_preselect_elem_create(), wmGizmo::flag, MeshElemGizmo3D::psel, and WM_GIZMO_HIDDEN_KEYMAP.
Referenced by GIZMO_GT_mesh_preselect_elem_3d().
Definition at line 110 of file view3d_gizmo_preselect_type.cc.
References MeshElemGizmo3D::base_index, MeshElemGizmo3D::bases, BKE_editmesh_from_object(), BKE_mesh_wrapper_vert_coords(), BKE_mesh_wrapper_vert_len(), BKE_object_get_editmesh_eval_cage(), BKE_view_layer_active_base_get(), BKE_view_layer_array_from_bases_in_edit_mode(), BKE_view_layer_synced_ensure(), BLI_assert, bm, BMEditMesh::bm, BM_EDGE, BM_elem_index_get, BM_FACE, BM_mesh_elem_index_ensure(), BM_VERT, BM_vert_is_boundary(), C, BMVert::co, copy_v2_v2_int(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_view3d(), CTX_wm_window(), DEG_get_evaluated(), depsgraph, ED_region_tag_redraw_editor_overlays(), ED_view3d_project_v2(), ED_view3d_select_dist_px(), EDBM_preselect_action_get(), EDBM_preselect_action_set(), EDBM_preselect_elem_clear(), EDBM_preselect_elem_update_from_single(), EDBM_preselect_elem_update_preview(), EDBM_preselect_preview_clear(), EDBM_unified_findnearest_from_raycast(), MeshElemGizmo3D::edge_index, em_setup_viewcontext(), wmWindow::eventstate, MeshElemGizmo3D::face_index, float, KM_CTRL, KM_SHIFT, len, len_v2v2(), mul_v3_m4v3(), ViewContext::mval, Base::object, PRESELECT_ACTION_CREATE, PRESELECT_ACTION_DELETE, PRESELECT_ACTION_TRANSFORM, MeshElemGizmo3D::psel, wmGizmo::ptr, ViewContext::region, RNA_int_set(), and MeshElemGizmo3D::vert_index.
Referenced by GIZMO_GT_mesh_preselect_elem_3d().
Check if drawing should be performed, clear the pre-selection in the case it's disabled. Without this, the gizmo would be visible while transforming. See #92954.
NOTE(@ideasman42): This is a workaround for the gizmo system, since typically poll would be used for this purpose. The problem with using poll is once the gizmo is visible again is there is a visible flicker showing the previous location before cursor motion causes the pre selection to be updated. While this is only a glitch, it's distracting. The gizmo system itself could support this use case by tracking which gizmos draw and ensure gizmos always run wmGizmoType.test_select before drawing, however pre-selection is already outside the scope of what gizmos are meant to be used for, so keep this workaround localized to this gizmo type unless this seems worth supporting for more typical use-cases.
Longer term it may be better to use wmPaintCursor instead of gizmos (as snapping preview does).
Definition at line 69 of file view3d_gizmo_preselect_type.cc.
References C, CTX_wm_region_view3d(), ED_view3d_gizmo_mesh_preselect_clear(), G, RegionView3D::rflag, and RV3D_NAVIGATING.
Referenced by gizmo_preselect_edgering_draw(), and gizmo_preselect_elem_draw().