58 factors[i] *= std::max(
math::dot(test_dir, normals[i]), 0.0f);
97 position_data.deform(translations, verts);
185 switch (
pbvh.type()) {
194 depsgraph, sd,
brush, grab_delta, attribute_data,
nodes[i],
object, position_data);
201 SubdivCCG &subdiv_ccg = *
object.runtime->sculpt_session->subdiv_ccg;
225 pbvh.tag_positions_changed(node_mask);
226 pbvh.flush_bounds_to_parents();
259 mesh.vert_positions();
266 const int active_vert = std::get<int>(ss.
active_vert());
267 const float3 brush_co = positions[active_vert];
268 const float radius_sq = radius * radius;
273 std::queue<int> queue;
274 queue.push(active_vert);
275 while (!queue.empty()) {
276 const int from_vert = queue.front();
281 faces, corner_verts, vert_to_face_map, hide_poly, from_vert, neighbors))
283 preview_verts.
append(from_vert);
284 preview_verts.
append(neighbor);
285 if (visited_verts[neighbor]) {
288 visited_verts[neighbor].set();
290 queue.push(neighbor);
A BVH for high poly meshes.
Object is a sort of wrapper for general info.
#define PRF_scope(category)
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr int64_t size() const
void append(const T &value)
Span< T > as_span() const
GAttributeReader lookup(const StringRef name) const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
pbvh::Tree * pbvh_get(Object &object)
void update_node_bounds_bmesh(BMeshNode &node)
void update_node_bounds_mesh(Span< float3 > positions, MeshNode &node)
void update_node_bounds_grids(int grid_area, Span< float3 > positions, GridsNode &node)
Span< float3 > vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig)
static BLI_NOINLINE void calc_silhouette_factors(const StrokeCache &cache, const float3 &offset, const Span< float3 > normals, const MutableSpan< float > factors)
static void calc_bmesh(const Depsgraph &depsgraph, const Sculpt &sd, const Brush &brush, Object &object, bke::pbvh::BMeshNode &node, LocalData &tls, MutableSpan< float > layer_displacement_factor)
static void calc_grids(const Depsgraph &depsgraph, const Sculpt &sd, const Brush &brush, Object &object, const bool use_persistent_base, const Span< float3 > persistent_base_positions, const Span< float3 > persistent_base_normals, bke::pbvh::GridsNode &node, LocalData &tls, MutableSpan< float > layer_displacement_factor)
static void calc_faces(const Depsgraph &depsgraph, const Sculpt &sd, const Brush &brush, const MeshAttributeData &attribute_data, const Span< float3 > vert_normals, const bool use_persistent_base, const Span< float3 > persistent_base_positions, const Span< float3 > persistent_base_normals, Object &object, bke::pbvh::MeshNode &node, MutableSpan< float > layer_displacement_factor, const PositionDeformData &position_data)
void do_grab_brush(const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const IndexMask &node_mask)
void calc_factors_common_from_orig_data_grids(const Depsgraph &depsgraph, const Brush &brush, const Object &object, Span< float3 > positions, Span< float3 > normals, const bke::pbvh::GridsNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void calc_factors_common_from_orig_data_mesh(const Depsgraph &depsgraph, const Brush &brush, const Object &object, const MeshAttributeData &attribute_data, Span< float3 > positions, Span< float3 > normals, const bke::pbvh::MeshNode &node, MutableSpan< float > r_factors, MutableSpan< float > r_distances)
void orig_position_data_gather_bmesh(const BMLog &bm_log, const Set< BMVert *, 0 > &verts, MutableSpan< float3 > positions, MutableSpan< float3 > normals)
void clip_and_lock_translations(const Sculpt &sd, const SculptSession &ss, Span< float3 > positions, Span< int > verts, MutableSpan< float3 > translations)
void apply_translations(Span< float3 > translations, Span< int > verts, MutableSpan< float3 > positions)
OrigPositionData orig_position_data_get_mesh(const Object &object, const bke::pbvh::MeshNode &node)
OrigPositionData orig_position_data_get_grids(const Object &object, const bke::pbvh::GridsNode &node)
float3 grab_delta_get(const Brush &brush, const StrokeCache &cache)
void translations_from_offset_and_factors(const float3 &offset, Span< float > factors, MutableSpan< float3 > r_translations)
Span< int > vert_neighbors_get_mesh(const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_face, const Span< bool > hide_poly, const int vert, Vector< int > &r_neighbors)
void calc_factors_common_from_orig_data_bmesh(const Depsgraph &depsgraph, const Brush &brush, const Object &object, Span< float3 > positions, Span< float3 > normals, bke::pbvh::BMeshNode &node, Vector< float > &r_factors, Vector< float > &r_distances)
void geometry_preview_lines_update(Depsgraph &depsgraph, Object &object, SculptSession &ss, float radius)
constexpr ParallelGrainSize grain_size(int grain_size)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
T distance_squared(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
CCGKey BKE_subdiv_ccg_key_top_level(const SubdivCCG &subdiv_ccg)
BMesh const char void * data
const Brush * BKE_paint_brush_for_read(const Paint *paint)
void BKE_sculptsession_update_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
VecBase< float, 3 > float3
const Set< BMVert *, 0 > & BKE_pbvh_bmesh_node_unique_verts(bke::pbvh::BMeshNode *node)
ed::sculpt_paint::StrokeCache * cache
KeyBlock * shapekey_active
ActiveVert active_vert() const
Array< int > preview_verts
bool deform_modifiers_active
Array< float3 > positions
float3 initial_normal_symm
Vector< float > distances
Vector< float3 > translations
Vector< float > distances
Vector< float3 > translations