Blender V5.0
blender::bke::pbvh Namespace Reference

Namespaces

namespace  pixels
namespace  uv_islands

Classes

class  Node
struct  MeshNode
struct  GridsNode
struct  BMeshNode
class  DrawCache
class  Tree
struct  StackItem
struct  PBVHIter
struct  NodeTree
struct  PositionSourceResult
struct  RaycastData
struct  EdgeQueue
struct  EdgeQueueContext
struct  FastNodeBuildInfo

Enumerations

enum class  Type { Mesh , Grids , BMesh }
enum class  PositionSource : int8_t { Eval , EvalDeform , Orig , RuntimeDeform }
enum class  PlaneAABBIsect : int8_t { Inside , Outside , Intersect }

Functions

 ENUM_OPERATORS (Node::Flags, Node::Flags::TopologyUpdated)
void build_pixels (const Depsgraph &depsgraph, Object &object, Image &image, ImageUser &image_user)
void raycast (Tree &pbvh, FunctionRef< void(Node &node, float *tmin)> hit_fn, const float3 &ray_start, const float3 &ray_normal, bool original)
Bounds< float3calc_face_bounds (const Span< float3 > vert_positions, const Span< int > face_verts)
int partition_along_axis (const Span< float3 > face_centers, MutableSpan< int > faces, const int axis, const float middle)
int partition_material_indices (const Span< int > material_indices, MutableSpan< int > faces)
bool leaf_needs_material_split (const Span< int > faces, const Span< int > material_indices)
bool node_raycast_mesh (const MeshNode &node, Span< float3 > node_positions, Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< bool > hide_poly, const float3 &ray_start, const float3 &ray_normal, IsectRayPrecalc *isect_precalc, float *depth, int &r_active_vertex, int &r_active_face_index, float3 &r_face_normal)
bool node_raycast_grids (const SubdivCCG &subdiv_ccg, GridsNode &node, Span< float3 > node_positions, const float3 &ray_start, const float3 &ray_normal, const IsectRayPrecalc *isect_precalc, float *depth, SubdivCCGCoord &r_active_vertex, int &r_active_grid_index, float3 &r_face_normal)
bool node_raycast_bmesh (BMeshNode &node, const float3 &ray_start, const float3 &ray_normal, const IsectRayPrecalc *isect_precalc, float *depth, bool use_original, BMVert **r_active_vertex, float3 &r_face_normal)
bool raycast_node_detail_bmesh (const BMeshNode &node, const float3 &ray_start, const IsectRayPrecalc *isect_precalc, float *depth, float *r_edge_length)
void clip_ray_ortho (Tree &pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3])
void find_nearest_to_ray (Tree &pbvh, const FunctionRef< void(Node &node, float *tmin)> fn, const float3 &ray_start, const float3 &ray_normal, bool original)
bool find_nearest_to_ray_node (Tree &pbvh, Node &node, Span< float3 > node_positions, bool use_origco, Span< float3 > vert_positions, const OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, Span< bool > hide_poly, const SubdivCCG *subdiv_ccg, const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
Bounds< float3bounds_get (const Tree &pbvh)
bool node_frustum_contain_aabb (const Node &node, Span< float4 > frustum_planes)
bool node_frustum_exclude_aabb (const Node &node, Span< float4 > frustum_planes)
int count_grid_quads (const BitGroupVector<> &grid_hidden, Span< int > grid_indices, int gridsize, int display_gridsize)
bool bmesh_update_topology (BMesh &bm, Tree &pbvh, BMLog &bm_log, PBVHTopologyUpdateMode mode, float min_edge_len, float max_edge_len, const float3 &center, const std::optional< float3 > &view_normal, float radius, bool use_frontface, bool use_projected)
Span< int > node_face_indices_calc_grids (const SubdivCCG &subdiv_ccg, const GridsNode &node, Vector< int > &faces)
void store_bounds_orig (Tree &pbvh)
void update_mask_mesh (const Mesh &mesh, const IndexMask &node_mask, Tree &pbvh)
void update_mask_grids (const SubdivCCG &subdiv_ccg, const IndexMask &node_mask, Tree &pbvh)
void update_mask_bmesh (const BMesh &bm, const IndexMask &node_mask, Tree &pbvh)
void update_normals (const Depsgraph &depsgraph, Object &object_orig, Tree &pbvh)
void update_normals_from_eval (Object &object_eval, Tree &pbvh)
IndexMask nodes_to_face_selection_grids (const SubdivCCG &subdiv_ccg, Span< GridsNode > nodes, const IndexMask &nodes_mask, IndexMaskMemory &memory)
Span< float3vert_positions_eval (const Depsgraph &depsgraph, const Object &object_orig)
Span< float3vert_positions_eval_from_eval (const Object &object_eval)
MutableSpan< float3vert_positions_eval_for_write (const Depsgraph &depsgraph, Object &object_orig)
Span< float3vert_normals_eval (const Depsgraph &depsgraph, const Object &object_orig)
Span< float3vert_normals_eval_from_eval (const Object &object_eval)
Span< float3face_normals_eval_from_eval (const Object &object_eval)
IndexMask all_leaf_nodes (const Tree &pbvh, IndexMaskMemory &memory)
IndexMask search_nodes (const Tree &pbvh, IndexMaskMemory &memory, FunctionRef< bool(const Node &)> filter_fn)
void node_update_mask_mesh (Span< float > mask, MeshNode &node)
void node_update_mask_grids (const CCGKey &key, Span< float > masks, GridsNode &node)
void node_update_mask_bmesh (int mask_offset, BMeshNode &node)
void node_update_visibility_mesh (Span< bool > hide_vert, MeshNode &node)
void node_update_visibility_grids (const BitGroupVector<> &grid_hidden, GridsNode &node)
void node_update_visibility_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)
void update_node_bounds_bmesh (BMeshNode &node)
static Bounds< float3negative_bounds ()
static Bounds< float3merge_bounds (const Bounds< float3 > &a, const Bounds< float3 > &b)
static BLI_NOINLINE void build_mesh_leaf_nodes (const int verts_num, const OffsetIndices< int > faces, const Span< int > corner_verts, MutableSpan< MeshNode > nodes)
static void build_nodes_recursive_mesh (const Span< int > material_indices, const int leaf_limit, const int node_index, const int parent_index, const std::optional< Bounds< float3 > > &bounds_precalc, const Span< float3 > face_centers, const int depth, MutableSpan< int > faces, Vector< MeshNode > &nodes)
static void build_nodes_recursive_grids (const Span< int > material_indices, const int leaf_limit, const int node_index, const int parent_index, const std::optional< Bounds< float3 > > &bounds_precalc, const Span< float3 > face_centers, const int depth, MutableSpan< int > faces, Vector< GridsNode > &nodes)
static Bounds< float3calc_face_grid_bounds (const OffsetIndices< int > faces, const Span< float3 > positions, const CCGKey &key, const int face)
static bool tree_is_empty (const Tree &pbvh)
static Nodefirst_node (Tree &pbvh)
static void pbvh_iter_begin (PBVHIter *iter, Tree &pbvh, FunctionRef< bool(Node &)> scb)
static Nodepbvh_iter_next (PBVHIter *iter, Node::Flags leaf_flag)
static Nodepbvh_iter_next_occluded (PBVHIter *iter)
static void node_tree_insert (NodeTree *tree, NodeTree *new_node)
static void traverse_tree (NodeTree *tree, const FunctionRef< void(Node &node, float *tmin)> hit_fn, float *tmin)
static void free_tree (NodeTree *tree)
static void search_callback_occluded (Tree &pbvh, const FunctionRef< bool(Node &)> scb, const FunctionRef< void(Node &node, float *tmin)> hit_fn)
static bool mesh_topology_count_matches (const Mesh &a, const Mesh &b)
static PositionSourceResult cache_source_get (const Object &object_orig, const Object &object_eval)
static const SharedCache< Vector< float3 > > & vert_normals_cache_eval (const Object &object_orig, const Object &object_eval)
static SharedCache< Vector< float3 > > & vert_normals_cache_eval_for_write (Object &object_orig, Object &object_eval)
static const SharedCache< Vector< float3 > > & face_normals_cache_eval (const Object &object_orig, const Object &object_eval)
static SharedCache< Vector< float3 > > & face_normals_cache_eval_for_write (Object &object_orig, Object &object_eval)
static Span< float3vert_positions_eval (const Object &object_orig, const Object &object_eval)
static MutableSpan< float3vert_positions_eval_for_write (Object &object_orig, Object &object_eval)
static void normals_calc_faces (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > face_indices, MutableSpan< float3 > face_normals)
static void calc_boundary_face_normals (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int > face_indices, MutableSpan< float3 > face_normals)
static void calc_node_face_normals (const Span< float3 > positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< MeshNode > nodes, const IndexMask &nodes_to_update, MutableSpan< float3 > face_normals)
static void normals_calc_verts_simple (const GroupedSpan< int > vert_to_face_map, const Span< float3 > face_normals, const Span< int > verts, MutableSpan< float3 > vert_normals)
static void calc_boundary_vert_normals (const GroupedSpan< int > vert_to_face_map, const Span< float3 > face_normals, const Span< int > verts, MutableSpan< float3 > vert_normals)
static void calc_node_vert_normals (const GroupedSpan< int > vert_to_face_map, const Span< float3 > face_normals, const Span< MeshNode > nodes, const IndexMask &nodes_to_update, MutableSpan< float3 > vert_normals)
static void update_normals_mesh (Object &object_orig, Object &object_eval, const Span< MeshNode > nodes, const IndexMask &nodes_to_update)
static void update_visibility_faces (const Mesh &mesh, const MutableSpan< MeshNode > nodes, const IndexMask &node_mask)
static void update_visibility_grids (const SubdivCCG &subdiv_ccg, const MutableSpan< GridsNode > nodes, const IndexMask &node_mask)
static void update_visibility_bmesh (const MutableSpan< BMeshNode > nodes, const IndexMask &node_mask)
static bool ray_aabb_intersect (Node &node, const RaycastData &rcd)
void raycast (Tree &pbvh, const FunctionRef< void(Node &node, float *tmin)> hit_fn, const float3 &ray_start, const float3 &ray_normal, bool original)
bool ray_face_intersection_quad (const float3 &ray_start, const IsectRayPrecalc *isect_precalc, const float3 &t0, const float3 &t1, const float3 &t2, const float3 &t3, float *depth)
bool ray_face_intersection_tri (const float3 &ray_start, const IsectRayPrecalc *isect_precalc, const float3 &t0, const float3 &t1, const float3 &t2, float *depth)
static float dist_squared_ray_to_tri_v3_fast (const float3 &ray_origin, const float3 &ray_direction, const float3 &v0, const float3 &v1, const float3 &v2, float3 &r_point, float *r_depth)
bool ray_face_nearest_quad (const float3 &ray_start, const float3 &ray_normal, const float3 &t0, const float3 &t1, const float3 &t2, const float3 &t3, float *r_depth, float *dist_sq)
bool ray_face_nearest_tri (const float3 &ray_start, const float3 &ray_normal, const float3 &t0, const float3 &t1, const float3 &t2, float *r_depth, float *dist_sq)
static void calc_mesh_intersect_data (const Span< int > corner_verts, const Span< int3 > corner_tris, const float3 &ray_start, const float3 &ray_normal, const int face_index, const int tri_index, const std::array< const float *, 3 > co, const float depth, int &r_active_vertex, int &r_active_face_index, float3 &r_face_normal)
static void calc_grids_intersect_data (const float3 &ray_start, const float3 &ray_normal, const int grid, const short x, const short y, const std::array< const float *, 4 > co, const float depth, SubdivCCGCoord &r_active_vertex, int &r_active_grid_index, float3 &r_face_normal)
static bool nearest_to_ray_aabb_dist_sq (Node *node, const DistRayAABB_Precalc &dist_ray_to_aabb_precalc, const bool original)
static bool pbvh_faces_node_nearest_to_ray (const MeshNode &node, const Span< float3 > node_positions, const Span< float3 > vert_positions, const OffsetIndices< int > faces, const Span< int > corner_verts, const Span< int3 > corner_tris, const Span< bool > hide_poly, const float3 &ray_start, const float3 &ray_normal, float *r_depth, float *dist_sq)
static bool pbvh_grids_node_nearest_to_ray (const SubdivCCG &subdiv_ccg, GridsNode &node, const Span< float3 > node_positions, const float ray_start[3], const float ray_normal[3], float *r_depth, float *dist_sq)
static PlaneAABBIsect test_frustum_aabb (const Bounds< float3 > &bounds, const Span< float4 > frustum_planes)
static Vector< Node * > search_gather (Tree &pbvh, const FunctionRef< bool(Node &)> scb, Node::Flags leaf_flag)
static void pbvh_bmesh_node_finalize (BMeshNode &n, const int node_index, const int cd_vert_node_offset, const int cd_face_node_offset)
static void pbvh_bmesh_node_split (Vector< BMeshNode > &nodes, Vector< bool > &node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, const Span< Bounds< float3 > > face_bounds, const int node_index)
static bool pbvh_bmesh_node_limit_ensure (BMesh &bm, Vector< BMeshNode > &nodes, Vector< bool > &node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, const int node_index)
BLI_INLINE int pbvh_bmesh_node_index_from_vert (const int cd_vert_node_offset, const BMVert *key)
BLI_INLINE int pbvh_bmesh_node_index_from_face (const int cd_face_node_offset, const BMFace *key)
BLI_INLINE BMeshNodepbvh_bmesh_node_from_vert (MutableSpan< BMeshNode > nodes, const int cd_vert_node_offset, const BMVert *key)
BLI_INLINE BMeshNodepbvh_bmesh_node_from_face (MutableSpan< BMeshNode > nodes, const int cd_face_node_offset, const BMFace *key)
static BMVertpbvh_bmesh_vert_create (BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, BMLog &bm_log, const BMVert *v1, const BMVert *v2, const int node_index, const float3 &co, const float3 &no, const int cd_vert_node_offset, const int cd_vert_mask_offset)
static BMFacepbvh_bmesh_face_create (BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_face_node_offset, BMLog &bm_log, const int node_index, const Span< BMVert * > v_tri, const Span< BMEdge * > e_tri, const BMFace *f_example)
static int pbvh_bmesh_node_vert_use_count_at_most (MutableSpan< BMeshNode > nodes, const int cd_face_node_offset, const BMeshNode *node, BMVert *v, const int count_max)
static std::optional< int > pbvh_bmesh_vert_other_node_find (const int cd_vert_node_offset, const int cd_face_node_offset, BMVert *v)
static void pbvh_bmesh_vert_ownership_transfer (MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int new_owner_index, BMVert *v)
static void pbvh_bmesh_vert_remove (MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMVert *v)
static void pbvh_bmesh_face_remove (MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log, BMFace *f)
static Array< BMLoop * > pbvh_bmesh_edge_loops (BMEdge *e)
static void pbvh_bmesh_node_drop_orig (BMeshNode *node)
static bool edge_queue_tri_in_sphere (const EdgeQueue *queue, BMFace *f)
static bool edge_queue_tri_in_circle (const EdgeQueue *queue, BMFace *f)
static bool check_mask (const EdgeQueueContext *eq_ctx, const BMVert *v)
static void edge_queue_insert (const EdgeQueueContext *eq_ctx, BMEdge *e, const float priority)
static bool is_boundary_edge (const BMEdge &edge)
static bool is_boundary_vert (const BMVert &vertex)
static bool is_edge_adjacent_to_boundary (const BMEdge &edge)
static float long_edge_queue_priority (const BMEdge &edge)
static float short_edge_queue_priority (const BMEdge &edge)
static void long_edge_queue_edge_add (const EdgeQueueContext *eq_ctx, BMEdge *e)
static void long_edge_queue_edge_add_recursive (const EdgeQueueContext *eq_ctx, const BMLoop *l_edge, const BMLoop *l_end, const float len_sq, const float limit_len)
static void short_edge_queue_edge_add (const EdgeQueueContext *eq_ctx, BMEdge *e)
static void long_edge_queue_face_add (const EdgeQueueContext *eq_ctx, BMFace *f)
static void short_edge_queue_face_add (const EdgeQueueContext *eq_ctx, BMFace *f)
static void long_edge_queue_create (const EdgeQueueContext *eq_ctx, const float max_edge_len, MutableSpan< BMeshNode > nodes, const float3 &center, const std::optional< float3 > view_normal, const float radius, const bool use_frontface, const bool use_projected)
static void short_edge_queue_create (const EdgeQueueContext *eq_ctx, const float min_edge_len, MutableSpan< BMeshNode > nodes, const float3 &center, const std::optional< float3 > view_normal, const float radius, const bool use_frontface, const bool use_projected)
static void copy_edge_data (BMesh &bm, BMEdge &dst, const BMEdge &src)
static void merge_edge_data (BMesh &bm, BMEdge &dst, const BMEdge &src)
static void pbvh_bmesh_split_edge (const EdgeQueueContext *eq_ctx, BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log, BMEdge *e)
static bool pbvh_bmesh_subdivide_long_edges (const EdgeQueueContext *eq_ctx, BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log)
static bool vert_in_face_adjacent_to_edge (BMVert &vert, BMEdge &edge)
static void merge_flap_edge_data (BMesh &bm, const BMFace *del_face, const BMFace *flap_face, BMEdge *e, BMVert *v_del, const BMLoop *l_del, BMVert *v_conn)
static BMVertfind_outer_flap_vert (BMFace &face)
static void try_merge_flap_edge_data_before_dissolve (BMesh &bm, BMFace &face)
static void merge_face_edge_data (BMesh &bm, BMFace *, BMFace *new_face, BMVert *v_del, const BMLoop *l_del, const BMVert *v_conn)
static void pbvh_bmesh_collapse_edge (BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log, BMEdge *e, BMVert *v1, BMVert *v2, Map< BMVert *, BMVert * > &deleted_verts, const EdgeQueueContext *eq_ctx)
static bool pbvh_bmesh_collapse_short_edges (const EdgeQueueContext *eq_ctx, const float min_edge_len, BMesh &bm, MutableSpan< BMeshNode > nodes, MutableSpan< bool > node_changed, const int cd_vert_node_offset, const int cd_face_node_offset, BMLog &bm_log)
bool bmesh_node_nearest_to_ray (BMeshNode &node, const float3 &ray_start, const float3 &ray_normal, float *r_depth, float *dist_sq, const bool use_original)
void bmesh_normals_update (Tree &pbvh, const IndexMask &nodes_to_update)
static void pbvh_bmesh_node_limit_ensure_fast (const MutableSpan< BMFace * > nodeinfo, const Span< Bounds< float3 > > face_bounds, FastNodeBuildInfo *node, MemArena *arena)
static void pbvh_bmesh_create_nodes_fast_recursive (Vector< BMeshNode > &nodes, const int cd_vert_node_offset, const int cd_face_node_offset, const Span< BMFace * > nodeinfo, const Span< Bounds< float3 > > face_bounds, const FastNodeBuildInfo *node, const int node_index, const int parent_index)
static void copy_original_vert (BMLog *log, BMeshNode *node, BMVert *v, int i, bool use_original)
void node_pixels_free (blender::bke::pbvh::Node *node)
void pixels_free (blender::bke::pbvh::Tree *pbvh)
BMesh Utility API

