|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "DNA_object_types.h"#include "BLI_array.h"#include "BLI_math.h"#include "BKE_context.h"#include "BKE_editmesh.h"#include "BKE_layer.h"#include "BKE_report.h"#include "RNA_access.h"#include "RNA_define.h"#include "WM_types.h"#include "ED_mesh.h"#include "ED_screen.h"#include "ED_transform.h"#include "ED_view3d.h"#include "bmesh.h"#include "bmesh_tools.h"#include "mesh_intern.h"Go to the source code of this file.
Classes | |
| struct | EdgeLoopPair |
| struct | UnorderedLoopPair |
Macros | |
| #define | INSET_DEFAULT 0.00001f |
| #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 |
Typedefs | |
| typedef struct EdgeLoopPair | EdgeLoopPair |
| typedef struct UnorderedLoopPair | UnorderedLoopPair |
Enumerations | |
| enum | { ULP_FLIP_0 = (1 << 0) , ULP_FLIP_1 = (1 << 1) } |
| #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 58 of file editmesh_rip.c.
| #define INVALID_UID INT_MIN |
Definition at line 199 of file editmesh_rip.c.
| #define IS_VISIT_DONE | ( | e | ) | ((e)->l && (BM_elem_index_get((e)->l) != INVALID_UID)) |
Definition at line 198 of file editmesh_rip.c.
| #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 but for now not essential.
Definition at line 197 of file editmesh_rip.c.
| typedef struct EdgeLoopPair EdgeLoopPair |
| typedef struct UnorderedLoopPair UnorderedLoopPair |
return an un-ordered array of loop pairs use for rebuilding face-fill
| anonymous enum |
| Enumerator | |
|---|---|
| ULP_FLIP_0 | |
| ULP_FLIP_1 | |
Definition at line 398 of file editmesh_rip.c.
Calculates a point along the loop tangent which can be used to measure against edges.
Definition at line 103 of file editmesh_rip.c.
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 114 of file editmesh_rip.c.
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(), mid_v3_v3v3(), normalize_v2_length(), sub_v2_v2v2(), and BMLoop::v.
Referenced by edbm_rip_invoke__edge(), and edbm_ripsel_deselect_helper().
|
static |
Definition at line 59 of file editmesh_rip.c.
References BLI_assert, dist_squared_to_line_segment_v2(), ED_view3d_project_float_v2_m4(), interp_v2_v2v2(), CCL_NAMESPACE_BEGIN::isfinite(), and len_v2v2().
Referenced by edbm_rip_invoke__vert().
|
static |
Definition at line 1004 of file editmesh_rip.c.
References BKE_editmesh_from_object(), BKE_report(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data, BLI_assert, BMEditMesh::bm, 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, C, CTX_data_view_layer(), CTX_wm_view3d(), Object::data, e, edbm_rip_invoke__edge(), edbm_rip_invoke__vert(), EDBM_update_generic(), MEM_freeN, OPERATOR_CANCELLED, OPERATOR_FINISHED, 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 874 of file editmesh_rip.c.
References BKE_editmesh_from_object(), BLI_assert, BMEditMesh::bm, 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, C, 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(), BMEdge::l, l, l_b, MEM_freeN, NULL, 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 515 of file editmesh_rip.c.
References BKE_editmesh_from_object(), BLI_assert, BMEditMesh::bm, 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(), C, BMVert::co, CTX_wm_region(), CTX_wm_region_view3d(), BMVert::e, BMLoop::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, BMEditSelection::htype, i1, INSET_DEFAULT, BMEdge::l, l, MEM_freeN, mid_v3_v3v3(), BMLoop::next, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, BMLoop::prev, BMLoop::radial_next, SWAP, BMesh::totvert, BMLoop::v, and v.
Referenced by edbm_rip_invoke().
|
static |
Definition at line 348 of file editmesh_rip.c.
References bm, BM_edge_select_set(), BMLoop::e, e, edbm_rip_edge_side_measure(), edbm_ripsel_edge_uid_step(), edbm_ripsel_edloop_pair_start_vert(), EdgeLoopPair::l_a, and EdgeLoopPair::l_b.
Referenced by edbm_rip_invoke__edge().
Definition at line 202 of file editmesh_rip.c.
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, NULL, and v.
Referenced by edbm_ripsel_looptag_helper().
Definition at line 325 of file editmesh_rip.c.
References BM_edge_other_vert(), BM_EDGES_OF_VERT, BM_elem_index_get, BM_ITER_ELEM, e, BMEdge::l, NULL, and v.
Referenced by edbm_ripsel_deselect_helper(), and edbm_ripsel_edloop_pair_start_vert().
Definition at line 341 of file editmesh_rip.c.
References e, and edbm_ripsel_edge_uid_step().
Referenced by edbm_ripsel_deselect_helper().
|
static |
Definition at line 227 of file editmesh_rip.c.
References BLI_array_append_ret, BLI_array_declare, 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, NULL, BMesh::totedge, and BMEdge::v1.
Referenced by edbm_rip_invoke__edge().
|
static |
Definition at line 442 of file editmesh_rip.c.
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, NULL, SWAP, 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 403 of file editmesh_rip.c.
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, NULL, 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 1110 of file editmesh_rip.c.
References wmOperatorType::description, edbm_rip_invoke(), EDBM_view3d_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, P_MIRROR_DUMMY, P_PROPORTIONAL, wmOperatorType::poll, RNA_def_boolean(), wmOperatorType::srna, and Transform_Properties().
Referenced by ED_operatortypes_mesh().