Blender V4.3
blender::ed::sculpt_paint::expand Namespace Reference

Classes

struct  Cache
 

Enumerations

enum  {
  SCULPT_EXPAND_MODAL_CONFIRM = 1 , SCULPT_EXPAND_MODAL_CANCEL , SCULPT_EXPAND_MODAL_INVERT , SCULPT_EXPAND_MODAL_PRESERVE_TOGGLE ,
  SCULPT_EXPAND_MODAL_GRADIENT_TOGGLE , SCULPT_EXPAND_MODAL_FALLOFF_CYCLE , SCULPT_EXPAND_MODAL_RECURSION_STEP_GEODESIC , SCULPT_EXPAND_MODAL_RECURSION_STEP_TOPOLOGY ,
  SCULPT_EXPAND_MODAL_MOVE_TOGGLE , SCULPT_EXPAND_MODAL_FALLOFF_GEODESIC , SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY , SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY_DIAGONALS ,
  SCULPT_EXPAND_MODAL_FALLOFF_SPHERICAL , SCULPT_EXPAND_MODAL_SNAP_TOGGLE , SCULPT_EXPAND_MODAL_LOOP_COUNT_INCREASE , SCULPT_EXPAND_MODAL_LOOP_COUNT_DECREASE ,
  SCULPT_EXPAND_MODAL_BRUSH_GRADIENT_TOGGLE , SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_INCREASE , SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_DECREASE
}
 
enum class  FalloffType {
  Geodesic , Topology , TopologyNormals , Normals ,
  Sphere , BoundaryTopology , BoundaryFaceSet , ActiveFaceSet
}
 
enum class  TargetType { Mask , FaceSets , Colors }
 
enum class  RecursionType { Topology , Geodesic }
 

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< floatgeodesic_falloff_create (const Depsgraph &depsgraph, Object &ob, const IndexMask &initial_verts)
 
static Array< floatgeodesic_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< floattopology_falloff_create (const Depsgraph &depsgraph, Object &ob, const int initial_vert)
 
static Array< floatnormals_falloff_create (const Depsgraph &depsgraph, Object &ob, const int vert, const float edge_sensitivity, const int blur_steps)
 
static Array< floatspherical_falloff_create (const Depsgraph &depsgraph, const Object &object, const int vert)
 
static Array< floatboundary_topology_falloff_create (const Depsgraph &depsgraph, Object &ob, const int inititial_vert)
 
static Array< floatdiagonals_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< inttarget_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)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SCULPT_EXPAND_MODAL_CONFIRM 
SCULPT_EXPAND_MODAL_CANCEL 
SCULPT_EXPAND_MODAL_INVERT 
SCULPT_EXPAND_MODAL_PRESERVE_TOGGLE 
SCULPT_EXPAND_MODAL_GRADIENT_TOGGLE 
SCULPT_EXPAND_MODAL_FALLOFF_CYCLE 
SCULPT_EXPAND_MODAL_RECURSION_STEP_GEODESIC 
SCULPT_EXPAND_MODAL_RECURSION_STEP_TOPOLOGY 
SCULPT_EXPAND_MODAL_MOVE_TOGGLE 
SCULPT_EXPAND_MODAL_FALLOFF_GEODESIC 
SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY 
SCULPT_EXPAND_MODAL_FALLOFF_TOPOLOGY_DIAGONALS 
SCULPT_EXPAND_MODAL_FALLOFF_SPHERICAL 
SCULPT_EXPAND_MODAL_SNAP_TOGGLE 
SCULPT_EXPAND_MODAL_LOOP_COUNT_INCREASE 
SCULPT_EXPAND_MODAL_LOOP_COUNT_DECREASE 
SCULPT_EXPAND_MODAL_BRUSH_GRADIENT_TOGGLE 
SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_INCREASE 
SCULPT_EXPAND_MODAL_TEXTURE_DISTORTION_DECREASE 

Definition at line 114 of file sculpt_expand.cc.

◆ FalloffType

Enumerator
Geodesic 
Topology 
TopologyNormals 
Normals 
Sphere 
BoundaryTopology 
BoundaryFaceSet 
ActiveFaceSet 

