|
Blender V5.0
|
#include "BLI_atomic_disjoint_set.hh"#include "BLI_math_matrix.h"#include "BLI_math_vector.h"#include "BLI_math_vector.hh"#include "BLI_task.hh"#include "BLI_vector_set.hh"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "BKE_attribute.hh"#include "BKE_context.hh"#include "BKE_customdata.hh"#include "BKE_mesh.hh"#include "BKE_mesh_mapping.hh"#include "BKE_object.hh"#include "ED_mesh.hh"#include "ED_screen.hh"#include "ED_select_utils.hh"#include "ED_view3d.hh"#include "WM_api.hh"#include "WM_types.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"Go to the source code of this file.
Functions | |
| void | paintface_flush_flags (bContext *C, Object *ob, const bool flush_selection, const bool flush_hidden) |
| void | paintface_hide (bContext *C, Object *ob, const bool unselected) |
| void | paintface_reveal (bContext *C, Object *ob, const bool select) |
| static void | build_poly_connections (blender::AtomicDisjointSet &islands, Mesh &mesh, const bool skip_seams=true) |
| static void | paintface_select_linked_faces (Mesh &mesh, const blender::Span< int > face_indices, const bool select) |
| void | paintface_select_linked (bContext *C, Object *ob, const int mval[2], const bool select) |
| static int | get_opposing_edge_index (const blender::IndexRange face, const blender::Span< int > corner_edges, const int current_edge_index) |
| static bool | follow_face_loop (const int face_start_index, const int edge_start_index, const blender::OffsetIndices< int > faces, const blender::VArray< bool > &hide_poly, const blender::Span< int > corner_edges, const blender::GroupedSpan< int > edge_to_face_map, blender::VectorSet< int > &r_loop_faces) |
| void | paintface_select_loop (bContext *C, Object *ob, const int mval[2], const bool select) |
| static bool | poly_has_selected_neighbor (blender::Span< int > face_edges, blender::Span< blender::int2 > edges, blender::Span< bool > select_vert, const bool face_step) |
| void | paintface_select_more (Mesh *mesh, const bool face_step) |
| static bool | poly_has_unselected_neighbor (blender::Span< int > face_edges, blender::Span< blender::int2 > edges, blender::BitSpan verts_of_unselected_faces, const bool face_step) |
| void | paintface_select_less (Mesh *mesh, const bool face_step) |
| bool | paintface_deselect_all_visible (bContext *C, Object *ob, int action, bool flush_flags) |
| bool | paintface_minmax (Object *ob, float r_min[3], float r_max[3]) |
| bool | paintface_mouse_select (bContext *C, const int mval[2], const SelectPick_Params ¶ms, Object *ob) |
| void | paintvert_flush_flags (Object *ob) |
| static void | paintvert_select_linked_vertices (bContext *C, Object *ob, const blender::Span< int > vertex_indices, const bool select) |
| void | paintvert_select_linked_pick (bContext *C, Object *ob, const int region_coordinates[2], const bool select) |
| void | paintvert_select_linked (bContext *C, Object *ob) |
| void | paintvert_select_more (Mesh *mesh, const bool face_step) |
| void | paintvert_select_less (Mesh *mesh, const bool face_step) |
| void | paintvert_tag_select_update (bContext *C, Object *ob) |
| bool | paintvert_deselect_all_visible (Object *ob, int action, bool flush_flags) |
| void | paintvert_select_ungrouped (Object *ob, bool extend, bool flush_flags) |
| void | paintvert_hide (bContext *C, Object *ob, const bool unselected) |
| void | paintvert_reveal (bContext *C, Object *ob, const bool select) |
|
static |
Join all edges of each face in the #AtomicDisjointSet. This can be used to find out which faces are connected to each other.
| islands | Is expected to be of length mesh->edges_num. |
| skip_seams | Faces separated by a seam will be treated as not connected. |
Definition at line 220 of file editface.cc.
References Geometry::attributes, blender::bke::Edge, blender::bke::Face, faces, blender::bke::AttributeAccessor::lookup_or_default(), and blender::threading::parallel_for().
Referenced by paintface_select_linked_faces().
|
static |
Follow quads around the mesh by finding opposing edges.
Definition at line 367 of file editface.cc.
References blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), faces, get_opposing_edge_index(), and size().
Referenced by paintface_select_loop().
|
static |
Definition at line 350 of file editface.cc.
References blender::Span< T >::first_index(), and blender::Span< T >::slice().
Referenced by follow_face_loop().
Definition at line 623 of file editface.cc.
References BKE_mesh_from_object(), C, blender::bke::Face, Mesh::faces_num, blender::bke::GSpanAttributeWriter::finish(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), paintface_flush_flags(), SEL_DESELECT, SEL_INVERT, SEL_SELECT, and SEL_TOGGLE.
Referenced by do_lasso_select_paintface(), do_paintface_box_select(), ed_wpaint_vertex_select_pick(), face_select_all_exec(), paint_facesel_circle_select(), paintface_mouse_select(), and paintface_select_loop_invoke().
Copy the face flags, most importantly selection from the mesh to the final evaluated mesh, use in object mode when selecting faces (while painting).
Definition at line 40 of file editface.cc.
References Geometry::attributes, BKE_mesh_batch_cache_dirty_tag(), BKE_MESH_BATCH_DIRTY_ALL, BKE_MESH_BATCH_DIRTY_SELECT_PAINT, BKE_mesh_from_object(), BLI_assert, C, CD_ORIGINDEX, CTX_data_ensure_evaluated_depsgraph(), CustomData_get_layer(), Object::data, DEG_get_evaluated(), DEG_id_tag_update(), depsgraph, blender::bke::Face, Mesh::face_data, Mesh::faces_num, blender::bke::GSpanAttributeWriter::finish(), i, ID_RECALC_SELECT, ID_RECALC_SYNC_TO_EVAL, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::VArrayCommon< T >::materialize(), blender::bke::mesh_select_face_flush(), NC_GEOM, ND_SELECT, ORIGINDEX_NONE, Object::runtime, and WM_event_add_notifier().
Referenced by do_lasso_select_paintface(), do_paintface_box_select(), paint_facesel_circle_select(), paint_select_less_exec(), paint_select_more_exec(), paintface_deselect_all_visible(), paintface_hide(), paintface_mouse_select(), paintface_reveal(), paintface_select_linked(), and paintface_select_loop().
Definition at line 150 of file editface.cc.
References BKE_mesh_from_object(), C, blender::bke::Face, Mesh::faces_num, blender::bke::SpanAttributeWriter< T >::finish(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::mesh_hide_face_flush(), paintface_flush_flags(), and blender::bke::SpanAttributeWriter< T >::span.
Referenced by face_select_hide_exec().
Definition at line 682 of file editface.cc.
References add_v3_v3v3(), Geometry::attributes, BKE_mesh_from_object(), CD_PROP_FLOAT2, copy_m3_m4(), Mesh::corner_data, CustomData_has_layer(), blender::bke::Face, faces, Mesh::faces_num, i, blender::bke::AttributeAccessor::lookup_or_default(), minmax_v3v3_v3(), mul_v3_m3v3(), and Span< T >::slice().
Referenced by view3d_calc_minmax_selected().
| bool paintface_mouse_select | ( | bContext * | C, |
| const int | mval[2], | ||
| const SelectPick_Params & | params, | ||
| Object * | ob ) |
Definition at line 721 of file editface.cc.
References Mesh::act_face, BKE_mesh_from_object(), BLI_assert_unreachable, C, CTX_wm_region(), ED_MESH_PICK_DEFAULT_FACE_DIST, ED_mesh_pick_face(), ED_region_tag_redraw(), blender::bke::Face, blender::bke::GAttributeWriter::finish(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write(), blender::bke::AttributeAccessor::lookup_or_default(), paintface_deselect_all_visible(), paintface_flush_flags(), params, SEL_DESELECT, SEL_OP_ADD, SEL_OP_AND, SEL_OP_SET, SEL_OP_SUB, and SEL_OP_XOR.
Referenced by view3d_select_exec().
Definition at line 184 of file editface.cc.
References BKE_mesh_from_object(), C, blender::bke::Face, Mesh::faces_num, blender::bke::GSpanAttributeWriter::finish(), i, blender::VArrayCommon< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::mesh_hide_face_flush(), paintface_flush_flags(), blender::bke::MutableAttributeAccessor::remove(), and select.
Referenced by face_vert_reveal_exec().
| void paintface_select_less | ( | Mesh * | mesh, |
| const bool | face_step ) |
Definition at line 578 of file editface.cc.
References blender::bke::Face, face_step(), faces, i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::threading::parallel_for(), Span< T >::slice(), blender::bke::SpanAttributeWriter< T >::span, and Mesh::verts_num.
Referenced by paint_select_less_exec().
Definition at line 310 of file editface.cc.
References BKE_mesh_from_object(), C, ED_MESH_PICK_DEFAULT_FACE_DIST, ED_mesh_pick_face(), blender::bke::Face, Mesh::faces_num, blender::bke::SpanAttributeWriter< T >::finish(), i, indices, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), paintface_flush_flags(), paintface_select_linked_faces(), select, and blender::bke::SpanAttributeWriter< T >::span.
Referenced by paint_select_linked_exec(), and paint_select_linked_pick_invoke().
|
static |
Definition at line 266 of file editface.cc.
References build_poly_connections(), blender::bke::Edge, Mesh::edges_num, blender::bke::Face, faces, blender::AtomicDisjointSet::find_root(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::threading::parallel_for(), select, and Span< T >::slice().
Referenced by paintface_select_linked().
Definition at line 418 of file editface.cc.
References VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::as_span(), BKE_mesh_from_object(), blender::bke::mesh::build_edge_to_face_map(), C, CTX_data_ensure_evaluated_depsgraph(), CTX_wm_region(), DEG_get_evaluated(), depsgraph, ED_MESH_PICK_DEFAULT_VERT_DIST, ED_mesh_pick_edge(), ED_view3d_init_mats_rv3d(), ED_view3d_select_id_validate(), ED_view3d_viewcontext_init(), Mesh::edges_num, blender::bke::Face, faces, blender::bke::SpanAttributeWriter< T >::finish(), follow_face_loop(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), paintface_flush_flags(), ARegion::regiondata, select, and blender::bke::SpanAttributeWriter< T >::span.
Referenced by paintface_select_loop_invoke().
| void paintface_select_more | ( | Mesh * | mesh, |
| bool | face_step ) |
Grow the selection of faces.
| face_step | If true will also select faces that only touch on the corner. |
Definition at line 524 of file editface.cc.
References blender::bke::Face, face_step(), faces, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::threading::parallel_for(), blender::bke::Point, and blender::bke::SpanAttributeWriter< T >::span.
Referenced by paint_select_more_exec().
| bool paintvert_deselect_all_visible | ( | Object * | ob, |
| int | action, | ||
| bool | flush_flags ) |
Definition at line 1052 of file editface.cc.
References BKE_mesh_from_object(), BKE_mesh_mselect_clear(), BKE_mesh_mselect_validate(), ELEM, blender::bke::GSpanAttributeWriter::finish(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), paintvert_flush_flags(), blender::bke::Point, SEL_DESELECT, SEL_INVERT, SEL_SELECT, SEL_TOGGLE, and Mesh::verts_num.
Referenced by do_lasso_select_paintvert(), do_paintvert_box_select(), ed_wpaint_vertex_select_pick(), paint_vertsel_circle_select(), paintvert_select_ungrouped(), and vert_select_all_exec().
| void paintvert_flush_flags | ( | Object * | ob | ) |
(similar to void paintface_flush_flags(Object *ob)) copy the vertex flags, most importantly selection from the mesh to the final evaluated mesh, use in object mode when selecting vertices (while painting).
Definition at line 787 of file editface.cc.
References Geometry::attributes, BKE_mesh_batch_cache_dirty_tag(), BKE_MESH_BATCH_DIRTY_ALL, BKE_mesh_from_object(), BKE_object_get_evaluated_mesh(), CD_ORIGINDEX, CustomData_get_layer(), blender::bke::GSpanAttributeWriter::finish(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::VArrayCommon< T >::materialize(), blender::bke::mesh_select_vert_flush(), ORIGINDEX_NONE, blender::bke::Point, and Mesh::vert_data.
Referenced by do_lasso_select_paintvert(), do_paintvert_box_select(), ed_wpaint_vertex_select_pick(), paint_vertsel_circle_select(), paintvert_deselect_all_visible(), paintvert_hide(), paintvert_reveal(), paintvert_select_less_exec(), paintvert_select_more_exec(), paintvert_select_ungrouped(), and blender::ed::object::vgroup_select_verts().
Definition at line 1158 of file editface.cc.
References BKE_mesh_from_object(), C, blender::bke::SpanAttributeWriter< T >::finish(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::mesh_hide_vert_flush(), paintvert_flush_flags(), paintvert_tag_select_update(), blender::bke::Point, blender::bke::SpanAttributeWriter< T >::span, and Mesh::verts_num.
Referenced by vert_select_hide_exec().
Definition at line 1192 of file editface.cc.
References BKE_mesh_from_object(), C, blender::bke::GSpanAttributeWriter::finish(), i, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::mesh_hide_vert_flush(), paintvert_flush_flags(), paintvert_tag_select_update(), blender::bke::Point, blender::bke::MutableAttributeAccessor::remove(), select, and Mesh::verts_num.
Referenced by face_vert_reveal_exec().
| void paintvert_select_less | ( | Mesh * | mesh, |
| const bool | face_step ) |
Definition at line 991 of file editface.cc.
References blender::bke::mesh::build_edge_to_face_map(), blender::bke::Edge, blender::bke::Face, face_step(), faces, blender::bke::SpanAttributeWriter< T >::finish(), i, Span< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::Point, Span< T >::size(), Span< T >::slice(), blender::bke::SpanAttributeWriter< T >::span, and Mesh::verts_num.
Referenced by paintvert_select_less_exec().
Definition at line 910 of file editface.cc.
References BKE_mesh_from_object(), C, Mesh::faces_num, blender::bke::SpanAttributeWriter< T >::finish(), i, indices, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), paintvert_select_linked_vertices(), blender::bke::Point, and blender::bke::SpanAttributeWriter< T >::span.
Referenced by paintvert_select_linked_exec().
| void paintvert_select_linked_pick | ( | bContext * | C, |
| Object * | ob, | ||
| const int | region_coordinates[2], | ||
| const bool | select ) |
Definition at line 896 of file editface.cc.
References C, ED_MESH_PICK_DEFAULT_VERT_DIST, ED_mesh_pick_vert(), paintvert_select_linked_vertices(), and select.
Referenced by paintvert_select_linked_pick_invoke().
|
static |
Definition at line 846 of file editface.cc.
References BKE_mesh_from_object(), C, Mesh::faces_num, Span< T >::index_range(), blender::threading::parallel_for(), select, and Mesh::verts_num.
Referenced by paintvert_select_linked(), and paintvert_select_linked_pick().
| void paintvert_select_more | ( | Mesh * | mesh, |
| const bool | face_step ) |
Definition at line 933 of file editface.cc.
References blender::bke::mesh::build_edge_to_face_map(), blender::bke::Edge, Mesh::edges_num, blender::bke::Face, face_step(), faces, blender::bke::SpanAttributeWriter< T >::finish(), i, Span< T >::index_range(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), blender::bke::Point, Span< T >::slice(), blender::bke::SpanAttributeWriter< T >::span, and Mesh::verts_num.
Referenced by paintvert_select_more_exec().
| void paintvert_select_ungrouped | ( | Object * | ob, |
| bool | extend, | ||
| bool | flush_flags ) |
Definition at line 1120 of file editface.cc.
References BKE_mesh_from_object(), blender::bke::GSpanAttributeWriter::finish(), i, Span< T >::is_empty(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::bke::AttributeAccessor::lookup_or_default(), paintvert_deselect_all_visible(), paintvert_flush_flags(), blender::bke::Point, and SEL_DESELECT.
Referenced by vert_select_ungrouped_exec().
Definition at line 1046 of file editface.cc.
References C, Object::data, DEG_id_tag_update(), ID_RECALC_SELECT, ID_RECALC_SYNC_TO_EVAL, NC_GEOM, ND_SELECT, and WM_event_add_notifier().
Referenced by do_lasso_select_paintvert(), do_paintvert_box_select(), ed_wpaint_vertex_select_pick(), paint_vertsel_circle_select(), paintvert_hide(), paintvert_reveal(), paintvert_select_less_exec(), paintvert_select_more_exec(), vert_select_all_exec(), and vert_select_ungrouped_exec().
|
static |
Definition at line 501 of file editface.cc.
References face_step().
|
static |
Definition at line 557 of file editface.cc.
References face_step().