Blender V5.0
view3d_gizmo_preselect_type.cc File Reference
#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.

Note
This is a slight misuse of gizmo's, since clicking performs no action.
using float3

Functions

Shared Internal API
static bool gizmo_preselect_poll_for_draw (const bContext *C, wmGizmo *gz)
Mesh Element (Vert/Edge/Face) Pre-Select Gizmo API
static void gizmo_preselect_elem_draw (const bContext *C, wmGizmo *gz)
static int gizmo_preselect_elem_test_select (bContext *C, wmGizmo *gz, const int mval[2])
static void gizmo_preselect_elem_setup (wmGizmo *gz)
static void gizmo_preselect_elem_free (wmGizmo *gz)
static wmOperatorStatus gizmo_preselect_elem_invoke (bContext *, wmGizmo *, const wmEvent *)
static void GIZMO_GT_mesh_preselect_elem_3d (wmGizmoType *gzt)
Mesh Edge-Ring Pre-Select Gizmo API
static void gizmo_preselect_edgering_draw (const bContext *C, wmGizmo *gz)
static int gizmo_preselect_edgering_test_select (bContext *C, wmGizmo *gz, const int mval[2])
static void gizmo_preselect_edgering_setup (wmGizmo *gz)
static void gizmo_preselect_edgering_free (wmGizmo *gz)
static wmOperatorStatus gizmo_preselect_edgering_invoke (bContext *, wmGizmo *, const wmEvent *)
static void GIZMO_GT_mesh_preselect_edgering_3d (wmGizmoType *gzt)
Gizmo API
void ED_gizmotypes_preselect_3d ()
Gizmo Accessors

This avoids each user of the gizmo needing to write their own lookups to access the information from this gizmo.

void ED_view3d_gizmo_mesh_preselect_get_active (const bContext *C, const wmGizmo *gz, Base **r_base, BMElem **r_ele)
void ED_view3d_gizmo_mesh_preselect_clear (wmGizmo *gz)

Typedef Documentation

◆ float3

Definition at line 619 of file BLI_math_vector_types.hh.

Function Documentation

◆ ED_gizmotypes_preselect_3d()

void ED_gizmotypes_preselect_3d ( )

◆ ED_view3d_gizmo_mesh_preselect_clear()

◆ ED_view3d_gizmo_mesh_preselect_get_active()

◆ GIZMO_GT_mesh_preselect_edgering_3d()

◆ GIZMO_GT_mesh_preselect_elem_3d()

◆ gizmo_preselect_edgering_draw()

◆ gizmo_preselect_edgering_free()

void gizmo_preselect_edgering_free ( wmGizmo * gz)
static

◆ gizmo_preselect_edgering_invoke()

wmOperatorStatus gizmo_preselect_edgering_invoke ( bContext * ,
wmGizmo * ,
const wmEvent *  )
static

◆ gizmo_preselect_edgering_setup()

◆ gizmo_preselect_edgering_test_select()

◆ gizmo_preselect_elem_draw()

◆ gizmo_preselect_elem_free()

void gizmo_preselect_elem_free ( wmGizmo * gz)
static

◆ gizmo_preselect_elem_invoke()

wmOperatorStatus gizmo_preselect_elem_invoke ( bContext * ,
wmGizmo * ,
const wmEvent *  )
static

Definition at line 293 of file view3d_gizmo_preselect_type.cc.

References OPERATOR_PASS_THROUGH.

Referenced by GIZMO_GT_mesh_preselect_elem_3d().

◆ gizmo_preselect_elem_setup()

◆ gizmo_preselect_elem_test_select()

int gizmo_preselect_elem_test_select ( bContext * C,
wmGizmo * gz,
const int mval[2] )
static

◆ gizmo_preselect_poll_for_draw()

bool gizmo_preselect_poll_for_draw ( const bContext * C,
wmGizmo * gz )
static

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().