Use some local functions which assume triangles.

static Bounds< float3negative_bounds ()
static std::array< BMEdge *, 3 > bm_edges_from_tri (BMesh &bm, const Span< BMVert * > v_tri)
BLI_INLINE std::array< BMVert *, 3 > bm_face_as_array (const BMFace &f)
static BMFacebm_face_exists_tri_from_loop_vert (const BMLoop *l_radial_first, const BMVert *v_opposite)
static BMVertbm_vert_hash_lookup_chain (Map< BMVert *, BMVert * > &deleted_verts, BMVert *v)

Variables

constexpr int leaf_limit = 400
static constexpr int dyntopo_node_none = -1

Enumeration Type Documentation

◆ PlaneAABBIsect

enum class blender::bke::pbvh::PlaneAABBIsect : int8_t
strong
Enumerator
Inside 
Outside 
Intersect 

Definition at line 2479 of file pbvh.cc.

◆ PositionSource

enum class blender::bke::pbvh::PositionSource : int8_t
strong
Enumerator
Eval 
EvalDeform 
Orig 
RuntimeDeform 

Definition at line 905 of file pbvh.cc.

◆ Type

enum class blender::bke::pbvh::Type
strong
Enumerator
Mesh 
Grids 
BMesh 

Definition at line 221 of file BKE_paint_bvh.hh.

