|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "DNA_object_types.h"#include "BLI_math_geom.h"#include "BLI_math_vector.h"#include "BLI_math_vector.hh"#include "BLI_span.hh"#include "BLI_vector.hh"#include "BKE_context.hh"#include "BKE_editmesh.hh"#include "BKE_layer.hh"#include "BKE_report.hh"#include "BLT_translation.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "WM_types.hh"#include "ED_mesh.hh"#include "ED_transform.hh"#include "ED_view3d.hh"#include "bmesh.hh"#include "bmesh_tools.hh"#include "mesh_intern.hh"Go to the source code of this file.
Classes | |
| struct | EdgeLoopPair |
| struct | UnorderedLoopPair |
Functions | |
Rip Far-Side De-Select | |
| static BMEdge * | edbm_ripsel_edge_uid_step (BMEdge *e_orig, BMVert **v_prev) |
| static BMVert * | edbm_ripsel_edloop_pair_start_vert (BMEdge *e) |
| static void | edbm_ripsel_deselect_helper (BMesh *bm, const Span< EdgeLoopPair > eloop_pairs, ARegion *region, const blender::float4x4 &projectMat, const float fmval[2]) |
Rip Vertex Implementation | |
| static int | edbm_rip_invoke__vert (bContext *C, const wmEvent *event, Object *obedit, bool do_fill) |
Rip Edge Implementation | |
| static int | edbm_rip_invoke__edge (bContext *C, const wmEvent *event, Object *obedit, bool do_fill) |
Rip Operator | |
| static int | edbm_rip_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| void | MESH_OT_rip (wmOperatorType *ot) |
Local Utilities | |
| #define | INSET_DEFAULT 0.00001f |
| static float | edbm_rip_edgedist_squared (ARegion *region, const blender::float4x4 &mat, const float co1[3], const float co2[3], const float mvalf[2], const float inset) |
| static void | edbm_calc_loop_co (BMLoop *l, float l_mid_co[3]) |
| static float | edbm_rip_edge_side_measure (BMEdge *e, BMLoop *e_l, ARegion *region, const blender::float4x4 &projectMat, const float fmval[2]) |
Rip Selection Handling (advanced rip-select <tt>ripsel</tt> functions) | |
| #define | IS_VISIT_POSSIBLE(e) (BM_edge_is_manifold(e) && BM_elem_flag_test(e, BM_ELEM_TAG)) |
| #define | IS_VISIT_DONE(e) ((e)->l && (BM_elem_index_get((e)->l) != INVALID_UID)) |
| #define | INVALID_UID INT_MIN |
| static BMEdge * | edbm_ripsel_edge_mark_step (BMVert *v, const int uid) |
| static Vector< EdgeLoopPair > | edbm_ripsel_looptag_helper (BMesh *bm) |
Rip Face-Fill code | |
| enum | { ULP_FLIP_0 = (1 << 0) , ULP_FLIP_1 = (1 << 1) } |
| static UnorderedLoopPair * | edbm_tagged_loop_pairs_to_fill (BMesh *bm) |
| static void | edbm_tagged_loop_pairs_do_fill_faces (BMesh *bm, UnorderedLoopPair *uloop_pairs) |
| #define INSET_DEFAULT 0.00001f |
helper to find edge for edge_rip,
| inset | is used so we get some useful distance when comparing multiple edges that meet at the same point and would result in the same distance. |
Definition at line 56 of file editmesh_rip.cc.
Referenced by edbm_rip_invoke__vert().
| #define INVALID_UID INT_MIN |
Definition at line 201 of file editmesh_rip.cc.
Referenced by edbm_ripsel_looptag_helper().
| #define IS_VISIT_DONE | ( | e | ) | ((e)->l && (BM_elem_index_get((e)->l) != INVALID_UID)) |
Definition at line 200 of file editmesh_rip.cc.
Referenced by edbm_ripsel_edge_mark_step(), and edbm_ripsel_looptag_helper().
| #define IS_VISIT_POSSIBLE | ( | e | ) | (BM_edge_is_manifold(e) && BM_elem_flag_test(e, BM_ELEM_TAG)) |
How rip selection works:
Firstly - rip is basically edge split with side-selection & grab. Things would be much more simple if we didn't have to worry about side selection
The method used for checking the side of selection is as follows...
Limitation! This currently works very poorly with intersecting edge islands (verts with more than 2 tagged edges). This is nice to do but for now not essential.
Definition at line 199 of file editmesh_rip.cc.
Referenced by edbm_ripsel_edge_mark_step(), and edbm_ripsel_looptag_helper().
| anonymous enum |
| Enumerator | |
|---|---|
| ULP_FLIP_0 | |
| ULP_FLIP_1 | |
Definition at line 402 of file editmesh_rip.cc.
Calculates a point along the loop tangent which can be used to measure against edges.
Definition at line 100 of file editmesh_rip.cc.
References add_v3_v3(), BM_edge_calc_length(), BM_loop_calc_face_tangent(), BMVert::co, BMLoop::e, l, mul_v3_fl(), BMLoop::prev, and BMLoop::v.
Referenced by edbm_rip_invoke__vert().
|
static |
Definition at line 111 of file editmesh_rip.cc.
References BLI_assert, BM_face_other_vert_loop(), BM_vert_in_edge(), BMVert::co, dist_squared_to_line_segment_v2(), e, ED_view3d_project_float_v2_m4(), BMLoop::f, len_v2v2(), blender::math::midpoint(), normalize_v2_length(), sub_v2_v2v2(), and BMLoop::v.
Referenced by edbm_rip_invoke__edge(), and edbm_ripsel_deselect_helper().
|
static |
Definition at line 57 of file editmesh_rip.cc.
References BLI_assert, dist_squared_to_line_segment_v2(), ED_view3d_project_float_v2_m4(), interp_v2_v2v2(), and len_v2v2().
Referenced by edbm_rip_invoke__vert().
|
static |
Definition at line 1023 of file editmesh_rip.cc.
References BKE_editmesh_from_object(), BKE_report(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BLI_assert, bm, BMEditMesh::bm, BM_custom_loop_normals_from_vector_layer(), BM_custom_loop_normals_to_vector_layer(), BM_EDGES_OF_MESH, BM_elem_flag_set, BM_elem_flag_test, BM_ELEM_SELECT, BM_ELEM_TAG, BM_ITER_MESH, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), e, edbm_rip_invoke__edge(), edbm_rip_invoke__vert(), EDBM_update(), OPERATOR_CANCELLED, OPERATOR_FINISHED, params, wmOperator::ptr, wmOperator::reports, ret, RNA_boolean_get(), RPT_ERROR, BMesh::totedgesel, BMesh::totfacesel, and BMesh::totvertsel.
Referenced by MESH_OT_rip().
|
static |
This is the main edge ripping function
BM_vert_other_disk_edge has no hidden checks so don't check hidden here
Definition at line 890 of file editmesh_rip.cc.
References BKE_editmesh_from_object(), BLI_assert, bm, BMEditMesh::bm, BM_edge_is_manifold(), BM_edge_is_wire(), BM_EDGES_OF_VERT, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, BM_ELEM_TAG, BM_ITER_ELEM, BM_ITER_MESH, BM_loop_other_edge_loop(), BM_mesh_edgesplit(), BM_mesh_select_mode_clean_ex(), BM_select_history_validate(), BM_vert_other_disk_edge(), BM_VERTS_OF_MESH, CTX_wm_region(), CTX_wm_region_view3d(), BMLoop::e, e, ED_view3d_ob_project_mat_get(), edbm_rip_edge_side_measure(), edbm_ripsel_deselect_helper(), edbm_ripsel_looptag_helper(), edbm_tagged_loop_pairs_do_fill_faces(), edbm_tagged_loop_pairs_to_fill(), ELEM, float, BMEdge::l, l, l_b, MEM_freeN(), wmEvent::mval, OPERATOR_CANCELLED, OPERATOR_FINISHED, BMLoop::radial_next, SCE_SELECT_EDGE, BMesh::totedge, BMesh::totvert, and v.
Referenced by edbm_rip_invoke().
|
static |
This is the main vert ripping function (rip when one vertex is selected)
Definition at line 524 of file editmesh_rip.cc.
References BKE_editmesh_from_object(), BLI_assert, bm, BMEditMesh::bm, BM_CREATE_NOP, BM_edge_create(), BM_edge_in_loop(), BM_edge_is_boundary(), BM_edge_is_manifold(), BM_edge_is_wire(), BM_edge_vert_share_loop(), BM_EDGES_OF_VERT, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_ELEM_SELECT, BM_ELEM_TAG, BM_face_loop_separate_multi(), BM_face_loop_separate_multi_isolated(), BM_iter_as_array(), BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_VERT, BM_select_history_active_get(), BM_select_history_remove, BM_select_history_store, BM_VERT, BM_vert_edge_count_is_equal, BM_vert_face_count_is_equal, BM_vert_find_first_loop(), BM_vert_is_manifold_region(), BM_vert_is_wire(), BM_vert_select_set(), BM_vert_splice(), BM_VERTS_OF_MESH, bmesh_kernel_vert_separate(), BMVert::co, CTX_wm_region(), CTX_wm_region_view3d(), BMLoop::e, BMVert::e, e, ED_view3d_ob_project_mat_get(), edbm_calc_loop_co(), edbm_rip_edgedist_squared(), edbm_tagged_loop_pairs_do_fill_faces(), edbm_tagged_loop_pairs_to_fill(), BMEditSelection::ele, BMLoop::f, float, FLT_MAX, BMEditSelection::htype, INSET_DEFAULT, BMEdge::l, l, MEM_freeN(), mid_v3_v3v3(), wmEvent::mval, BMLoop::next, OPERATOR_CANCELLED, OPERATOR_FINISHED, BMLoop::prev, BMLoop::radial_next, BMesh::totvert, BMLoop::v, and v.
Referenced by edbm_rip_invoke().
|
static |
Definition at line 350 of file editmesh_rip.cc.
References bm, BM_edge_select_set(), BMVert::e, e, edbm_rip_edge_side_measure(), edbm_ripsel_edge_uid_step(), and edbm_ripsel_edloop_pair_start_vert().
Referenced by edbm_rip_invoke__edge().
Definition at line 204 of file editmesh_rip.cc.
References BM_edge_loop_pair(), BM_EDGES_OF_VERT, BM_elem_index_set, BM_ITER_ELEM, e, IS_VISIT_DONE, IS_VISIT_POSSIBLE, l_b, and v.
Referenced by edbm_ripsel_looptag_helper().
Definition at line 327 of file editmesh_rip.cc.
References BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_index_get, BM_ITER_ELEM, e, BMEdge::l, and v.
Referenced by edbm_ripsel_deselect_helper(), and edbm_ripsel_edloop_pair_start_vert().
Definition at line 343 of file editmesh_rip.cc.
References e, and edbm_ripsel_edge_uid_step().
Referenced by edbm_ripsel_deselect_helper().
|
static |
Definition at line 229 of file editmesh_rip.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), BLI_assert, bm, BM_edge_loop_pair(), BM_edge_other_vert(), BM_EDGES_OF_MESH, BM_elem_index_set, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOP, BM_LOOPS_OF_FACE, e, edbm_ripsel_edge_mark_step(), BMesh::elem_index_dirty, INVALID_UID, IS_VISIT_DONE, IS_VISIT_POSSIBLE, l, EdgeLoopPair::l_a, EdgeLoopPair::l_b, printf, BMesh::totedge, UNUSED_VARS_NDEBUG, and BMEdge::v1.
Referenced by edbm_rip_invoke__edge().
|
static |
Definition at line 447 of file editmesh_rip.cc.
References BLI_assert, bm, BM_CREATE_NOP, BM_edge_other_loop(), BM_edge_other_vert(), BM_edge_share_vert(), BM_elem_attrs_copy(), BM_face_create_verts(), BM_face_exists(), BM_FACE_FIRST_LOOP, BMLoop::e, BMLoop::f, UnorderedLoopPair::flag, UnorderedLoopPair::l_pair, MEM_allocN_len, BMLoop::next, ULP_FLIP_0, ULP_FLIP_1, BMLoop::v, BMEdge::v1, and BMEdge::v2.
Referenced by edbm_rip_invoke__edge(), and edbm_rip_invoke__vert().
|
static |
Definition at line 407 of file editmesh_rip.cc.
References bm, BM_edge_loop_pair(), BM_EDGES_OF_MESH, BM_elem_flag_test, BM_ELEM_TAG, BM_ITER_MESH, BMLoop::e, e, UnorderedLoopPair::flag, UnorderedLoopPair::l_pair, MEM_mallocN, ULP_FLIP_0, ULP_FLIP_1, BMLoop::v, and BMEdge::v1.
Referenced by edbm_rip_invoke__edge(), and edbm_rip_invoke__vert().
| void MESH_OT_rip | ( | wmOperatorType * | ot | ) |
Definition at line 1130 of file editmesh_rip.cc.
References BLT_I18NCONTEXT_ID_MESH, wmOperatorType::description, edbm_rip_invoke(), EDBM_view3d_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_DEPENDS_ON_CURSOR, OPTYPE_REGISTER, OPTYPE_UNDO, ot, P_MIRROR_DUMMY, P_PROPORTIONAL, wmOperatorType::poll, RNA_def_boolean(), RNA_def_property_translation_context(), wmOperatorType::srna, and Transform_Properties().
Referenced by ED_operatortypes_mesh().