Definition at line 25 of file sculpt_expand.hh.

◆ RecursionType

Enumerator
Topology 
Geodesic 

Definition at line 42 of file sculpt_expand.hh.

◆ TargetType

Enumerator
Mask 
FaceSets 
Colors 

Definition at line 36 of file sculpt_expand.hh.

Function Documentation

◆ active_face_set_id_get()

static int blender::ed::sculpt_paint::expand::active_face_set_id_get ( Object & object,
Cache & expand_cache )
static

◆ any_nonzero_mask()

static bool blender::ed::sculpt_paint::expand::any_nonzero_mask ( const Object & object)
static

◆ boundary_from_enabled()

◆ boundary_topology_falloff_create()

static Array< float > blender::ed::sculpt_paint::expand::boundary_topology_falloff_create ( const Depsgraph & depsgraph,
Object & ob,
const int inititial_vert )
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().

◆ cache_initial_config_set()

static void blender::ed::sculpt_paint::expand::cache_initial_config_set ( bContext * C,
wmOperator * op,
Cache & expand_cache )
static

◆ calc_falloff_from_vert_and_symmetry()

◆ calc_new_mask_mesh()

◆ calc_topology_falloff_from_verts()

◆ check_topology_islands()

static void blender::ed::sculpt_paint::expand::check_topology_islands ( Object & ob,
FalloffType falloff_type )
static

◆ colors_update_task()

static bool blender::ed::sculpt_paint::expand::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

◆ delete_face_set_id()

static void blender::ed::sculpt_paint::expand::delete_face_set_id ( int * r_face_sets,
Object & object,
Cache & expand_cache,
Mesh * mesh,
const int delete_id )
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().

◆ diagonals_falloff_create()

static Array< float > blender::ed::sculpt_paint::expand::diagonals_falloff_create ( const Depsgraph & depsgraph,
Object & ob,
const int vert )
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().

◆ enabled_state_to_bitmap()

◆ ensure_sculptsession_data()

static void blender::ed::sculpt_paint::expand::ensure_sculptsession_data ( Object & ob)
static

◆ expand_cache_free()

static void blender::ed::sculpt_paint::expand::expand_cache_free ( SculptSession & ss)
static

◆ face_sets_restore()

static void blender::ed::sculpt_paint::expand::face_sets_restore ( Object & object,
Cache & expand_cache )
static

◆ face_sets_update()

static void blender::ed::sculpt_paint::expand::face_sets_update ( Object & object,
Cache & expand_cache )
static

◆ face_state_get()

◆ falloff_value_vertex_get()

static float blender::ed::sculpt_paint::expand::falloff_value_vertex_get ( const SculptSession & ss,
const Cache & expand_cache,
const float3 & position,
const int vert )
static

◆ find_active_connected_components_from_vert()

static void blender::ed::sculpt_paint::expand::find_active_connected_components_from_vert ( const Depsgraph & depsgraph,
Object & ob,
Cache & expand_cache,
const int initial_vertex )
static

◆ finish()

◆ geodesic_falloff_create() [1/2]

static Array< float > blender::ed::sculpt_paint::expand::geodesic_falloff_create ( const Depsgraph & depsgraph,
Object & ob,
const IndexMask & initial_verts )
static

◆ geodesic_falloff_create() [2/2]

static Array< float > blender::ed::sculpt_paint::expand::geodesic_falloff_create ( const Depsgraph & depsgraph,
Object & ob,
const int initial_vert )
static

◆ geodesics_from_state_boundary()

static void blender::ed::sculpt_paint::expand::geodesics_from_state_boundary ( const Depsgraph & depsgraph,
Object & ob,
Cache & expand_cache,
const BitSpan enabled_verts )
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().

◆ gradient_value_get()

static float blender::ed::sculpt_paint::expand::gradient_value_get ( const SculptSession & ss,
const Cache & expand_cache,
const float3 & position,
const int vert )
static

◆ init_from_face_set_boundary()