Function Documentation

◆ all_leaf_nodes()

IndexMask blender::bke::pbvh::all_leaf_nodes ( const Tree & pbvh,
IndexMaskMemory & memory )

Return pointers to all the leaf nodes in the BVH tree.

Definition at line 2628 of file pbvh.cc.

References all_leaf_nodes(), IndexMask::from_predicate(), i, and blender::bke::pbvh::Node::Leaf.

Referenced by all_leaf_nodes(), BKE_sculpt_update_object_before_eval(), blender::ed::sculpt_paint::smooth::blur_geometry_data_array(), blender::ed::sculpt_paint::undo::bmesh_restore_generic(), blender::ed::sculpt_paint::cloth::brush_affected_nodes_gather(), blender::ed::sculpt_paint::cloth::calc_constraint_factors(), blender::ed::sculpt_paint::islands::calc_topology_islands_bmesh(), blender::ed::sculpt_paint::face_set::change_visibility_exec(), blender::ed::sculpt_paint::cloth::cloth_sim_initialize_default_node_state(), blender::ed::sculpt_paint::face_set::create_op_exec(), blender::ed::sculpt_paint::face_set::edit_fairing(), blender::ed::sculpt_paint::face_set::edit_grow_shrink(), blender::ed::sculpt_paint::face_set::edit_modify_coordinates(), blender::ed::sculpt_paint::mask::fill_mask(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::hide::hide_show_all_exec(), blender::ed::sculpt_paint::hide::hide_show_masked_exec(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::ed::sculpt_paint::mask::invert_mask(), blender::ed::sculpt_paint::mask::mask_by_color_contiguous_mesh(), blender::ed::sculpt_paint::mask::mask_by_color_full_mesh(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::ed::sculpt_paint::face_set::randomize_colors_exec(), blender::ed::sculpt_paint::expand::restore_color_data(), blender::ed::sculpt_paint::expand::restore_face_set_data(), blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step(), blender::ed::sculpt_paint::undo::restore_list(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), blender::draw::sculpt_batches_get_ex(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), blender::ed::sculpt_paint::store_mesh_from_eval(), transform_active_color(), blender::ed::sculpt_paint::expand::undo_push(), vertex_color_set_exec(), blender::ed::sculpt_paint::hide::visibility_filter_exec(), blender::ed::sculpt_paint::hide::visibility_invert_exec(), and blender::ed::sculpt_paint::expand::write_mask_data().

◆ bm_edges_from_tri()

std::array< BMEdge *, 3 > blender::bke::pbvh::bm_edges_from_tri ( BMesh & bm,
const Span< BMVert * > v_tri )
static

Definition at line 113 of file pbvh_bmesh.cc.

References bm, BM_CREATE_NO_DOUBLE, and BM_edge_create().

Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_split_edge().

◆ bm_face_as_array()

BLI_INLINE std::array< BMVert *, 3 > blender::bke::pbvh::bm_face_as_array ( const BMFace & f)

Definition at line 122 of file pbvh_bmesh.cc.

References BLI_assert, BLI_INLINE, BM_FACE_FIRST_LOOP, l, BMFace::len, and result.

Referenced by BKE_pbvh_bmesh_node_save_orig().

◆ bm_face_exists_tri_from_loop_vert()

BMFace * blender::bke::pbvh::bm_face_exists_tri_from_loop_vert ( const BMLoop * l_radial_first,
const BMVert * v_opposite )
static

A version of BM_face_exists, optimized for triangles when we know the loop and the opposite vertex.

Check if any triangle is formed by (l_radial_first->v, l_radial_first->next->v, v_opposite), at either winding (since its a triangle no special checks are needed).

l_radial_first->v & l_radial_first->next->v
+---+
|  /
| /
+ v_opposite

Its assumed that l_radial_first is never forming the target face.

Definition at line 154 of file pbvh_bmesh.cc.

References BLI_assert, ELEM, BMLoop::f, BMFace::len, BMLoop::next, BMLoop::prev, BMLoop::radial_next, and BMLoop::v.

Referenced by pbvh_bmesh_collapse_edge().

◆ bm_vert_hash_lookup_chain()

BMVert * blender::bke::pbvh::bm_vert_hash_lookup_chain ( Map< BMVert *, BMVert * > & deleted_verts,
BMVert * v )
static

Uses a map of vertices to lookup the final target. References can't point to previous items (would cause infinite loop).

Definition at line 175 of file pbvh_bmesh.cc.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), and v.

Referenced by pbvh_bmesh_collapse_short_edges().

◆ bmesh_node_nearest_to_ray()

bool blender::bke::pbvh::bmesh_node_nearest_to_ray ( BMeshNode & node,
const float3 & ray_start,
const float3 & ray_normal,
float * r_depth,
float * dist_sq,
const bool use_original )

◆ bmesh_normals_update()

◆ bmesh_update_topology()

◆ bounds_get()

◆ build_mesh_leaf_nodes()

BLI_NOINLINE void blender::bke::pbvh::build_mesh_leaf_nodes ( const int verts_num,
const OffsetIndices< int > faces,
const Span< int > corner_verts,
MutableSpan< MeshNode > nodes )
static

◆ build_nodes_recursive_grids()

◆ build_nodes_recursive_mesh()

◆ build_pixels()

void blender::bke::pbvh::build_pixels ( const Depsgraph & depsgraph,
Object & object,
Image & image,
ImageUser & image_user )

◆ cache_source_get()

◆ calc_boundary_face_normals()

void blender::bke::pbvh::calc_boundary_face_normals ( const Span< float3 > positions,
const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< int > face_indices,
MutableSpan< float3 > face_normals )
static

◆ calc_boundary_vert_normals()

void blender::bke::pbvh::calc_boundary_vert_normals ( const GroupedSpan< int > vert_to_face_map,
const Span< float3 > face_normals,
const Span< int > verts,
MutableSpan< float3 > vert_normals )
static

Definition at line 1131 of file pbvh.cc.

References blender::threading::parallel_for(), and verts.

Referenced by update_normals_mesh().

◆ calc_face_bounds()

Bounds< float3 > blender::bke::pbvh::calc_face_bounds ( const Span< float3 > vert_positions,
const Span< int > face_verts )
inline

◆ calc_face_grid_bounds()

Bounds< float3 > blender::bke::pbvh::calc_face_grid_bounds ( const OffsetIndices< int > faces,
const Span< float3 > positions,
const CCGKey & key,
const int face )
static

◆ calc_grids_intersect_data()

void blender::bke::pbvh::calc_grids_intersect_data ( const float3 & ray_start,
const float3 & ray_normal,
const int grid,
const short x,
const short y,
const std::array< const float *, 4 > co,
const float depth,
SubdivCCGCoord & r_active_vertex,
int & r_active_grid_index,
float3 & r_face_normal )
static

◆ calc_mesh_intersect_data()

void blender::bke::pbvh::calc_mesh_intersect_data ( const Span< int > corner_verts,
const Span< int3 > corner_tris,
const float3 & ray_start,
const float3 & ray_normal,
const int face_index,
const int tri_index,
const std::array< const float *, 3 > co,
const float depth,
int & r_active_vertex,
int & r_active_face_index,
float3 & r_face_normal )
static

◆ calc_node_face_normals()

void blender::bke::pbvh::calc_node_face_normals ( const Span< float3 > positions,
const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< MeshNode > nodes,
const IndexMask & nodes_to_update,
MutableSpan< float3 > face_normals )
static

Definition at line 1101 of file pbvh.cc.

References faces, blender::index_mask::IndexMask::foreach_index(), i, and normals_calc_faces().

Referenced by update_normals_mesh().

◆ calc_node_vert_normals()

void blender::bke::pbvh::calc_node_vert_normals ( const GroupedSpan< int > vert_to_face_map,
const Span< float3 > face_normals,
const Span< MeshNode > nodes,
const IndexMask & nodes_to_update,
MutableSpan< float3 > vert_normals )
static

◆ check_mask()

bool blender::bke::pbvh::check_mask ( const EdgeQueueContext * eq_ctx,
const BMVert * v )
static

Return true if the vertex mask is less than 1.0, false otherwise.

Definition at line 761 of file pbvh_bmesh.cc.

References BM_ELEM_CD_GET_FLOAT, blender::bke::pbvh::EdgeQueueContext::cd_vert_mask_offset, and v.

Referenced by edge_queue_insert().

◆ clip_ray_ortho()

void blender::bke::pbvh::clip_ray_ortho ( Tree & pbvh,
bool original,
float ray_start[3],
float ray_end[3],
float ray_normal[3] )

For orthographic cameras, project the far away ray segment points to the root node so we can have better precision.

Note
the interval is not guaranteed to lie between ray_start and ray_end; this is not necessary for orthographic views and is impossible anyhow due to the necessity of projecting the far clipping plane into the local object space. This works out to dividing view3d->clip_end by the object scale, which for small object and large clip_end's can easily lead to floating-point overflows.

Definition at line 2182 of file pbvh.cc.

References add_v3_v3(), axis_dominant_v3_to_m3(), b, clip_ray_ortho(), copy_v3_v3(), first_node(), FLT_MAX, interp_v3_v3v3(), isect_ray_aabb_v3(), isect_ray_aabb_v3_precalc(), line_point_factor_v3(), madd_v3_v3v3fl(), blender::Bounds< T >::max, max, mid_v3_v3v3(), blender::Bounds< T >::min, min, minmax_v3v3_v3(), mul_m3_v3(), mul_v3_v3fl(), sub_v3_v3v3(), and tree_is_empty().

Referenced by clip_ray_ortho(), and blender::ed::sculpt_paint::raycast_init().

◆ copy_edge_data()

void blender::bke::pbvh::copy_edge_data ( BMesh & bm,
BMEdge & dst,
const BMEdge & src )
static

Copy custom data from src to dst edge.

Note
The BM_ELEM_TAG is used to tell whether an edge is in the queue for collapse/split, so we do not copy this flag as we do not want the new edge to appear in the queue.

Definition at line 1095 of file pbvh_bmesh.cc.

References bm, BM_ELEM_TAG, CustomData_bmesh_copy_block(), BMHeader::data, BMEdge::head, and BMHeader::hflag.

Referenced by pbvh_bmesh_split_edge().

◆ copy_original_vert()

void blender::bke::pbvh::copy_original_vert ( BMLog * log,
BMeshNode * node,
BMVert * v,
int i,
bool use_original )
static

◆ count_grid_quads()

int blender::bke::pbvh::count_grid_quads ( const BitGroupVector<> & grid_hidden,
Span< int > grid_indices,
int gridsize,
int display_gridsize )

◆ dist_squared_ray_to_tri_v3_fast()

float blender::bke::pbvh::dist_squared_ray_to_tri_v3_fast ( const float3 & ray_origin,
const float3 & ray_direction,
const float3 & v0,
const float3 & v1,
const float3 & v2,
float3 & r_point,
float * r_depth )
static

◆ edge_queue_insert()

◆ edge_queue_tri_in_circle()

◆ edge_queue_tri_in_sphere()

◆ ENUM_OPERATORS()

blender::bke::pbvh::ENUM_OPERATORS ( Node::Flags ,
Node::Flags::TopologyUpdated  )

◆ face_normals_cache_eval()

const SharedCache< Vector< float3 > > & blender::bke::pbvh::face_normals_cache_eval ( const Object & object_orig,
const Object & object_eval )
static

◆ face_normals_cache_eval_for_write()

SharedCache< Vector< float3 > > & blender::bke::pbvh::face_normals_cache_eval_for_write ( Object & object_orig,
Object & object_eval )
static

Definition at line 993 of file pbvh.cc.

References face_normals_cache_eval().

Referenced by update_normals_mesh().

◆ face_normals_eval_from_eval()

Span< float3 > blender::bke::pbvh::face_normals_eval_from_eval ( const Object & object_eval)

◆ find_nearest_to_ray()

void blender::bke::pbvh::find_nearest_to_ray ( Tree & pbvh,
const FunctionRef< void(Node &node, float *tmin)> fn,
const float3 & ray_start,
const float3 & ray_normal,
bool original )

◆ find_nearest_to_ray_node()

bool blender::bke::pbvh::find_nearest_to_ray_node ( Tree & pbvh,
Node & node,
Span< float3 > node_positions,
bool use_origco,
Span< float3 > vert_positions,
const OffsetIndices< int > faces,
Span< int > corner_verts,
Span< int3 > corner_tris,
Span< bool > hide_poly,
const SubdivCCG * subdiv_ccg,
const float ray_start[3],
const float ray_normal[3],
float * depth,
float * dist_sq )

◆ find_outer_flap_vert()

BMVert * blender::bke::pbvh::find_outer_flap_vert ( BMFace & face)
static

Find vertex which can be an outer for the flap face: the vertex will become loose when the face and its edges are removed. If there are multiple of such vertices, return null.

Definition at line 1392 of file pbvh_bmesh.cc.

References BM_ITER_ELEM, BM_vert_face_count_at_most(), and BM_VERTS_OF_FACE.

Referenced by try_merge_flap_edge_data_before_dissolve().

◆ first_node()

Node & blender::bke::pbvh::first_node ( Tree & pbvh)
static

Definition at line 688 of file pbvh.cc.

References BLI_assert, and tree_is_empty().

Referenced by clip_ray_ortho(), and pbvh_iter_begin().

◆ free_tree()

void blender::bke::pbvh::free_tree ( NodeTree * tree)
static

Definition at line 832 of file pbvh.cc.

References free(), free_tree(), and tree.

Referenced by free_tree(), and search_callback_occluded().

◆ is_boundary_edge()

bool blender::bke::pbvh::is_boundary_edge ( const BMEdge & edge)
static

Return true if the edge is a boundary edge: both its vertices are on a boundary.

Definition at line 789 of file pbvh_bmesh.cc.

References BM_edge_is_manifold(), BM_ELEM_SEAM, BM_ELEM_SMOOTH, BMEdge::head, and BMHeader::hflag.

Referenced by is_boundary_vert(), and short_edge_queue_priority().

◆ is_boundary_vert()

bool blender::bke::pbvh::is_boundary_vert ( const BMVert & vertex)
static

◆ is_edge_adjacent_to_boundary()

bool blender::bke::pbvh::is_edge_adjacent_to_boundary ( const BMEdge & edge)
static

Return true if at least one of the edge vertices is adjacent to a boundary.

Definition at line 824 of file pbvh_bmesh.cc.

References is_boundary_vert(), BMEdge::v1, and BMEdge::v2.

Referenced by short_edge_queue_priority().

◆ leaf_needs_material_split()

bool blender::bke::pbvh::leaf_needs_material_split ( const Span< int > faces,
const Span< int > material_indices )

◆ long_edge_queue_create()

void blender::bke::pbvh::long_edge_queue_create ( const EdgeQueueContext * eq_ctx,
const float max_edge_len,
MutableSpan< BMeshNode > nodes,
const float3 & center,
const std::optional< float3 > view_normal,
const float radius,
const bool use_frontface,
const bool use_projected )
static

◆ long_edge_queue_edge_add()

◆ long_edge_queue_edge_add_recursive()

◆ long_edge_queue_face_add()

◆ long_edge_queue_priority()

float blender::bke::pbvh::long_edge_queue_priority ( const BMEdge & edge)
static

◆ merge_bounds()

Bounds< float3 > blender::bke::pbvh::merge_bounds ( const Bounds< float3 > & a,
const Bounds< float3 > & b )
static

◆ merge_edge_data()

void blender::bke::pbvh::merge_edge_data ( BMesh & bm,
BMEdge & dst,
const BMEdge & src )
static

◆ merge_face_edge_data()

void blender::bke::pbvh::merge_face_edge_data ( BMesh & bm,
BMFace * ,
BMFace * new_face,
BMVert * v_del,
const BMLoop * l_del,
const BMVert * v_conn )
static

Merge attributes of edges from v_del to f

This function is to be called before faces adjacent to e are deleted. This function only handles edge attributes. and does not handle face deletion.

Parameters
del_faceFace which is adjacent to v_del and will be deleted as part of merging v_del to v_conn.
new_faceA new face which is created from del_face by replacing v_del with v_conn.
v_delA vertex which will be removed after the edge collapse.
l_delA loop of del_face which is adjacent to v_del.
v_connA vertex which into which geometry is reconnected to after the edge collapse.

Definition at line 1466 of file pbvh_bmesh.cc.

References BLI_assert, bm, BM_edge_exists(), BM_edge_other_vert(), BM_EDGES_OF_FACE, BM_ITER_ELEM, BM_vert_in_edge(), CLOG_WARN, LOG, merge_edge_data(), BMLoop::next, BMLoop::prev, and BMLoop::v.

Referenced by pbvh_bmesh_collapse_edge().

◆ merge_flap_edge_data()

void blender::bke::pbvh::merge_flap_edge_data ( BMesh & bm,
const BMFace * del_face,
const BMFace * flap_face,
BMEdge * e,
BMVert * v_del,
const BMLoop * l_del,
BMVert * v_conn )
static

Merge attributes of a flap face into an edge which will remain after the edge collapse in pbvh_bmesh_collapse_edge.

This function is to be called before faces adjacent to e are deleted. This function only handles edge attributes and does not handle face deletion.

Parameters
del_faceFace which is adjacent to v_del and will form a flap when merging v_del to v_conn.
flap_faceFace which is adjacent to v_conn and will form a flap when merging v_del to v_conn.
eAn edge which is being collapsed. It connects v_del and v_conn.
v_delA vertex which will be removed after the edge collapse.
l_delA loop of del_face which is adjacent to v_del.
v_connA vertex which into which geometry is reconnected to after the edge collapse.

Definition at line 1315 of file pbvh_bmesh.cc.

References BLI_assert, bm, BM_edge_exists(), BM_edge_in_face(), BM_edge_other_vert(), CLOG_WARN, e, LOG, merge_edge_data(), BMLoop::next, BMLoop::prev, UNUSED_VARS_NDEBUG, BMLoop::v, BMEdge::v1, BMEdge::v2, v2, and vert_in_face_adjacent_to_edge().

Referenced by pbvh_bmesh_collapse_edge().

◆ mesh_topology_count_matches()

bool blender::bke::pbvh::mesh_topology_count_matches ( const Mesh & a,
const Mesh & b )
static

Logic used to test whether to use the evaluated mesh for positions.

Todo
A deeper test of equality of topology array pointers would be better. This is kept for now to avoid changing logic during a refactor.

Definition at line 899 of file pbvh.cc.

References b, Mesh::corners_num, Mesh::faces_num, and Mesh::verts_num.

Referenced by cache_source_get().

◆ nearest_to_ray_aabb_dist_sq()

bool blender::bke::pbvh::nearest_to_ray_aabb_dist_sq ( Node * node,
const DistRayAABB_Precalc & dist_ray_to_aabb_precalc,
const bool original )
static

◆ negative_bounds() [1/2]

◆ negative_bounds() [2/2]

Bounds< float3 > blender::bke::pbvh::negative_bounds ( )
static

Definition at line 108 of file pbvh_bmesh.cc.

◆ node_face_indices_calc_grids()

◆ node_frustum_contain_aabb()

bool blender::bke::pbvh::node_frustum_contain_aabb ( const Node & node,
Span< float4 > frustum_planes )

Test if AABB is at least partially inside the #PBVHFrustumPlanes volume.

Definition at line 2520 of file pbvh.cc.

References blender::bke::pbvh::Node::bounds_, node_frustum_contain_aabb(), Outside, and test_frustum_aabb().

Referenced by node_frustum_contain_aabb(), and blender::draw::sculpt_batches_get_ex().

◆ node_frustum_exclude_aabb()

bool blender::bke::pbvh::node_frustum_exclude_aabb ( const Node & node,
Span< float4 > frustum_planes )

Test if AABB is at least partially outside the #PBVHFrustumPlanes volume.

Definition at line 2525 of file pbvh.cc.

References blender::bke::pbvh::Node::bounds_, Inside, node_frustum_exclude_aabb(), and test_frustum_aabb().

Referenced by node_frustum_exclude_aabb().

◆ node_pixels_free()

void blender::bke::pbvh::node_pixels_free ( blender::bke::pbvh::Node * node)

Definition at line 490 of file pbvh_pixels.cc.

References blender::bke::pbvh::Node::pixels_.

Referenced by blender::bke::pbvh::Tree::~Tree().

◆ node_raycast_bmesh()

◆ node_raycast_grids()

◆ node_raycast_mesh()

bool blender::bke::pbvh::node_raycast_mesh ( const MeshNode & node,
Span< float3 > node_positions,
Span< float3 > vert_positions,
OffsetIndices< int > faces,
Span< int > corner_verts,
Span< int3 > corner_tris,
Span< bool > hide_poly,
const float3 & ray_start,
const float3 & ray_normal,
IsectRayPrecalc * isect_precalc,
float * depth,
int & r_active_vertex,
int & r_active_face_index,
float3 & r_face_normal )

◆ node_tree_insert()

void blender::bke::pbvh::node_tree_insert ( NodeTree * tree,
NodeTree * new_node )
static

◆ node_update_mask_bmesh()

◆ node_update_mask_grids()

◆ node_update_mask_mesh()

◆ node_update_visibility_bmesh()

◆ node_update_visibility_grids()

◆ node_update_visibility_mesh()

◆ nodes_to_face_selection_grids()

IndexMask blender::bke::pbvh::nodes_to_face_selection_grids ( const SubdivCCG & subdiv_ccg,
Span< GridsNode > nodes,
const IndexMask & nodes_mask,
IndexMaskMemory & memory )

◆ normals_calc_faces()

void blender::bke::pbvh::normals_calc_faces ( const Span< float3 > positions,
const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< int > face_indices,
MutableSpan< float3 > face_normals )
static

◆ normals_calc_verts_simple()

void blender::bke::pbvh::normals_calc_verts_simple ( const GroupedSpan< int > vert_to_face_map,
const Span< float3 > face_normals,
const Span< int > verts,
MutableSpan< float3 > vert_normals )
static

Definition at line 1113 of file pbvh.cc.

References length(), blender::math::normalize_and_get_length(), and verts.

Referenced by calc_node_vert_normals().

◆ partition_along_axis()

int blender::bke::pbvh::partition_along_axis ( const Span< float3 > face_centers,
MutableSpan< int > faces,
const int axis,
const float middle )

◆ partition_material_indices()

int blender::bke::pbvh::partition_material_indices ( const Span< int > material_indices,
MutableSpan< int > faces )

◆ pbvh_bmesh_collapse_edge()

void blender::bke::pbvh::pbvh_bmesh_collapse_edge ( BMesh & bm,
MutableSpan< BMeshNode > nodes,
MutableSpan< bool > node_changed,
const int cd_vert_node_offset,
const int cd_face_node_offset,
BMLog & bm_log,
BMEdge * e,
BMVert * v1,
BMVert * v2,
Map< BMVert *, BMVert * > & deleted_verts,
const EdgeQueueContext * eq_ctx )
static

◆ pbvh_bmesh_collapse_short_edges()

◆ pbvh_bmesh_create_nodes_fast_recursive()

void blender::bke::pbvh::pbvh_bmesh_create_nodes_fast_recursive ( Vector< BMeshNode > & nodes,
const int cd_vert_node_offset,
const int cd_face_node_offset,
const Span< BMFace * > nodeinfo,
const Span< Bounds< float3 > > face_bounds,
const FastNodeBuildInfo * node,
const int node_index,
const int parent_index )
static

◆ pbvh_bmesh_edge_loops()

◆ pbvh_bmesh_face_create()

BMFace * blender::bke::pbvh::pbvh_bmesh_face_create ( BMesh & bm,
MutableSpan< BMeshNode > nodes,
MutableSpan< bool > node_changed,
const int cd_face_node_offset,
BMLog & bm_log,
const int node_index,
const Span< BMVert * > v_tri,
const Span< BMEdge * > e_tri,
const BMFace * f_example )
static

◆ pbvh_bmesh_face_remove()

◆ pbvh_bmesh_node_drop_orig()

void blender::bke::pbvh::pbvh_bmesh_node_drop_orig ( BMeshNode * node)
static

◆ pbvh_bmesh_node_finalize()

◆ pbvh_bmesh_node_from_face()

BLI_INLINE BMeshNode * blender::bke::pbvh::pbvh_bmesh_node_from_face ( MutableSpan< BMeshNode > nodes,
const int cd_face_node_offset,
const BMFace * key )

◆ pbvh_bmesh_node_from_vert()

BLI_INLINE BMeshNode * blender::bke::pbvh::pbvh_bmesh_node_from_vert ( MutableSpan< BMeshNode > nodes,
const int cd_vert_node_offset,
const BMVert * key )

Definition at line 402 of file pbvh_bmesh.cc.

References BLI_INLINE, and pbvh_bmesh_node_index_from_vert().

Referenced by pbvh_bmesh_vert_remove().

◆ pbvh_bmesh_node_index_from_face()

BLI_INLINE int blender::bke::pbvh::pbvh_bmesh_node_index_from_face ( const int cd_face_node_offset,
const BMFace * key )

◆ pbvh_bmesh_node_index_from_vert()

BLI_INLINE int blender::bke::pbvh::pbvh_bmesh_node_index_from_vert ( const int cd_vert_node_offset,
const BMVert * key )

◆ pbvh_bmesh_node_limit_ensure()

bool blender::bke::pbvh::pbvh_bmesh_node_limit_ensure ( BMesh & bm,
Vector< BMeshNode > & nodes,
Vector< bool > & node_changed,
const int cd_vert_node_offset,
const int cd_face_node_offset,
const int node_index )
static

Recursively split the node if it exceeds the leaf_limit.

Definition at line 344 of file pbvh_bmesh.cc.

References bm, BM_elem_index_set, BM_FACE, BM_FACE_FIRST_LOOP, BMVert::co, i, leaf_limit, blender::math::min_max(), negative_bounds(), BMLoop::next, pbvh_bmesh_node_split(), and BMLoop::v.

◆ pbvh_bmesh_node_limit_ensure_fast()

void blender::bke::pbvh::pbvh_bmesh_node_limit_ensure_fast ( const MutableSpan< BMFace * > nodeinfo,
const Span< Bounds< float3 > > face_bounds,
FastNodeBuildInfo * node,
MemArena * arena )
static

◆ pbvh_bmesh_node_split()

◆ pbvh_bmesh_node_vert_use_count_at_most()

int blender::bke::pbvh::pbvh_bmesh_node_vert_use_count_at_most ( MutableSpan< BMeshNode > nodes,
const int cd_face_node_offset,
const BMeshNode * node,
BMVert * v,
const int count_max )
static

◆ pbvh_bmesh_split_edge()

◆ pbvh_bmesh_subdivide_long_edges()

◆ pbvh_bmesh_vert_create()

BMVert * blender::bke::pbvh::pbvh_bmesh_vert_create ( BMesh & bm,
MutableSpan< BMeshNode > nodes,
MutableSpan< bool > node_changed,
BMLog & bm_log,
const BMVert * v1,
const BMVert * v2,
const int node_index,
const float3 & co,
const float3 & no,
const int cd_vert_node_offset,
const int cd_vert_mask_offset )
static

◆ pbvh_bmesh_vert_other_node_find()

std::optional< int > blender::bke::pbvh::pbvh_bmesh_vert_other_node_find ( const int cd_vert_node_offset,
const int cd_face_node_offset,
BMVert * v )
static

Return a node that uses vertex v other than its current owner.

Definition at line 513 of file pbvh_bmesh.cc.

References BM_FACES_OF_VERT_ITER_BEGIN, BM_FACES_OF_VERT_ITER_END, pbvh_bmesh_node_index_from_face(), pbvh_bmesh_node_index_from_vert(), and v.

Referenced by pbvh_bmesh_face_remove().

◆ pbvh_bmesh_vert_ownership_transfer()

◆ pbvh_bmesh_vert_remove()

◆ pbvh_faces_node_nearest_to_ray()

bool blender::bke::pbvh::pbvh_faces_node_nearest_to_ray ( const MeshNode & node,
const Span< float3 > node_positions,
const Span< float3 > vert_positions,
const OffsetIndices< int > faces,
const Span< int > corner_verts,
const Span< int3 > corner_tris,
const Span< bool > hide_poly,
const float3 & ray_start,
const float3 & ray_normal,
float * r_depth,
float * dist_sq )
static

◆ pbvh_grids_node_nearest_to_ray()

◆ pbvh_iter_begin()

void blender::bke::pbvh::pbvh_iter_begin ( PBVHIter * iter,
Tree & pbvh,
FunctionRef< bool(Node &)> scb )
static

◆ pbvh_iter_next()

◆ pbvh_iter_next_occluded()

◆ pixels_free()

void blender::bke::pbvh::pixels_free ( blender::bke::pbvh::Tree * pbvh)

Definition at line 502 of file pbvh_pixels.cc.

Referenced by blender::bke::pbvh::Tree::~Tree().

◆ ray_aabb_intersect()

◆ ray_face_intersection_quad()

bool blender::bke::pbvh::ray_face_intersection_quad ( const float3 & ray_start,
const IsectRayPrecalc * isect_precalc,
const float3 & t0,
const float3 & t1,
const float3 & t2,
const float3 & t3,
float * depth )

◆ ray_face_intersection_tri()

bool blender::bke::pbvh::ray_face_intersection_tri ( const float3 & ray_start,
const IsectRayPrecalc * isect_precalc,
const float3 & t0,
const float3 & t1,
const float3 & t2,
float * depth )

◆ ray_face_nearest_quad()

bool blender::bke::pbvh::ray_face_nearest_quad ( const float3 & ray_start,
const float3 & ray_normal,
const float3 & t0,
const float3 & t1,
const float3 & t2,
const float3 & t3,
float * r_depth,
float * dist_sq )

◆ ray_face_nearest_tri()

bool blender::bke::pbvh::ray_face_nearest_tri ( const float3 & ray_start,
const float3 & ray_normal,
const float3 & t0,
const float3 & t1,
const float3 & t2,
float * r_depth,
float * dist_sq )

◆ raycast() [1/2]

void blender::bke::pbvh::raycast ( Tree & pbvh,
const FunctionRef< void(Node &node, float *tmin)> hit_fn,
const float3 & ray_start,
const float3 & ray_normal,
bool original )

◆ raycast() [2/2]

◆ raycast_node_detail_bmesh()

◆ search_callback_occluded()

◆ search_gather()

Vector< Node * > blender::bke::pbvh::search_gather ( Tree & pbvh,
const FunctionRef< bool(Node &)> scb,
Node::Flags leaf_flag )
static

◆ search_nodes()

◆ short_edge_queue_create()

void blender::bke::pbvh::short_edge_queue_create ( const EdgeQueueContext * eq_ctx,
const float min_edge_len,
MutableSpan< BMeshNode > nodes,
const float3 & center,
const std::optional< float3 > view_normal,
const float radius,
const bool use_frontface,
const bool use_projected )
static

◆ short_edge_queue_edge_add()

◆ short_edge_queue_face_add()

◆ short_edge_queue_priority()

float blender::bke::pbvh::short_edge_queue_priority ( const BMEdge & edge)
static

◆ store_bounds_orig()

void blender::bke::pbvh::store_bounds_orig ( Tree & pbvh)

Copy all current node bounds to the original bounds. "Original" bounds are typically from before a brush stroke started (while the "regular" bounds update on every change of positions). These are stored to optimize the BVH traversal for original coordinates enabled by various "use original" arguments in the Tree API.

Definition at line 1408 of file pbvh.cc.

References blender::threading::parallel_for().

Referenced by BKE_pbvh_vert_coords_apply(), blender::ed::sculpt_paint::flush_update_done(), blender::bke::pbvh::Tree::from_bmesh(), blender::bke::pbvh::Tree::from_mesh(), and blender::ed::sculpt_paint::undo::restore_list().

◆ test_frustum_aabb()

PlaneAABBIsect blender::bke::pbvh::test_frustum_aabb ( const Bounds< float3 > & bounds,
const Span< float4 > frustum_planes )
static

◆ traverse_tree()

void blender::bke::pbvh::traverse_tree ( NodeTree * tree,
const FunctionRef< void(Node &node, float *tmin)> hit_fn,
float * tmin )
static

Definition at line 817 of file pbvh.cc.

References traverse_tree(), and tree.

Referenced by search_callback_occluded(), and traverse_tree().

◆ tree_is_empty()

bool blender::bke::pbvh::tree_is_empty ( const Tree & pbvh)
static

Definition at line 683 of file pbvh.cc.

Referenced by clip_ray_ortho(), first_node(), search_callback_occluded(), and search_gather().

◆ try_merge_flap_edge_data_before_dissolve()

void blender::bke::pbvh::try_merge_flap_edge_data_before_dissolve ( BMesh & bm,
BMFace & face )
static

If the del_face is a flap, merge edge data from edges adjacent to "corner" vertex into the other edge. The "corner" as it is an "outer", or a vertex which will become loose when the del_face and its edges are removed.

If the face is not a flap then this function does nothing.

Definition at line 1418 of file pbvh_bmesh.cc.

References BLI_assert, bm, BM_edge_face_count(), BM_vert_find_first_loop(), BMLoop::e, find_outer_flap_vert(), merge_edge_data(), BMLoop::next, BMLoop::prev, and BMLoop::v.

Referenced by pbvh_bmesh_collapse_edge().

◆ update_mask_bmesh()

◆ update_mask_grids()

◆ update_mask_mesh()

void blender::bke::pbvh::update_mask_mesh ( const Mesh & mesh,
const IndexMask & node_mask,
Tree & pbvh )

◆ update_node_bounds_bmesh()

void blender::bke::pbvh::update_node_bounds_bmesh ( BMeshNode & node)

Definition at line 1294 of file pbvh.cc.

References blender::bke::pbvh::BMeshNode::bm_other_verts_, blender::bke::pbvh::BMeshNode::bm_unique_verts_, blender::bke::pbvh::Node::bounds_, BMVert::co, blender::math::min_max(), and negative_bounds().

Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::brushes::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::brushes::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::brushes::do_rotate_brush(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::boundary::do_slide_brush(), blender::ed::sculpt_paint::boundary::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::ed::sculpt_paint::brushes::do_topology_slide_brush(), blender::ed::sculpt_paint::boundary::do_twist_brush(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::transform_radius_elastic(), and blender::bke::pbvh::Tree::update_bounds_bmesh().

◆ update_node_bounds_grids()

void blender::bke::pbvh::update_node_bounds_grids ( int grid_area,
Span< float3 > positions,
GridsNode & node )

Definition at line 1283 of file pbvh.cc.

References blender::bke::pbvh::Node::bounds_, blender::bke::ccg::grid_range(), blender::bke::pbvh::GridsNode::grids(), blender::math::min_max(), negative_bounds(), and blender::Span< T >::slice().

Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_displacement_eraser_brush(), blender::ed::sculpt_paint::brushes::do_displacement_smear_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::brushes::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::brushes::do_rotate_brush(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::boundary::do_slide_brush(), blender::ed::sculpt_paint::boundary::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::ed::sculpt_paint::brushes::do_topology_slide_brush(), blender::ed::sculpt_paint::boundary::do_twist_brush(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::transform_radius_elastic(), and blender::bke::pbvh::Tree::update_bounds_grids().

◆ update_node_bounds_mesh()

void blender::bke::pbvh::update_node_bounds_mesh ( Span< float3 > positions,
MeshNode & node )

Definition at line 1274 of file pbvh.cc.

References blender::bke::pbvh::MeshNode::all_verts(), blender::bke::pbvh::Node::bounds_, blender::math::min_max(), and negative_bounds().

Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_elastic_deform_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::brushes::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::brushes::do_rotate_brush(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::boundary::do_slide_brush(), blender::ed::sculpt_paint::boundary::do_smooth_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), blender::ed::sculpt_paint::brushes::do_thumb_brush(), blender::ed::sculpt_paint::brushes::do_topology_slide_brush(), blender::ed::sculpt_paint::boundary::do_twist_brush(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::sculpt_transform_all_vertices(), blender::ed::sculpt_paint::transform_radius_elastic(), and blender::bke::pbvh::Tree::update_bounds_mesh().

◆ update_normals()

◆ update_normals_from_eval()

void blender::bke::pbvh::update_normals_from_eval ( Object & object_eval,
Tree & pbvh )

Update geometry normals (potentially on the original object geometry).

Definition at line 1264 of file pbvh.cc.

References DEG_get_original().

Referenced by BKE_sculpt_update_object_before_eval(), blender::draw::DRW_mesh_batch_cache_create_requested(), and blender::draw::sculpt_batches_get_ex().

◆ update_normals_mesh()

void blender::bke::pbvh::update_normals_mesh ( Object & object_orig,
Object & object_eval,
const Span< MeshNode > nodes,
const IndexMask & nodes_to_update )
static

◆ update_visibility_bmesh()

void blender::bke::pbvh::update_visibility_bmesh ( const MutableSpan< BMeshNode > nodes,
const IndexMask & node_mask )
static

◆ update_visibility_faces()

◆ update_visibility_grids()

◆ vert_in_face_adjacent_to_edge()

bool blender::bke::pbvh::vert_in_face_adjacent_to_edge ( BMVert & vert,
BMEdge & edge )
static

Check whether the vert is adjacent to any face which are adjacent to the #edge.

Definition at line 1287 of file pbvh_bmesh.cc.

References BM_FACES_OF_EDGE, BM_ITER_ELEM, and BM_vert_in_face().

Referenced by merge_flap_edge_data().

◆ vert_normals_cache_eval()

◆ vert_normals_cache_eval_for_write()

SharedCache< Vector< float3 > > & blender::bke::pbvh::vert_normals_cache_eval_for_write ( Object & object_orig,
Object & object_eval )
static

Definition at line 966 of file pbvh.cc.

References vert_normals_cache_eval().

Referenced by update_normals_mesh().

◆ vert_normals_eval()

Span< float3 > blender::bke::pbvh::vert_normals_eval ( const Depsgraph & depsgraph,
const Object & object_orig )

Return the vertex normals corresponding the positions from vert_positions_eval. This may be a reference to the normals cache on the original mesh.

Definition at line 1059 of file pbvh.cc.

References DEG_get_evaluated(), depsgraph, and vert_normals_cache_eval().

Referenced by blender::ed::sculpt_paint::calc_area_center(), blender::ed::sculpt_paint::calc_area_normal(), blender::ed::sculpt_paint::calc_area_normal_and_center(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), blender::ed::sculpt_paint::filter::calc_relax_face_sets_filter(), blender::ed::sculpt_paint::filter::calc_relax_filter(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), calculate_average_weight(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::ed::sculpt_paint::cloth::copy_normals_to_array(), blender::ed::sculpt_paint::brushes::do_clay_brush(), blender::ed::sculpt_paint::brushes::do_clay_strips_brush(), blender::ed::sculpt_paint::brushes::do_clay_thumb_brush(), blender::ed::sculpt_paint::brushes::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::brushes::do_enhance_details_brush(), blender::ed::sculpt_paint::brushes::do_inflate_brush(), blender::ed::sculpt_paint::brushes::do_layer_brush(), blender::ed::sculpt_paint::brushes::do_mask_brush(), blender::ed::sculpt_paint::brushes::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::brushes::do_pinch_brush(), blender::ed::sculpt_paint::brushes::do_plane_brush(), blender::ed::sculpt_paint::color::do_smear_brush(), blender::ed::sculpt_paint::brushes::do_snake_hook_brush(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur(), do_wpaint_brush_draw(), do_wpaint_brush_smear(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::project::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::boundary::init_boundary_mesh(), blender::ed::sculpt_paint::auto_mask::normal_occlusion_automasking_fill(), blender::ed::sculpt_paint::expand::normals_falloff_create(), blender::ed::sculpt_paint::brushes::offset_positions(), blender::ed::sculpt_paint::hide::partialvis_gesture_update_mesh(), blender::ed::sculpt_paint::brushes::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::set_persistent_base_exec(), blender::ed::sculpt_paint::undo::store_positions_mesh(), and vpaint_do_draw().

◆ vert_normals_eval_from_eval()

Span< float3 > blender::bke::pbvh::vert_normals_eval_from_eval ( const Object & object_eval)

◆ vert_positions_eval() [1/2]

Span< float3 > blender::bke::pbvh::vert_positions_eval ( const Depsgraph & depsgraph,
const Object & object_orig )

Retrieve the positions array from the evaluated mesh after deforming modifiers and before topology-changing operations. If there are no deform modifiers, this returns the original mesh's vertex positions.

Definition at line 1040 of file pbvh.cc.

References DEG_get_evaluated(), depsgraph, and vert_positions_eval().

Referenced by SculptSession::active_vert_position(), blender::ed::sculpt_paint::average_mask_border_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::ed::sculpt_paint::calc_area_center(), blender::ed::sculpt_paint::calc_area_normal(), blender::ed::sculpt_paint::calc_area_normal_and_center(), blender::ed::sculpt_paint::pose::calc_average_face_set_center(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), blender::ed::sculpt_paint::pose::calc_pose_origin_and_factor_mesh(), blender::ed::sculpt_paint::calc_smooth_translations(), blender::ed::sculpt_paint::auto_mask::calc_vert_factors(), calculate_average_color(), calculate_average_weight(), blender::ed::sculpt_paint::trim::calculate_depth(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_forces(), blender::ed::sculpt_paint::cloth::copy_positions_to_array(), blender::ed::sculpt_paint::cursor_geometry_info_update(), blender::ed::sculpt_paint::boundary::data_init_mesh(), blender::ed::sculpt_paint::brushes::do_mask_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::color::do_smear_brush(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), do_vpaint_brush_smear(), do_wpaint_brush_blur(), do_wpaint_brush_draw(), do_wpaint_brush_smear(), blender::ed::sculpt_paint::expand::enabled_state_to_bitmap(), blender::ed::sculpt_paint::fake_neighbor_search(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors(), blender::ed::sculpt_paint::find_symm_verts_mesh(), blender::ed::sculpt_paint::expand::geodesic_falloff_create(), blender::ed::sculpt_paint::geometry_preview_lines_update(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::face_set::gesture_apply_mesh(), blender::ed::sculpt_paint::pose::grow_pose_factor(), blender::ed::sculpt_paint::pose::ik_chain_init_face_sets_mesh(), blender::ed::sculpt_paint::pose::ik_chain_init_topology(), blender::ed::sculpt_paint::auto_mask::init_boundary_masking_mesh(), blender::ed::sculpt_paint::boundary::init_boundary_mesh(), blender::ed::sculpt_paint::auto_mask::normal_occlusion_automasking_fill(), blender::ed::sculpt_paint::paint_cursor_draw_3d_view_brush_cursor_inactive(), blender::ed::sculpt_paint::hide::partialvis_gesture_update_mesh(), blender::ed::sculpt_paint::PositionDeformData::PositionDeformData(), blender::ed::sculpt_paint::expand::reposition_pivot(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::brushes::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), blender::ed::sculpt_paint::undo::store_positions_mesh(), blender::ed::sculpt_paint::stroke_get_location_bvh_ex(), blender::bke::pbvh::Tree::update_bounds(), blender::ed::sculpt_paint::expand::update_for_vert(), blender::bke::pbvh::pixels::update_pixels(), vert_positions_eval(), vert_positions_eval_from_eval(), blender::ed::sculpt_paint::vert_positions_for_grab_active_get(), blender::ed::sculpt_paint::vertex_is_occluded(), and vpaint_do_draw().

◆ vert_positions_eval() [2/2]

Span< float3 > blender::bke::pbvh::vert_positions_eval ( const Object & object_orig,
const Object & object_eval )
static

◆ vert_positions_eval_for_write() [1/2]

MutableSpan< float3 > blender::bke::pbvh::vert_positions_eval_for_write ( const Depsgraph & depsgraph,
Object & object_orig )

Retrieve write access to the evaluated deform positions, or the original object positions if there are no deformation modifiers. Writing the evaluated positions is necessary because they are used for drawing and we don't run a full dependency graph update whenever they are changed.

Definition at line 1053 of file pbvh.cc.

References DEG_get_evaluated(), depsgraph, and vert_positions_eval_for_write().

Referenced by blender::ed::sculpt_paint::PositionDeformData::PositionDeformData(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), and vert_positions_eval_for_write().

◆ vert_positions_eval_for_write() [2/2]

MutableSpan< float3 > blender::bke::pbvh::vert_positions_eval_for_write ( Object & object_orig,
Object & object_eval )
static

◆ vert_positions_eval_from_eval()

Span< float3 > blender::bke::pbvh::vert_positions_eval_from_eval ( const Object & object_eval)

Variable Documentation

◆ dyntopo_node_none

◆ leaf_limit

int blender::bke::pbvh::leaf_limit = 400
constexpr

Ensure we don't have dirty tags for the edge queue, and that they are left cleared. (slow, even for debug mode, so leave disabled for now).

Definition at line 49 of file pbvh_bmesh.cc.

Referenced by build_nodes_recursive_grids(), build_nodes_recursive_mesh(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), pbvh_bmesh_node_limit_ensure(), pbvh_bmesh_node_limit_ensure_fast(), and pbvh_bmesh_node_split().