Blender  V3.3
Classes
view3d_gizmo_preselect_type.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "DNA_mesh_types.h"
#include "DNA_view3d_types.h"
#include "BKE_context.h"
#include "BKE_editmesh.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "WM_api.h"
#include "WM_types.h"
#include "bmesh.h"
#include "ED_gizmo_library.h"
#include "ED_mesh.h"
#include "ED_screen.h"
#include "ED_view3d.h"

Go to the source code of this file.

Classes

struct  MeshElemGizmo3D
 
struct  MeshEdgeRingGizmo3D
 

Functions

Shared Internal API
static bool gizmo_preselect_poll_for_draw (const bContext *C, wmGizmo *gz)
 
Gizmo API
void ED_gizmotypes_preselect_3d (void)
 
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 (bContext *C, wmGizmo *gz, Base **r_base, BMElem **r_ele)
 
void ED_view3d_gizmo_mesh_preselect_clear (wmGizmo *gz)
 

Mesh Element (Vert/Edge/Face) Pre-Select Gizmo API

typedef struct MeshElemGizmo3D MeshElemGizmo3D
 
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 int gizmo_preselect_elem_invoke (bContext *UNUSED(C), wmGizmo *UNUSED(gz), const wmEvent *UNUSED(event))
 
static void GIZMO_GT_mesh_preselect_elem_3d (wmGizmoType *gzt)
 

Mesh Edge-Ring Pre-Select Gizmo API

typedef struct MeshEdgeRingGizmo3D MeshEdgeRingGizmo3D
 
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 int gizmo_preselect_edgering_invoke (bContext *UNUSED(C), wmGizmo *UNUSED(gz), const wmEvent *UNUSED(event))
 
static void GIZMO_GT_mesh_preselect_edgering_3d (wmGizmoType *gzt)
 

Typedef Documentation

◆ MeshEdgeRingGizmo3D

◆ MeshElemGizmo3D

Function Documentation

◆ ED_gizmotypes_preselect_3d()

void ED_gizmotypes_preselect_3d ( void  )

◆ ED_view3d_gizmo_mesh_preselect_clear()

void ED_view3d_gizmo_mesh_preselect_clear ( wmGizmo gz)

◆ ED_view3d_gizmo_mesh_preselect_get_active()

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

◆ GIZMO_GT_mesh_preselect_edgering_3d()

static void GIZMO_GT_mesh_preselect_edgering_3d ( wmGizmoType gzt)
static

◆ GIZMO_GT_mesh_preselect_elem_3d()

static void GIZMO_GT_mesh_preselect_elem_3d ( wmGizmoType gzt)
static

◆ gizmo_preselect_edgering_draw()

static void gizmo_preselect_edgering_draw ( const bContext C,
wmGizmo gz 
)
static

◆ gizmo_preselect_edgering_free()

static void gizmo_preselect_edgering_free ( wmGizmo gz)
static

◆ gizmo_preselect_edgering_invoke()

static int gizmo_preselect_edgering_invoke ( bContext UNUSEDC,
wmGizmo UNUSEDgz,
const wmEvent UNUSEDevent 
)
static

Definition at line 440 of file view3d_gizmo_preselect_type.c.

References OPERATOR_PASS_THROUGH.

Referenced by GIZMO_GT_mesh_preselect_edgering_3d().

◆ gizmo_preselect_edgering_setup()

static void gizmo_preselect_edgering_setup ( wmGizmo gz)
static

◆ gizmo_preselect_edgering_test_select()

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

◆ gizmo_preselect_elem_draw()

static void gizmo_preselect_elem_draw ( const bContext C,
wmGizmo gz 
)
static

◆ gizmo_preselect_elem_free()

static void gizmo_preselect_elem_free ( wmGizmo gz)
static

◆ gizmo_preselect_elem_invoke()

static int gizmo_preselect_elem_invoke ( bContext UNUSEDC,
wmGizmo UNUSEDgz,
const wmEvent UNUSEDevent 
)
static

Definition at line 278 of file view3d_gizmo_preselect_type.c.

References OPERATOR_PASS_THROUGH.

Referenced by GIZMO_GT_mesh_preselect_elem_3d().

◆ gizmo_preselect_elem_setup()

static void gizmo_preselect_elem_setup ( wmGizmo gz)
static

◆ gizmo_preselect_elem_test_select()

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

◆ gizmo_preselect_poll_for_draw()

static 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 T92954.

NOTE(@campbellbarton): 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 it's self 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 60 of file view3d_gizmo_preselect_type.c.

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