static void blender::ed::sculpt_paint::expand::init_from_face_set_boundary ( const Depsgraph & depsgraph,
Object & ob,
Cache & expand_cache,
const int active_face_set,
const bool internal_falloff )
static

◆ is_face_in_active_component()

static bool blender::ed::sculpt_paint::expand::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

◆ is_vert_in_active_component()

static bool blender::ed::sculpt_paint::expand::is_vert_in_active_component ( const SculptSession & ss,
const Cache & expand_cache,
const int vert )
static

◆ max_vert_falloff_get()

static float blender::ed::sculpt_paint::expand::max_vert_falloff_get ( const Cache & expand_cache)
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().

◆ modal_keymap()

◆ move_propagation_origin()

static void blender::ed::sculpt_paint::expand::move_propagation_origin ( bContext * C,
Object & ob,
const wmEvent * event,
Cache & expand_cache )
static

◆ normals_falloff_create()

◆ original_state_store()

◆ reposition_pivot()

◆ restore_color_data()

◆ restore_face_set_data()

static void blender::ed::sculpt_paint::expand::restore_face_set_data ( Object & object,
Cache & expand_cache )
static

◆ restore_original_state()

◆ resursion_step_add()

static void blender::ed::sculpt_paint::expand::resursion_step_add ( const Depsgraph & depsgraph,
Object & ob,
Cache & expand_cache,
const RecursionType recursion_type )
static

◆ sculpt_expand_cancel()

static void blender::ed::sculpt_paint::expand::sculpt_expand_cancel ( bContext * C,
wmOperator *  )
static

◆ sculpt_expand_invoke()

static int blender::ed::sculpt_paint::expand::sculpt_expand_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
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().

◆ sculpt_expand_modal()

static int blender::ed::sculpt_paint::expand::sculpt_expand_modal ( bContext * C,
wmOperator * op,
const wmEvent * event )
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().

◆ SCULPT_OT_expand()

◆ set_initial_components_for_mouse()

◆ snap_init_from_enabled()

static void blender::ed::sculpt_paint::expand::snap_init_from_enabled ( const Depsgraph & depsgraph,
const Object & object,
Cache & expand_cache )
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().

◆ spherical_falloff_create()

◆ target_vert_update_and_get()

static std::optional< int > blender::ed::sculpt_paint::expand::target_vert_update_and_get ( bContext * C,
Object & ob,
const float mval[2] )
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().

◆ topology_falloff_create()

static Array< float > blender::ed::sculpt_paint::expand::topology_falloff_create ( const Depsgraph & depsgraph,
Object & ob,
const int initial_vert )
static

◆ topology_from_state_boundary()

static void blender::ed::sculpt_paint::expand::topology_from_state_boundary ( Object & ob,
Cache & expand_cache,
const BitSpan enabled_verts )
static

◆ undo_push()

static void blender::ed::sculpt_paint::expand::undo_push ( const Depsgraph & depsgraph,
Object & ob,
Cache & expand_cache )
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().

◆ update_for_vert()

◆ update_mask_bmesh()

◆ update_mask_grids()

◆ update_max_face_falloff_factor()

static void blender::ed::sculpt_paint::expand::update_max_face_falloff_factor ( const Object & object,
Mesh & mesh,
Cache & expand_cache )
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().

◆ update_max_vert_falloff_value()

static void blender::ed::sculpt_paint::expand::update_max_vert_falloff_value ( const Object & object,
Cache & expand_cache )
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().

◆ vert_falloff_is_enabled()

static bool blender::ed::sculpt_paint::expand::vert_falloff_is_enabled ( const SculptSession & ss,
const Cache & expand_cache,
const float3 & position,
const int vert )
static

◆ vert_to_face_falloff()

◆ vert_to_face_falloff_grids()

static void blender::ed::sculpt_paint::expand::vert_to_face_falloff_grids ( SculptSession & ss,
Mesh * mesh,
Cache & expand_cache )
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().

◆ vert_to_face_falloff_mesh()

static void blender::ed::sculpt_paint::expand::vert_to_face_falloff_mesh ( Mesh * mesh,
Cache & expand_cache )
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().

◆ write_mask_data()