|
Blender V4.3
|
Classes | |
| struct | Cache |
Functions | |
| static bool | is_vert_in_active_component (const SculptSession &ss, const Cache &expand_cache, const int vert) |
| static bool | is_face_in_active_component (const Object &object, const OffsetIndices< int > faces, const Span< int > corner_verts, const Cache &expand_cache, const int f) |
| static float | falloff_value_vertex_get (const SculptSession &ss, const Cache &expand_cache, const float3 &position, const int vert) |
| static float | max_vert_falloff_get (const Cache &expand_cache) |
| static bool | vert_falloff_is_enabled (const SculptSession &ss, const Cache &expand_cache, const float3 &position, const int vert) |
| static bool | face_state_get (const Object &object, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< bool > hide_poly, const Span< int > face_sets, const Cache &expand_cache, const int face) |
| static float | gradient_value_get (const SculptSession &ss, const Cache &expand_cache, const float3 &position, const int vert) |
| static BitVector | enabled_state_to_bitmap (const Depsgraph &depsgraph, const Object &object, const Cache &expand_cache) |
| static IndexMask | boundary_from_enabled (Object &object, const BitSpan enabled_verts, const bool use_mesh_boundary, IndexMaskMemory &memory) |
| static void | check_topology_islands (Object &ob, FalloffType falloff_type) |
| static Array< float > | geodesic_falloff_create (const Depsgraph &depsgraph, Object &ob, const IndexMask &initial_verts) |
| static Array< float > | geodesic_falloff_create (const Depsgraph &depsgraph, Object &ob, const int initial_vert) |
| static void | calc_topology_falloff_from_verts (Object &ob, const IndexMask &initial_verts, MutableSpan< float > distances) |
| static Array< float > | topology_falloff_create (const Depsgraph &depsgraph, Object &ob, const int initial_vert) |
| static Array< float > | normals_falloff_create (const Depsgraph &depsgraph, Object &ob, const int vert, const float edge_sensitivity, const int blur_steps) |
| static Array< float > | spherical_falloff_create (const Depsgraph &depsgraph, const Object &object, const int vert) |
| static Array< float > | boundary_topology_falloff_create (const Depsgraph &depsgraph, Object &ob, const int inititial_vert) |
| static Array< float > | diagonals_falloff_create (const Depsgraph &depsgraph, Object &ob, const int vert) |
| static void | update_max_vert_falloff_value (const Object &object, Cache &expand_cache) |
| static void | update_max_face_falloff_factor (const Object &object, Mesh &mesh, Cache &expand_cache) |
| static void | vert_to_face_falloff_grids (SculptSession &ss, Mesh *mesh, Cache &expand_cache) |
| static void | vert_to_face_falloff_mesh (Mesh *mesh, Cache &expand_cache) |
| static void | vert_to_face_falloff (Object &object, Mesh *mesh, Cache &expand_cache) |
| static void | geodesics_from_state_boundary (const Depsgraph &depsgraph, Object &ob, Cache &expand_cache, const BitSpan enabled_verts) |
| static void | topology_from_state_boundary (Object &ob, Cache &expand_cache, const BitSpan enabled_verts) |
| static void | resursion_step_add (const Depsgraph &depsgraph, Object &ob, Cache &expand_cache, const RecursionType recursion_type) |
| static void | init_from_face_set_boundary (const Depsgraph &depsgraph, Object &ob, Cache &expand_cache, const int active_face_set, const bool internal_falloff) |
| static void | calc_falloff_from_vert_and_symmetry (const Depsgraph &depsgraph, Cache &expand_cache, Object &ob, const int vert, FalloffType falloff_type) |
| static void | snap_init_from_enabled (const Depsgraph &depsgraph, const Object &object, Cache &expand_cache) |
| static void | expand_cache_free (SculptSession &ss) |
| static void | restore_face_set_data (Object &object, Cache &expand_cache) |
| static void | restore_color_data (Object &ob, Cache &expand_cache) |
| static void | write_mask_data (Object &object, const Span< float > mask) |
| static void | restore_original_state (bContext *C, Object &ob, Cache &expand_cache) |
| static void | sculpt_expand_cancel (bContext *C, wmOperator *) |
| static void | calc_new_mask_mesh (const SculptSession &ss, const Span< float3 > positions, const BitSpan enabled_verts, const Span< int > verts, const MutableSpan< float > mask) |
| static bool | update_mask_grids (const SculptSession &ss, const BitSpan enabled_verts, bke::pbvh::GridsNode &node, SubdivCCG &subdiv_ccg) |
| static bool | update_mask_bmesh (SculptSession &ss, const BitSpan enabled_verts, const int mask_offset, bke::pbvh::BMeshNode *node) |
| static void | face_sets_update (Object &object, Cache &expand_cache) |
| static bool | colors_update_task (const Depsgraph &depsgraph, Object &object, const Span< float3 > vert_positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_vert, const Span< float > mask, bke::pbvh::MeshNode *node, bke::GSpanAttributeWriter &color_attribute) |
| static void | original_state_store (Object &ob, Cache &expand_cache) |
| static void | face_sets_restore (Object &object, Cache &expand_cache) |
| static void | update_for_vert (bContext *C, Object &ob, const std::optional< int > vertex) |
| static std::optional< int > | target_vert_update_and_get (bContext *C, Object &ob, const float mval[2]) |
| static void | reposition_pivot (bContext *C, Object &ob, Cache &expand_cache) |
| static void | finish (bContext *C) |
| static void | find_active_connected_components_from_vert (const Depsgraph &depsgraph, Object &ob, Cache &expand_cache, const int initial_vertex) |
| static bool | set_initial_components_for_mouse (bContext *C, Object &ob, Cache &expand_cache, const float mval[2]) |
| static void | move_propagation_origin (bContext *C, Object &ob, const wmEvent *event, Cache &expand_cache) |
| static void | ensure_sculptsession_data (Object &ob) |
| static int | active_face_set_id_get (Object &object, Cache &expand_cache) |
| static int | sculpt_expand_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | delete_face_set_id (int *r_face_sets, Object &object, Cache &expand_cache, Mesh *mesh, const int delete_id) |
| static void | cache_initial_config_set (bContext *C, wmOperator *op, Cache &expand_cache) |
| static void | undo_push (const Depsgraph &depsgraph, Object &ob, Cache &expand_cache) |
| static bool | any_nonzero_mask (const Object &object) |
| static int | sculpt_expand_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| void | modal_keymap (wmKeyConfig *keyconf) |
| void | SCULPT_OT_expand (wmOperatorType *ot) |
| anonymous enum |
Definition at line 114 of file sculpt_expand.cc.
|
strong |
| Enumerator | |
|---|---|
| Geodesic | |
| Topology | |
| TopologyNormals | |
| Normals | |
| Sphere | |
| BoundaryTopology | |
| BoundaryFaceSet | |
| ActiveFaceSet | |
Definition at line 25 of file sculpt_expand.hh.
|
strong |
| Enumerator | |
|---|---|
| Topology | |
| Geodesic | |
Definition at line 42 of file sculpt_expand.hh.
|
strong |
| Enumerator | |
|---|---|
| Mask | |
| FaceSets | |
| Colors | |
Definition at line 36 of file sculpt_expand.hh.
|
static |
Returns the active Face Sets ID from the enabled face or grid in the SculptSession.
Definition at line 2267 of file sculpt_expand.cc.
References SculptSession::active_face_index, active_face_set_id_get(), SculptSession::active_grid_index, BKE_subdiv_ccg_grid_to_face_index(), BLI_assert, blender::ed::sculpt_paint::expand::Cache::original_face_sets, SCULPT_FACE_SET_NONE, and SculptSession::subdiv_ccg.
Referenced by active_face_set_id_get(), and sculpt_expand_modal().
|
static |
Definition at line 2613 of file sculpt_expand.cc.
References any_nonzero_mask(), bm, SculptSession::bm, BM_ELEM_CD_GET_FLOAT, BM_ITER_MESH, BM_VERTS_OF_MESH, CD_PROP_FLOAT, CustomData_get_offset_named(), SubdivCCG::masks, SculptSession::subdiv_ccg, and BMesh::vdata.
Referenced by any_nonzero_mask(), and sculpt_expand_invoke().
|
static |
Returns a bitmap indexed by vertex index which contains if the vertex is in the boundary of the enabled vertices. This is defined as vertices that are enabled and at least have one connected vertex that is not enabled.
Definition at line 449 of file sculpt_expand.cc.
References BKE_subdiv_ccg_key_top_level(), BKE_subdiv_ccg_neighbor_coords_get(), BLI_assert_unreachable, SculptSession::bm, BM_elem_index_get, BM_vert_at_index(), BM_vert_is_boundary(), blender::bke::pbvh::BMesh, SculptVertexInfo::boundary, SubdivCCGNeighbors::coords, blender::bke::Face, blender::index_mask::IndexMask::from_bits(), SubdivCCGCoord::from_index(), blender::index_mask::IndexMask::from_predicate(), blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, blender::bke::object::pbvh_get(), SCULPT_vertex_count_get(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::boundary::vert_is_boundary(), blender::ed::sculpt_paint::vert_neighbors_get_bmesh(), blender::ed::sculpt_paint::vert_neighbors_get_mesh(), and SculptSession::vertex_info.
Referenced by geodesics_from_state_boundary(), reposition_pivot(), and topology_from_state_boundary().
|
static |
Boundary: This falloff mode uses the code from sculpt_boundary to initialize the closest mesh boundary to a falloff value of 0. Then, it propagates that falloff to the rest of the mesh so it stays parallel to the boundary, increasing the falloff value by 1 on each step.
Definition at line 992 of file sculpt_expand.cc.
References boundary_topology_falloff_create(), calc_topology_falloff_from_verts(), depsgraph, blender::ed::sculpt_paint::find_symm_verts(), FLT_MAX, and SCULPT_vertex_count_get().
Referenced by boundary_topology_falloff_create(), and calc_falloff_from_vert_and_symmetry().
|
static |
Definition at line 2560 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::auto_mask, BKE_brush_color_get(), BKE_curvemapping_init(), BKE_paint_brush_for_read(), BKE_paint_get_active_from_context(), Brush::blend, blender::ed::sculpt_paint::expand::Cache::blend_mode, blender::ed::sculpt_paint::expand::Cache::brush, blender::ed::sculpt_paint::expand::Cache::brush_gradient, cache_initial_config_set(), copy_v3_v3(), copy_v4_fl(), CTX_data_scene(), CTX_data_tool_settings(), Brush::curve, blender::ed::sculpt_paint::expand::Cache::falloff_gradient, blender::ed::sculpt_paint::expand::Cache::fill_color, IMB_colormanagement_srgb_to_scene_linear_v3(), blender::ed::sculpt_paint::expand::Cache::invert, blender::ed::sculpt_paint::expand::Cache::loop_count, blender::ed::sculpt_paint::expand::Cache::max_geodesic_move_preview, blender::ed::sculpt_paint::expand::Cache::modify_active_face_set, blender::ed::sculpt_paint::expand::Cache::normal_falloff_blur_steps, Sculpt::paint, blender::ed::sculpt_paint::expand::Cache::preserve, wmOperator::ptr, blender::ed::sculpt_paint::expand::Cache::reposition_pivot, RNA_boolean_get(), RNA_enum_get(), RNA_int_get(), blender::ed::sculpt_paint::expand::Cache::scene, ToolSettings::sculpt, blender::ed::sculpt_paint::expand::Cache::target, and blender::ed::sculpt_paint::expand::Cache::texture_distortion_strength.
Referenced by cache_initial_config_set(), and sculpt_expand_invoke().
|
static |
Main function to initialize new falloff values in a #Cache given an initial vertex and a falloff type.
Definition at line 1389 of file sculpt_expand.cc.
References boundary_topology_falloff_create(), calc_falloff_from_vert_and_symmetry(), Object::data, depsgraph, diagonals_falloff_create(), blender::ed::sculpt_paint::expand::Cache::falloff_type, geodesic_falloff_create(), init_from_face_set_boundary(), blender::ed::sculpt_paint::expand::Cache::initial_active_face_set, blender::ed::sculpt_paint::expand::Cache::normal_falloff_blur_steps, normals_falloff_create(), SCULPT_EXPAND_NORMALS_FALLOFF_EDGE_SENSITIVITY, spherical_falloff_create(), blender::ed::sculpt_paint::expand::Cache::target, topology_falloff_create(), blender::bke::pbvh::Tree::type(), update_max_face_falloff_factor(), update_max_vert_falloff_value(), blender::ed::sculpt_paint::expand::Cache::vert_falloff, and vert_to_face_falloff().
Referenced by calc_falloff_from_vert_and_symmetry(), move_propagation_origin(), sculpt_expand_invoke(), and sculpt_expand_modal().
|
static |
Definition at line 1621 of file sculpt_expand.cc.
References calc_new_mask_mesh(), blender::ed::sculpt_paint::expand::Cache::check_islands, SculptSession::expand_cache, gradient_value_get(), blender::ed::sculpt_paint::expand::Cache::invert, is_vert_in_active_component(), max_ff(), min_ff(), blender::ed::sculpt_paint::expand::Cache::original_mask, blender::ed::sculpt_paint::expand::Cache::preserve, and verts.
Referenced by calc_new_mask_mesh(), and update_for_vert().
|
static |
Topology: Initializes the falloff using a flood-fill operation, increasing the falloff value by 1 when visiting a new vertex.
Definition at line 737 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::flood_fill::FillDataBMesh::add_and_skip_initial(), blender::ed::sculpt_paint::flood_fill::FillDataGrids::add_and_skip_initial(), blender::ed::sculpt_paint::flood_fill::FillDataMesh::add_and_skip_initial(), BKE_subdiv_ccg_key_top_level(), bm, SculptSession::bm, BM_elem_index_get, BM_vert_at_index(), blender::bke::pbvh::BMesh, Object::data, blender::ed::sculpt_paint::flood_fill::FillDataBMesh::execute(), blender::ed::sculpt_paint::flood_fill::FillDataGrids::execute(), blender::ed::sculpt_paint::flood_fill::FillDataMesh::execute(), blender::index_mask::IndexMask::foreach_index(), SubdivCCGCoord::from_index(), blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, blender::bke::object::pbvh_get(), Object::sculpt, SCULPT_vertex_count_get(), SculptSession::subdiv_ccg, and blender::bke::pbvh::Tree::type().
Referenced by boundary_topology_falloff_create(), topology_falloff_create(), and topology_from_state_boundary().
|
static |
Definition at line 536 of file sculpt_expand.cc.
References BoundaryTopology, blender::ed::sculpt_paint::expand::Cache::check_islands, ELEM, blender::ed::sculpt_paint::islands::ensure_cache(), SculptSession::expand_cache, Geodesic, Normals, Object::sculpt, Topology, and TopologyNormals.
Referenced by sculpt_expand_invoke(), and sculpt_expand_modal().
|
static |
Callback to update vertex colors per bke::pbvh::Tree node.
Definition at line 1789 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::blend_mode, clamp_f(), colors_update_task(), depsgraph, blender::bke::GSpanAttributeWriter::domain, enabled_state_to_bitmap(), SculptSession::expand_cache, fade(), blender::ed::sculpt_paint::expand::Cache::fill_color, gradient_value_get(), IMB_blend_color_float(), blender::Span< T >::is_empty(), mul_v4_v4fl(), blender::ed::sculpt_paint::expand::Cache::original_colors, blender::bke::GSpanAttributeWriter::span, and verts.
Referenced by colors_update_task(), and update_for_vert().
|
static |
Deletes the delete_id Face Set ID from the mesh Face Sets and stores the result in r_face_set. The faces that were using the delete_id Face Set are filled using the content from their neighbors.
Definition at line 2486 of file sculpt_expand.cc.
References BLI_LINKSTACK_DECLARE, BLI_LINKSTACK_FREE, BLI_LINKSTACK_INIT, BLI_LINKSTACK_POP, BLI_LINKSTACK_PUSH, BLI_LINKSTACK_SIZE, BLI_LINKSTACK_SWAP, delete_face_set_id(), is_face_in_active_component(), blender::ed::sculpt_paint::expand::Cache::original_face_sets, POINTER_AS_INT, POINTER_FROM_INT, and blender::Span< T >::slice().
Referenced by delete_face_set_id(), and sculpt_expand_invoke().
|
static |
Topology diagonals. This falloff is similar to topology, but it also considers the diagonals of the base mesh faces when checking a vertex neighbor. For this reason, this is not implement using the general flood-fill and sculpt neighbors accessors.
Definition at line 1022 of file sculpt_expand.cc.
References Object::data, depsgraph, diagonals_falloff_create(), blender::ed::sculpt_paint::find_symm_verts(), SCULPT_vertex_count_get(), blender::Span< T >::slice(), and blender::bke::pbvh::Tree::type().
Referenced by calc_falloff_from_vert_and_symmetry(), and diagonals_falloff_create().
|
static |
Returns a bitmap indexed by vertex index which contains if the vertex was enabled or not for a give expand_cache state.
Definition at line 345 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::all_enabled, Geometry::attributes, blender::bits::BitsPerInt, BKE_subdiv_ccg_foreach_visible_grid_vert(), BKE_subdiv_ccg_key_top_level(), bm, SculptSession::bm, BM_elem_flag_test, BM_ELEM_HIDDEN, BM_vert_at_index(), blender::bke::pbvh::BMesh, BMVert::co, depsgraph, blender::bke::Face, blender::bits::BitVector< InlineBufferCapacity, Allocator >::fill(), CCGKey::grid_area, blender::bke::pbvh::Grids, blender::bits::invert(), blender::ed::sculpt_paint::expand::Cache::invert, blender::Span< T >::is_empty(), is_vert_in_active_component(), blender::bke::pbvh::Mesh, blender::threading::parallel_for_aligned(), blender::bke::object::pbvh_get(), blender::bke::Point, range, SCULPT_vertex_count_get(), blender::ed::sculpt_paint::expand::Cache::snap, blender::ed::sculpt_paint::expand::Cache::snap_enabled_face_sets, SculptSession::subdiv_ccg, blender::ed::sculpt_paint::face_set::vert_face_set_get(), vert_falloff_is_enabled(), and blender::bke::pbvh::vert_positions_eval().
Referenced by colors_update_task(), reposition_pivot(), resursion_step_add(), snap_init_from_enabled(), and update_for_vert().
|
static |
Ensures that the SculptSession contains the required data needed for Expand.
Definition at line 2253 of file sculpt_expand.cc.
References BKE_image_pool_new(), ensure_sculptsession_data(), Object::sculpt, SCULPT_vertex_random_access_ensure(), and SculptSession::tex_pool.
Referenced by ensure_sculptsession_data(), sculpt_expand_invoke(), and sculpt_expand_modal().
|
static |
Definition at line 1492 of file sculpt_expand.cc.
References SculptSession::expand_cache, and expand_cache_free().
Referenced by expand_cache_free(), finish(), sculpt_expand_cancel(), and sculpt_expand_invoke().
|
static |
Restore the state of the Face Sets before a new update.
Definition at line 1890 of file sculpt_expand.cc.
References face_sets_restore(), blender::bke::SpanAttributeWriter< T >::finish(), blender::ed::sculpt_paint::expand::Cache::initial_face_sets, is_face_in_active_component(), blender::ed::sculpt_paint::expand::Cache::original_face_sets, and blender::bke::SpanAttributeWriter< T >::span.
Referenced by face_sets_restore(), and update_for_vert().
|
static |
Update Face Set data. Not multi-threaded per node as nodes don't contain face arrays.
Definition at line 1758 of file sculpt_expand.cc.
References face_sets_update(), face_state_get(), blender::bke::SpanAttributeWriter< T >::finish(), blender::ed::sculpt_paint::expand::Cache::next_face_set, blender::ed::sculpt_paint::expand::Cache::node_mask, blender::ed::sculpt_paint::expand::Cache::preserve, blender::bke::SpanAttributeWriter< T >::span, and blender::bke::pbvh::Tree::tag_face_sets_changed().
Referenced by face_sets_update(), and update_for_vert().
|
static |
Main function to get the state of a face for the current state and settings of a #Cache. Returns true when the target data should be modified by expand.
Definition at line 248 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::active_falloff, ActiveFaceSet, blender::ed::sculpt_paint::expand::Cache::all_enabled, enabled, blender::ed::sculpt_paint::expand::Cache::face_falloff, blender::ed::sculpt_paint::expand::Cache::falloff_type, fmod(), blender::ed::sculpt_paint::expand::Cache::initial_active_face_set, blender::ed::sculpt_paint::expand::Cache::invert, blender::Span< T >::is_empty(), is_face_in_active_component(), blender::ed::sculpt_paint::expand::Cache::loop_count, blender::ed::sculpt_paint::expand::Cache::max_face_falloff, blender::ed::sculpt_paint::expand::Cache::original_face_sets, SCULPT_EXPAND_LOOP_THRESHOLD, and blender::ed::sculpt_paint::expand::Cache::snap_enabled_face_sets.
Referenced by face_sets_update().
|
static |
Returns the falloff value of a vertex. This function includes texture distortion, which is not precomputed into the initial falloff values.
Definition at line 186 of file sculpt_expand.cc.
References BKE_brush_mask_texture_get(), BKE_brush_sample_tex_3d(), blender::ed::sculpt_paint::expand::Cache::brush, blender::ed::sculpt_paint::expand::Cache::max_vert_falloff, OB_MODE_SCULPT, blender::ed::sculpt_paint::expand::Cache::scene, MTex::tex, SculptSession::tex_pool, blender::ed::sculpt_paint::expand::Cache::texture_distortion_strength, and blender::ed::sculpt_paint::expand::Cache::vert_falloff.
Referenced by gradient_value_get(), and vert_falloff_is_enabled().
|
static |
Finds and stores in the #Cache the sculpt connected component index for each symmetry pass needed for expand.
Definition at line 2150 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::active_connected_islands, depsgraph, EXPAND_ACTIVE_COMPONENT_NONE, EXPAND_SYMM_AREAS, find_active_connected_components_from_vert(), blender::ed::sculpt_paint::find_symm_verts(), Object::sculpt, SCULPT_is_symmetry_iteration_valid(), and SCULPT_mesh_symmetry_xyz_get().
Referenced by find_active_connected_components_from_vert(), and set_initial_components_for_mouse().
|
static |
Definition at line 2124 of file sculpt_expand.cc.
References CTX_data_active_object(), ED_workspace_status_text(), SculptSession::expand_cache, expand_cache_free(), finish(), blender::ed::sculpt_paint::flush_update_done(), Object::sculpt, and blender::ed::sculpt_paint::expand::Cache::target.
Referenced by finish(), and sculpt_expand_modal().
|
static |
Geodesic: Initializes the falloff with geodesic distances from the given active vertex, taking symmetry into account.
Definition at line 685 of file sculpt_expand.cc.
References blender::bke::mesh::build_edge_to_face_map(), blender::bke::mesh::build_vert_to_edge_map(), Object::data, depsgraph, blender::ed::sculpt_paint::geodesic::distances_create(), SculptSession::edge_to_face_map, blender::bke::Face, FLT_MAX, blender::index_mask::IndexMask::foreach_index(), Object::sculpt, blender::Span< T >::size(), blender::bke::pbvh::vert_positions_eval(), and verts.
Referenced by calc_falloff_from_vert_and_symmetry(), geodesic_falloff_create(), and geodesics_from_state_boundary().
|
static |
Definition at line 721 of file sculpt_expand.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), depsgraph, blender::ed::sculpt_paint::find_symm_verts(), blender::index_mask::IndexMask::from_indices(), and geodesic_falloff_create().
|
static |
Geodesic recursion: Initializes falloff values using geodesic distances from the boundary of the current vertices state.
Definition at line 1198 of file sculpt_expand.cc.
References BLI_assert, boundary_from_enabled(), depsgraph, blender::ed::sculpt_paint::expand::Cache::face_falloff, geodesic_falloff_create(), geodesics_from_state_boundary(), and blender::ed::sculpt_paint::expand::Cache::vert_falloff.
Referenced by geodesics_from_state_boundary(), init_from_face_set_boundary(), and resursion_step_add().
|
static |
For target modes that support gradients (such as sculpt masks or colors), this function returns the corresponding gradient value for an enabled vertex.
Definition at line 303 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::active_falloff, BKE_brush_curve_strength(), BLI_assert, blender::ed::sculpt_paint::expand::Cache::brush, blender::ed::sculpt_paint::expand::Cache::brush_gradient, blender::ed::sculpt_paint::expand::Cache::falloff_gradient, falloff_value_vertex_get(), fmod(), blender::ed::sculpt_paint::expand::Cache::invert, blender::ed::sculpt_paint::expand::Cache::loop_count, max_vert_falloff_get(), and SCULPT_EXPAND_LOOP_THRESHOLD.
Referenced by calc_new_mask_mesh(), colors_update_task(), update_mask_bmesh(), and update_mask_grids().
|
static |
When internal falloff is set to true, the falloff will fill the active Face Set with a gradient, otherwise the active Face Set will be filled with a constant falloff of 0.0f.
Definition at line 1275 of file sculpt_expand.cc.
References Geometry::attributes, BKE_subdiv_ccg_key_top_level(), bm, SculptSession::bm, BM_FACE, BM_mesh_elem_table_ensure(), BM_vert_at_index(), CD_PROP_INT32, CustomData_get_offset_named(), Object::data, depsgraph, fabsf, FLT_MAX, SubdivCCGCoord::from_index(), geodesics_from_state_boundary(), SubdivCCGCoord::grid_index, init_from_face_set_boundary(), min_ff(), BMesh::pdata, range, Object::sculpt, SCULPT_vertex_count_get(), SculptSession::subdiv_ccg, topology_from_state_boundary(), blender::bke::pbvh::Tree::type(), and blender::ed::sculpt_paint::expand::Cache::vert_falloff.
Referenced by calc_falloff_from_vert_and_symmetry(), and init_from_face_set_boundary().
|
static |
Returns true if the face is in a connected component with correctly initialized falloff values.
Definition at line 159 of file sculpt_expand.cc.
References BKE_subdiv_ccg_key_top_level(), BLI_assert_unreachable, SculptSession::bm, BM_elem_index_get, blender::bke::pbvh::BMesh, BMesh::ftable, CCGKey::grid_area, blender::bke::pbvh::Grids, is_vert_in_active_component(), BMFace::l_first, blender::bke::pbvh::Mesh, blender::bke::object::pbvh_get(), SculptSession::subdiv_ccg, and BMLoop::v.
Referenced by delete_face_set_id(), face_sets_restore(), and face_state_get().
|
static |
Returns true if the vertex is in a connected component with correctly initialized falloff values.
Definition at line 144 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::active_connected_islands, EXPAND_SYMM_AREAS, and blender::ed::sculpt_paint::islands::vert_id_get().
Referenced by calc_new_mask_mesh(), enabled_state_to_bitmap(), is_face_in_active_component(), reposition_pivot(), update_mask_bmesh(), update_mask_grids(), and update_max_vert_falloff_value().
|
static |
Returns the maximum valid falloff value stored in the falloff array, taking the maximum possible texture distortion into account.
Definition at line 213 of file sculpt_expand.cc.
References BKE_brush_mask_texture_get(), blender::ed::sculpt_paint::expand::Cache::brush, blender::ed::sculpt_paint::expand::Cache::max_vert_falloff, OB_MODE_SCULPT, MTex::tex, and blender::ed::sculpt_paint::expand::Cache::texture_distortion_strength.
Referenced by gradient_value_get(), and vert_falloff_is_enabled().
| void blender::ed::sculpt_paint::expand::modal_keymap | ( | wmKeyConfig * | keyconf | ) |
Definition at line 2802 of file sculpt_expand.cc.
References wmKeyMap::modal_items, modal_keymap(), SCULPT_EXPAND_MODAL_BRUSH_GRADIENT_TOGGLE, SCULPT_EXPAND_MODAL_CANCEL, SCULPT_EXPAND_MODAL_CONFIRM, SCULPT_EXPAND_MODAL_FALLOFF_GEODESIC, SCULPT_EXPAND_MODAL_FALLOFF_SPHERICAL, SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY, SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY_DIAGONALS, SCULPT_EXPAND_MODAL_GRADIENT_TOGGLE, SCULPT_EXPAND_MODAL_INVERT, SCULPT_EXPAND_MODAL_LOOP_COUNT_DECREASE, SCULPT_EXPAND_MODAL_LOOP_COUNT_INCREASE, SCULPT_EXPAND_MODAL_MOVE_TOGGLE, SCULPT_EXPAND_MODAL_PRESERVE_TOGGLE, SCULPT_EXPAND_MODAL_RECURSION_STEP_GEODESIC, SCULPT_EXPAND_MODAL_RECURSION_STEP_TOPOLOGY, SCULPT_EXPAND_MODAL_SNAP_TOGGLE, SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_DECREASE, SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_INCREASE, WM_modalkeymap_assign(), WM_modalkeymap_ensure(), and WM_modalkeymap_find().
Referenced by modal_keymap().
|
static |
Displaces the initial mouse coordinates using the new mouse position to get a new active vertex. After that, initializes a new falloff of the same type with the new active vertex.
Definition at line 2229 of file sculpt_expand.cc.
References add_v2_v2v2(), calc_falloff_from_vert_and_symmetry(), CTX_data_depsgraph_pointer(), depsgraph, float, blender::ed::sculpt_paint::expand::Cache::initial_active_vert, blender::ed::sculpt_paint::expand::Cache::initial_mouse_move, blender::ed::sculpt_paint::expand::Cache::move_preview_falloff_type, move_propagation_origin(), wmEvent::mval, blender::ed::sculpt_paint::expand::Cache::original_mouse_move, set_initial_components_for_mouse(), and sub_v2_v2v2().
Referenced by move_propagation_origin(), and sculpt_expand_modal().
|
static |
Normals: Flood-fills the mesh and reduces the falloff depending on the normal difference between each vertex and the previous one. This creates falloff patterns that follow and snap to the hard edges of the object.
Definition at line 817 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::flood_fill::FillDataBMesh::add_initial(), blender::ed::sculpt_paint::flood_fill::FillDataGrids::add_initial(), blender::ed::sculpt_paint::flood_fill::FillDataMesh::add_initial(), BKE_subdiv_ccg_key_top_level(), blender::ed::sculpt_paint::smooth::blur_geometry_data_array(), SculptSession::bm, BM_elem_index_get, BM_vert_at_index(), blender::bke::pbvh::BMesh, Object::data, depsgraph, blender::math::dot(), blender::ed::sculpt_paint::flood_fill::FillDataBMesh::execute(), blender::ed::sculpt_paint::flood_fill::FillDataGrids::execute(), blender::ed::sculpt_paint::flood_fill::FillDataMesh::execute(), blender::ed::sculpt_paint::find_symm_verts(), blender::bke::pbvh::Grids, blender::bke::pbvh::Mesh, BMVert::no, SubdivCCG::normals, blender::bke::object::pbvh_get(), powf, Object::sculpt, SCULPT_vertex_count_get(), SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), and blender::bke::pbvh::vert_normals_eval().
Referenced by calc_falloff_from_vert_and_symmetry().
|
static |
Definition at line 1856 of file sculpt_expand.cc.
References Object::data, blender::bke::GAttributeReader::domain, blender::ed::sculpt_paint::expand::Cache::initial_face_sets, blender::ed::sculpt_paint::expand::Cache::original_colors, blender::ed::sculpt_paint::expand::Cache::original_face_sets, blender::ed::sculpt_paint::expand::Cache::original_mask, original_state_store(), SCULPT_vertex_count_get(), and blender::ed::sculpt_paint::expand::Cache::target.
Referenced by original_state_store(), and sculpt_expand_invoke().
|
static |
Moves the sculpt pivot to the average point of the boundary enabled vertices of the current expand state. Take symmetry and active components into account.
Definition at line 2040 of file sculpt_expand.cc.
References average(), bm, SculptSession::bm, BM_vert_at_index(), boundary_from_enabled(), BMVert::co, CTX_data_depsgraph_pointer(), Object::data, depsgraph, enabled_state_to_bitmap(), blender::ed::sculpt_paint::expand::Cache::falloff_type, blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::expand::Cache::initial_active_vert, blender::ed::sculpt_paint::expand::Cache::invert, is_vert_in_active_component(), NC_GEOM, ND_SELECT, SculptSession::pivot_pos, SubdivCCG::positions, reposition_pivot(), Object::sculpt, SCULPT_check_vertex_pivot_symmetry(), SCULPT_mesh_symmetry_xyz_get(), SculptSession::subdiv_ccg, and WM_event_add_notifier().
Referenced by reposition_pivot(), and sculpt_expand_modal().
|
static |
Definition at line 1516 of file sculpt_expand.cc.
References Object::data, blender::bke::GSpanAttributeWriter::domain, blender::bke::GSpanAttributeWriter::finish(), blender::index_mask::IndexMask::foreach_index(), blender::bke::pbvh::Tree::nodes(), blender::ed::sculpt_paint::expand::Cache::original_colors, restore_color_data(), blender::bke::GSpanAttributeWriter::span, and blender::bke::pbvh::Tree::tag_attribute_changed().
Referenced by restore_color_data(), and restore_original_state().
|
static |
Functions to restore the original state from the #Cache when canceling the operator.
Definition at line 1503 of file sculpt_expand.cc.
References blender::bke::SpanAttributeWriter< T >::finish(), blender::ed::sculpt_paint::expand::Cache::original_face_sets, restore_face_set_data(), blender::bke::SpanAttributeWriter< T >::span, and blender::bke::pbvh::Tree::tag_face_sets_changed().
Referenced by restore_face_set_data(), and restore_original_state().
|
static |
Definition at line 1582 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::flush_update_done(), blender::ed::sculpt_paint::flush_update_step(), blender::ed::sculpt_paint::expand::Cache::original_mask, restore_color_data(), restore_face_set_data(), restore_original_state(), SCULPT_tag_update_overlays(), blender::ed::sculpt_paint::expand::Cache::target, and write_mask_data().
Referenced by restore_original_state(), and sculpt_expand_cancel().
|
static |
Main function to create a recursion step from the current #Cache state.
Definition at line 1235 of file sculpt_expand.cc.
References Object::data, depsgraph, enabled_state_to_bitmap(), geodesics_from_state_boundary(), resursion_step_add(), blender::ed::sculpt_paint::expand::Cache::target, blender::ed::sculpt_paint::expand::Cache::texture_distortion_strength, topology_from_state_boundary(), blender::bke::pbvh::Tree::type(), update_max_face_falloff_factor(), update_max_vert_falloff_value(), and vert_to_face_falloff().
Referenced by resursion_step_add(), and sculpt_expand_modal().
|
static |
Cancel operator callback.
Definition at line 1608 of file sculpt_expand.cc.
References CTX_data_active_object(), SculptSession::expand_cache, expand_cache_free(), restore_original_state(), Object::sculpt, and sculpt_expand_cancel().
Referenced by sculpt_expand_cancel(), sculpt_expand_modal(), and SCULPT_OT_expand().
|
static |
Definition at line 2655 of file sculpt_expand.cc.
References any_nonzero_mask(), Geometry::attributes, BKE_base_is_visible(), BKE_sculpt_color_layer_create_if_needed(), BKE_sculpt_mask_layers_ensure(), BKE_sculpt_multires_active(), BKE_sculpt_update_object_for_edit(), BKE_subdiv_ccg_key_top_level(), bm, SculptSession::bm, BM_mesh_elem_table_ensure(), BM_VERT, BM_vert_at_index(), SculptVertexInfo::boundary, cache_initial_config_set(), calc_falloff_from_vert_and_symmetry(), check_topology_islands(), CTX_data_active_base(), CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_view3d(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), Object::data, delete_face_set_id(), depsgraph, ensure_sculptsession_data(), SculptSession::expand_cache, expand_cache_free(), float, SubdivCCGCoord::from_index(), blender::ed::sculpt_paint::expand::Cache::initial_active_vert, blender::ed::sculpt_paint::expand::Cache::initial_face_sets, blender::ed::sculpt_paint::expand::Cache::modify_active_face_set, wmEvent::mval, blender::ed::sculpt_paint::expand::Cache::next_face_set, blender::ed::sculpt_paint::expand::Cache::node_mask, blender::ed::sculpt_paint::expand::Cache::node_mask_memory, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, original_state_store(), wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), Object::sculpt, sculpt_expand_invoke(), SCULPT_vertex_count_get(), set_initial_components_for_mouse(), SculptSession::subdiv_ccg, blender::ed::sculpt_paint::expand::Cache::target, blender::bke::pbvh::Tree::type(), undo_push(), update_for_vert(), SculptSession::vertex_info, WM_event_add_modal_handler(), and write_mask_data().
Referenced by sculpt_expand_invoke(), and SCULPT_OT_expand().
|
static |
Definition at line 2292 of file sculpt_expand.cc.
References active_face_set_id_get(), BKE_brush_mask_texture_get(), BKE_report(), BKE_sculpt_update_object_for_edit(), blender::ed::sculpt_paint::expand::Cache::brush, blender::ed::sculpt_paint::expand::Cache::brush_gradient, MTex::brush_map_mode, calc_falloff_from_vert_and_symmetry(), blender::ed::sculpt_paint::expand::Cache::check_islands, check_topology_islands(), copy_v2_v2(), CTX_data_active_object(), CTX_data_depsgraph_pointer(), depsgraph, ELEM, ensure_sculptsession_data(), EVT_MODAL_MAP, SculptSession::expand_cache, blender::ed::sculpt_paint::expand::Cache::falloff_gradient, blender::ed::sculpt_paint::expand::Cache::falloff_type, finish(), float, blender::ed::sculpt_paint::expand::Cache::initial_active_vert, blender::ed::sculpt_paint::expand::Cache::initial_mouse, blender::ed::sculpt_paint::expand::Cache::initial_mouse_move, blender::ed::sculpt_paint::expand::Cache::invert, blender::ed::sculpt_paint::expand::Cache::loop_count, max_ff(), blender::ed::sculpt_paint::expand::Cache::max_geodesic_move_preview, max_ii(), MOUSEMOVE, blender::ed::sculpt_paint::expand::Cache::move, blender::ed::sculpt_paint::expand::Cache::move_original_falloff_type, blender::ed::sculpt_paint::expand::Cache::move_preview_falloff_type, move_propagation_origin(), MTEX_MAP_MODE_3D, wmEvent::mval, OB_MODE_SCULPT, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, blender::ed::sculpt_paint::expand::Cache::original_mouse_move, blender::ed::sculpt_paint::expand::Cache::preserve, wmOperator::reports, blender::ed::sculpt_paint::expand::Cache::reposition_pivot, reposition_pivot(), resursion_step_add(), RPT_WARNING, Object::sculpt, sculpt_expand_cancel(), sculpt_expand_modal(), SCULPT_EXPAND_MODAL_BRUSH_GRADIENT_TOGGLE, SCULPT_EXPAND_MODAL_CANCEL, SCULPT_EXPAND_MODAL_CONFIRM, SCULPT_EXPAND_MODAL_FALLOFF_GEODESIC, SCULPT_EXPAND_MODAL_FALLOFF_SPHERICAL, SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY, SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY_DIAGONALS, SCULPT_EXPAND_MODAL_GRADIENT_TOGGLE, SCULPT_EXPAND_MODAL_INVERT, SCULPT_EXPAND_MODAL_LOOP_COUNT_DECREASE, SCULPT_EXPAND_MODAL_LOOP_COUNT_INCREASE, SCULPT_EXPAND_MODAL_MOVE_TOGGLE, SCULPT_EXPAND_MODAL_PRESERVE_TOGGLE, SCULPT_EXPAND_MODAL_RECURSION_STEP_GEODESIC, SCULPT_EXPAND_MODAL_RECURSION_STEP_TOPOLOGY, SCULPT_EXPAND_MODAL_SNAP_TOGGLE, SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_DECREASE, SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_INCREASE, SCULPT_EXPAND_TEXTURE_DISTORTION_STEP, SCULPT_vertex_count_get(), blender::ed::sculpt_paint::expand::Cache::snap, blender::ed::sculpt_paint::expand::Cache::snap_enabled_face_sets, snap_init_from_enabled(), target_vert_update_and_get(), MTex::tex, blender::ed::sculpt_paint::expand::Cache::texture_distortion_strength, wmEvent::type, update_for_vert(), and wmEvent::val.
Referenced by sculpt_expand_modal(), and SCULPT_OT_expand().
| void blender::ed::sculpt_paint::expand::SCULPT_OT_expand | ( | wmOperatorType * | ot | ) |
Definition at line 2870 of file sculpt_expand.cc.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, int, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_DEPENDS_ON_CURSOR, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_boolean(), RNA_def_enum(), RNA_def_int(), sculpt_expand_cancel(), sculpt_expand_invoke(), sculpt_expand_modal(), SCULPT_mode_poll(), SCULPT_OT_expand(), and wmOperatorType::srna.
Referenced by blender::ed::sculpt_paint::operatortypes_sculpt(), and SCULPT_OT_expand().
|
static |
Stores the active vertex, Face Set and mouse coordinates in the #Cache based on the current cursor position.
Definition at line 2179 of file sculpt_expand.cc.
References copy_v2_v2(), CTX_data_depsgraph_pointer(), depsgraph, SculptSession::expand_cache, find_active_connected_components_from_vert(), blender::ed::sculpt_paint::expand::Cache::initial_active_face_set, blender::ed::sculpt_paint::expand::Cache::initial_active_vert, blender::ed::sculpt_paint::expand::Cache::initial_mouse, SculptSession::last_active_vert_index(), blender::ed::sculpt_paint::expand::Cache::modify_active_face_set, blender::ed::sculpt_paint::expand::Cache::next_face_set, Object::sculpt, SCULPT_FACE_SET_NONE, set_initial_components_for_mouse(), and target_vert_update_and_get().
Referenced by move_propagation_origin(), sculpt_expand_invoke(), and set_initial_components_for_mouse().
|
static |
Adds to the snapping Face Set gset all Face Sets which contain all enabled vertices for the current #Cache state. This improves the usability of snapping, as already enabled elements won't switch their state when toggling snapping with the modal key-map.
Definition at line 1452 of file sculpt_expand.cc.
References blender::Span< T >::begin(), depsgraph, enabled_state_to_bitmap(), blender::Span< T >::end(), blender::ed::sculpt_paint::expand::Cache::invert, blender::ed::sculpt_paint::expand::Cache::original_face_sets, blender::Span< T >::slice(), blender::ed::sculpt_paint::expand::Cache::snap, blender::ed::sculpt_paint::expand::Cache::snap_enabled_face_sets, snap_init_from_enabled(), and blender::bke::pbvh::Tree::type().
Referenced by sculpt_expand_modal(), and snap_init_from_enabled().
|
static |
Spherical: Initializes the falloff based on the distance from a vertex, taking symmetry into account.
Definition at line 914 of file sculpt_expand.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), depsgraph, blender::ed::sculpt_paint::find_symm_verts(), blender::array_utils::gather(), blender::bke::pbvh::Grids, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::bke::pbvh::Mesh, blender::threading::parallel_for(), blender::bke::object::pbvh_get(), SubdivCCG::positions, SCULPT_vertex_count_get(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::type(), and blender::bke::pbvh::vert_positions_eval().
Referenced by calc_falloff_from_vert_and_symmetry().
|
static |
Updates the SculptSession cursor data and gets the active vertex if the cursor is over the mesh.
Definition at line 2026 of file sculpt_expand.cc.
References SculptSession::active_vert_index(), Object::sculpt, SCULPT_cursor_geometry_info_update(), and target_vert_update_and_get().
Referenced by sculpt_expand_modal(), set_initial_components_for_mouse(), and target_vert_update_and_get().
|
static |
Definition at line 798 of file sculpt_expand.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::as_span(), calc_topology_falloff_from_verts(), depsgraph, blender::ed::sculpt_paint::find_symm_verts(), blender::index_mask::IndexMask::from_indices(), and SCULPT_vertex_count_get().
Referenced by calc_falloff_from_vert_and_symmetry().
|
static |
Topology recursion: Initializes falloff values using topology steps from the boundary of the current vertices state, increasing the value by 1 each time a new vertex is visited.
Definition at line 1217 of file sculpt_expand.cc.
References boundary_from_enabled(), calc_topology_falloff_from_verts(), blender::ed::sculpt_paint::expand::Cache::face_falloff, blender::Array< T, InlineBufferCapacity, Allocator >::fill(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), SCULPT_vertex_count_get(), topology_from_state_boundary(), and blender::ed::sculpt_paint::expand::Cache::vert_falloff.
Referenced by init_from_face_set_boundary(), resursion_step_add(), and topology_from_state_boundary().
|
static |
Does the undo sculpt push for the affected target data of the #Cache.
Definition at line 2594 of file sculpt_expand.cc.
References depsgraph, blender::ed::sculpt_paint::expand::Cache::target, and undo_push().
Referenced by sculpt_expand_invoke(), and undo_push().
|
static |
Definition at line 1909 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::active_falloff, blender::ed::sculpt_paint::expand::Cache::all_enabled, SculptSession::bm, calc_new_mask_mesh(), CD_PROP_FLOAT, colors_update_task(), CTX_data_depsgraph_pointer(), CustomData_get_offset_named(), Object::data, depsgraph, enabled_state_to_bitmap(), SculptSession::expand_cache, face_sets_restore(), face_sets_update(), blender::ed::sculpt_paint::flush_update_step(), blender::index_mask::IndexMask::foreach_index(), blender::ed::sculpt_paint::expand::Cache::max_vert_falloff, blender::index_mask::IndexMask::min_array_size(), blender::ed::sculpt_paint::expand::Cache::node_mask, blender::bke::pbvh::Tree::nodes(), Object::sculpt, SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::tag_attribute_changed(), blender::bke::pbvh::Tree::tag_masks_changed(), blender::ed::sculpt_paint::expand::Cache::target, blender::bke::pbvh::Tree::type(), update_for_vert(), BMesh::vdata, blender::ed::sculpt_paint::expand::Cache::vert_falloff, and verts.
Referenced by sculpt_expand_invoke(), sculpt_expand_modal(), and update_for_vert().
|
static |
Definition at line 1708 of file sculpt_expand.cc.
References BKE_pbvh_bmesh_node_unique_verts(), BM_ELEM_CD_GET_FLOAT, BM_ELEM_CD_SET_FLOAT, BM_elem_index_get, blender::ed::sculpt_paint::expand::Cache::check_islands, clamp_f(), SculptSession::expand_cache, gradient_value_get(), blender::ed::sculpt_paint::expand::Cache::invert, is_vert_in_active_component(), max_ff(), min_ff(), blender::ed::sculpt_paint::expand::Cache::original_mask, and blender::ed::sculpt_paint::expand::Cache::preserve.
|
static |
Definition at line 1657 of file sculpt_expand.cc.
References BKE_subdiv_ccg_key_top_level(), blender::ed::sculpt_paint::expand::Cache::check_islands, clamp_f(), SculptSession::expand_cache, gradient_value_get(), blender::ed::sculpt_paint::expand::Cache::invert, is_vert_in_active_component(), SubdivCCG::masks, max_ff(), min_ff(), blender::ed::sculpt_paint::expand::Cache::original_mask, SubdivCCG::positions, and blender::ed::sculpt_paint::expand::Cache::preserve.
|
static |
Updates the max_falloff value for faces in a Cache based on the current values of the falloff, skipping any invalid values initialized to FLT_MAX and not initialized components.
Definition at line 1105 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::max_face_falloff, and update_max_face_falloff_factor().
Referenced by calc_falloff_from_vert_and_symmetry(), resursion_step_add(), and update_max_face_falloff_factor().
|
static |
Updates the max_falloff value for vertices in a #Cache based on the current values of the falloff, skipping any invalid values initialized to FLT_MAX and not initialized components.
Definition at line 1079 of file sculpt_expand.cc.
References b, FLT_MAX, is_vert_in_active_component(), max, blender::ed::sculpt_paint::expand::Cache::max_vert_falloff, range, SCULPT_vertex_count_get(), update_max_vert_falloff_value(), and blender::ed::sculpt_paint::expand::Cache::vert_falloff.
Referenced by calc_falloff_from_vert_and_symmetry(), resursion_step_add(), and update_max_vert_falloff_value().
|
static |
Definition at line 228 of file sculpt_expand.cc.
References blender::ed::sculpt_paint::expand::Cache::active_falloff, falloff_value_vertex_get(), fmod(), blender::ed::sculpt_paint::expand::Cache::loop_count, max_vert_falloff_get(), and SCULPT_EXPAND_LOOP_THRESHOLD.
Referenced by enabled_state_to_bitmap().
|
static |
Main function to update the faces falloff from a already calculated vertex falloff.
Definition at line 1173 of file sculpt_expand.cc.
References BLI_assert, blender::ed::sculpt_paint::expand::Cache::face_falloff, blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), blender::Array< T, InlineBufferCapacity, Allocator >::reinitialize(), blender::bke::pbvh::Tree::type(), blender::ed::sculpt_paint::expand::Cache::vert_falloff, vert_to_face_falloff(), vert_to_face_falloff_grids(), and vert_to_face_falloff_mesh().
Referenced by calc_falloff_from_vert_and_symmetry(), resursion_step_add(), and vert_to_face_falloff().
|
static |
Functions to get falloff values for faces from the values from the vertices. This is used for expanding Face Sets. Depending on the data type of the SculptSession, this needs to get the per face falloff value from the connected vertices of each face or from the grids stored per loops for each face.
Definition at line 1134 of file sculpt_expand.cc.
References BKE_subdiv_ccg_key_top_level(), SculptSession::subdiv_ccg, and vert_to_face_falloff_grids().
Referenced by vert_to_face_falloff(), and vert_to_face_falloff_grids().
|
static |
Definition at line 1153 of file sculpt_expand.cc.
References vert_to_face_falloff_mesh().
Referenced by vert_to_face_falloff(), and vert_to_face_falloff_mesh().
|
static |
Definition at line 1543 of file sculpt_expand.cc.
References blender::Array< T, InlineBufferCapacity, Allocator >::as_mutable_span(), bm, SculptSession::bm, BM_ELEM_CD_SET_FLOAT, BM_mesh_elem_table_ensure(), BM_VERT, BM_vert_at_index(), CD_PROP_FLOAT, blender::MutableSpan< T >::copy_from(), CustomData_get_offset_named(), SubdivCCG::masks, blender::bke::MutableAttributeAccessor::remove(), SculptSession::subdiv_ccg, blender::bke::pbvh::Tree::tag_masks_changed(), blender::bke::pbvh::Tree::type(), BMesh::vdata, and write_mask_data().
Referenced by restore_original_state(), sculpt_expand_invoke(), and write_mask_data().