86 if (is_ctrl_pressed && !is_shift_pressed) {
89 if (!is_ctrl_pressed && is_shift_pressed) {
118 int base_index_vert = -1;
119 int base_index_edge = -1;
120 int base_index_face = -1;
139 best.ele = (
BMElem *)efa_test;
140 best.base_index = base_index_face;
147 best.ele = (
BMElem *)eed_test;
148 best.base_index = base_index_edge;
157 float vert_p_co[3], vert_co[3];
163 best.ele = (
BMElem *)eve_test;
164 best.base_index = base_index_vert;
168 best.ele = (
BMElem *)eve_test;
169 best.base_index = base_index_vert;
176 Base *base = gz_ele->
bases[best.base_index];
193 if (best.ele->head.htype ==
BM_VERT) {
196 else if (best.ele->head.htype ==
BM_EDGE) {
199 else if (best.ele->head.htype ==
BM_FACE) {
263 gzt->
idname =
"GIZMO_GT_mesh_preselect_elem_3d";
274 RNA_def_int(gzt->
srna,
"object_index", -1, -1, INT_MAX,
"Object Index",
"", -1, INT_MAX);
275 RNA_def_int(gzt->
srna,
"vert_index", -1, -1, INT_MAX,
"Vert Index",
"", -1, INT_MAX);
276 RNA_def_int(gzt->
srna,
"edge_index", -1, -1, INT_MAX,
"Edge Index",
"", -1, INT_MAX);
277 RNA_def_int(gzt->
srna,
"face_index", -1, -1, INT_MAX,
"Face Index",
"", -1, INT_MAX);
345 best.base_index = base_index;
371 bool is_alloc =
false;
373 vc.
depsgraph, em_eval, scene_eval, ob_eval,
NULL, &is_alloc);
421 gzt->
idname =
"GIZMO_GT_mesh_preselect_edgering_3d";
432 RNA_def_int(gzt->
srna,
"object_index", -1, -1, INT_MAX,
"Object Index",
"", -1, INT_MAX);
433 RNA_def_int(gzt->
srna,
"edge_index", -1, -1, INT_MAX,
"Edge Index",
"", -1, INT_MAX);
473 if (object_index < bases_len) {
474 base = bases[object_index];
496 if (vert_index != -1) {
499 else if (edge_index != -1) {
502 else if (face_index != -1) {
typedef float(TangentPoint)[2]
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
const float(* BKE_editmesh_vert_coords_when_deformed(struct Depsgraph *depsgraph, struct BMEditMesh *em, struct Scene *scene, struct Object *obedit, int *r_vert_len, bool *r_is_alloc))[3]
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
#define BKE_view_layer_array_from_bases_in_edit_mode(view_layer, v3d, r_len)
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE float len_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
struct Depsgraph Depsgraph
struct ID * DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
void EDBM_preselect_elem_update_preview(struct EditMesh_PreSelElem *psel, struct ViewContext *vc, struct BMesh *bm, struct BMElem *ele, const int mval[2])
void EDBM_preselect_elem_destroy(struct EditMesh_PreSelElem *psel)
void EDBM_preselect_elem_draw(struct EditMesh_PreSelElem *psel, const float matrix[4][4])
void EDBM_preselect_edgering_destroy(struct EditMesh_PreSelEdgeRing *psel)
bool EDBM_unified_findnearest_from_raycast(struct ViewContext *vc, struct Base **bases, const uint bases_len, bool use_boundary_vertices, bool use_boundary_edges, int *r_base_index_vert, int *r_base_index_edge, int *r_base_index_face, struct BMVert **r_eve, struct BMEdge **r_eed, struct BMFace **r_efa)
@ PRESELECT_ACTION_CREATE
@ PRESELECT_ACTION_DELETE
@ PRESELECT_ACTION_TRANSFORM
void EDBM_preselect_edgering_clear(struct EditMesh_PreSelEdgeRing *psel)
void EDBM_preselect_action_set(struct EditMesh_PreSelElem *psel, eEditMesh_PreSelPreviewAction action)
eEditMesh_PreSelPreviewAction EDBM_preselect_action_get(struct EditMesh_PreSelElem *psel)
void em_setup_viewcontext(struct bContext *C, struct ViewContext *vc)
void EDBM_preselect_elem_clear(struct EditMesh_PreSelElem *psel)
struct EditMesh_PreSelEdgeRing * EDBM_preselect_edgering_create(void)
void EDBM_preselect_elem_update_from_single(struct EditMesh_PreSelElem *psel, struct BMesh *bm, struct BMElem *ele, const float(*coords)[3])
void EDBM_preselect_preview_clear(struct EditMesh_PreSelElem *psel)
struct BMEdge * EDBM_edge_find_nearest_ex(struct ViewContext *vc, float *dist_px_manhattan, float *r_dist_center, const bool use_select_bias, bool use_cycle, struct BMEdge **r_eed_zbuf, struct Base **bases, uint bases_len, uint *r_base_index)
void EDBM_preselect_edgering_draw(struct EditMesh_PreSelEdgeRing *psel, const float matrix[4][4])
struct EditMesh_PreSelElem * EDBM_preselect_elem_create(void)
void EDBM_preselect_edgering_update_from_edge(struct EditMesh_PreSelEdgeRing *psel, struct BMesh *bm, struct BMEdge *eed_start, int previewlines, const float(*coords)[3])
void ED_region_tag_redraw_editor_overlays(struct ARegion *region)
void ED_view3d_project(const struct ARegion *region, const float world[3], float r_region_co[3])
float ED_view3d_select_dist_px(void)
Read Guarded memory(de)allocation.
#define BM_elem_index_get(ele)
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMFace * BM_face_at_index_find(BMesh *bm, const int index)
BMEdge * BM_edge_at_index_find(BMesh *bm, const int index)
BMVert * BM_vert_at_index_find(BMesh *bm, const int index)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
bool BM_vert_is_boundary(const BMVert *v)
const Depsgraph * depsgraph
void(* MEM_freeN)(void *vmemh)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_int_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
const float(* vertexCos)[3]
struct EditMesh_PreSelEdgeRing * psel
struct EditMesh_PreSelElem * psel
struct EditMeshData * edit_data
struct Depsgraph * depsgraph
wmGizmoFnTestSelect test_select
struct wmEvent * eventstate
static void gizmo_preselect_elem_draw(const bContext *UNUSED(C), 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)
static void gizmo_preselect_elem_setup(wmGizmo *gz)
static void gizmo_preselect_edgering_setup(wmGizmo *gz)
void ED_gizmotypes_preselect_3d(void)
static int gizmo_preselect_edgering_test_select(bContext *C, wmGizmo *gz, const int mval[2])
struct MeshElemGizmo3D MeshElemGizmo3D
static void gizmo_preselect_elem_free(wmGizmo *gz)
struct MeshEdgeRingGizmo3D MeshEdgeRingGizmo3D
void ED_view3d_gizmo_mesh_preselect_get_active(bContext *C, wmGizmo *gz, Base **r_base, BMElem **r_ele)
static void GIZMO_GT_mesh_preselect_edgering_3d(wmGizmoType *gzt)
static void gizmo_preselect_edgering_draw(const bContext *UNUSED(C), wmGizmo *gz)
static int gizmo_preselect_elem_test_select(bContext *C, wmGizmo *gz, const int mval[2])
static int gizmo_preselect_edgering_invoke(bContext *UNUSED(C), wmGizmo *UNUSED(gz), const wmEvent *UNUSED(event))
static void gizmo_preselect_edgering_free(wmGizmo *gz)
int WM_event_modifier_flag(const wmEvent *event)
void WM_gizmotype_append(void(*gtfunc)(struct wmGizmoType *))