Blender V4.3
blender::bke::pbvh Namespace Reference

Namespaces

namespace  pixels
 
namespace  uv_islands
 

Classes

struct  BMeshNode
 
struct  BoundsMergeInfo
 
class  DrawCache
 
struct  EdgeQueue
 
struct  EdgeQueueContext
 
struct  FastNodeBuildInfo
 
struct  GridsNode
 
struct  MeshNode
 
class  Node
 
struct  node_tree
 
struct  PBVHIter
 
struct  RaycastData
 
struct  StackItem
 
class  Tree
 

Enumerations

enum class  Type { Mesh , Grids , BMesh }
 
enum  PlaneAABBIsect { ISECT_INSIDE , ISECT_OUTSIDE , ISECT_INTERSECT }
 

Functions

void build_pixels (const Depsgraph &depsgraph, Object &object, Image &image, ImageUser &image_user)
 
void raycast (Tree &pbvh, FunctionRef< void(Node &node, float *tmin)> cb, const float3 &ray_start, const float3 &ray_normal, bool original)
 
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, IsectRayPrecalc *isect_precalc, float *depth, bool use_original, BMVert **r_active_vertex, float3 &r_face_normal)
 
bool raycast_node_detail_bmesh (BMeshNode &node, const float3 &ray_start, 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)
 
void set_frustum_planes (Tree &pbvh, PBVHFrustumPlanes *planes)
 
void get_frustum_planes (const Tree &pbvh, PBVHFrustumPlanes *planes)
 
Bounds< float3bounds_get (const Tree &pbvh)
 
int count_grid_quads (const BitGroupVector<> &grid_visibility, 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 float center[3], const float view_normal[3], float radius, bool use_frontface, bool use_projected)
 
Span< intnode_face_indices_calc_grids (const SubdivCCG &subdiv_ccg, const GridsNode &node, Vector< int > &faces)
 
Bounds< float3node_bounds (const Node &node)
 
void update_bounds (const Depsgraph &depsgraph, const Object &object, Tree &pbvh)
 
void update_bounds_mesh (Span< float3 > vert_positions, Tree &pbvh)
 
void update_bounds_grids (const CCGKey &key, Span< float3 > positions, Tree &pbvh)
 
void update_bounds_bmesh (const BMesh &bm, Tree &pbvh)
 
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_visibility (const Object &object, 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)
 
void flush_bounds_to_parents (Tree &pbvh)
 
static Bounds< float3negative_bounds ()
 
static Bounds< float3merge_bounds (const Bounds< float3 > &a, const Bounds< float3 > &b)
 
static int partition_along_axis (const Span< float3 > face_centers, MutableSpan< int > faces, const int axis, const float middle)
 
static int partition_material_indices (const Span< int > material_indices, MutableSpan< int > faces)
 
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 bool leaf_needs_material_split (const Span< int > faces, const Span< int > material_indices)
 
static void build_nodes_recursive_mesh (const Span< int > material_indices, const int leaf_limit, const int node_index, const std::optional< Bounds< float3 > > &bounds_precalc, const Span< float3 > face_centers, const int depth, MutableSpan< int > faces, Vector< MeshNode > &nodes)
 
Bounds< float3calc_face_bounds (const Span< float3 > vert_positions, const Span< int > face_verts)
 
static void build_nodes_recursive_grids (const Span< int > material_indices, const int leaf_limit, const int node_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, PBVHNodeFlags leaf_flag)
 
static Nodepbvh_iter_next_occluded (PBVHIter *iter)
 
static void node_tree_insert (node_tree *tree, node_tree *new_node)
 
static void traverse_tree (node_tree *tree, const FunctionRef< void(Node &node, float *tmin)> hit_fn, float *tmin)
 
static void free_tree (node_tree *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 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 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_normals (Object &object_orig, Object &object_eval, Tree &pbvh)
 
template<typename NodeT >
static BoundsMergeInfo merge_child_bounds (MutableSpan< NodeT > nodes, const BitSpan dirty, const int node_index)
 
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, 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 PBVHFrustumPlanes *frustum)
 
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 Vector< Node * > search_gather (Tree &pbvh, const FunctionRef< bool(Node &)> scb, PBVHNodeFlags 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, 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, 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 float co[3], const float no[3], 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, 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, BMeshNode *node, BMVert *v, const int count_max)
 
static std::optional< intpbvh_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 *q, BMFace *f)
 
static bool edge_queue_tri_in_circle (const EdgeQueue *q, BMFace *f)
 
static bool check_mask (EdgeQueueContext *eq_ctx, BMVert *v)
 
static void edge_queue_insert (EdgeQueueContext *eq_ctx, BMEdge *e, 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 (EdgeQueueContext *eq_ctx, BMEdge *e)
 
static void long_edge_queue_edge_add_recursive (EdgeQueueContext *eq_ctx, BMLoop *l_edge, BMLoop *l_end, const float len_sq, float limit_len)
 
static void short_edge_queue_edge_add (EdgeQueueContext *eq_ctx, BMEdge *e)
 
static void long_edge_queue_face_add (EdgeQueueContext *eq_ctx, BMFace *f)
 
static void short_edge_queue_face_add (EdgeQueueContext *eq_ctx, BMFace *f)
 
static void long_edge_queue_create (EdgeQueueContext *eq_ctx, const float max_edge_len, MutableSpan< BMeshNode > nodes, const float center[3], const float view_normal[3], float radius, const bool use_frontface, const bool use_projected)
 
static void short_edge_queue_create (EdgeQueueContext *eq_ctx, const float min_edge_len, MutableSpan< BMeshNode > nodes, const float center[3], const float view_normal[3], float radius, const bool use_frontface, const bool use_projected)
 
static void copy_edge_data (BMesh &bm, BMEdge &dst, BMEdge &src)
 
static void merge_edge_data (BMesh &bm, BMEdge &dst, const BMEdge &src)
 
static void pbvh_bmesh_split_edge (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 (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, BMFace *del_face, BMFace *flap_face, BMEdge *e, BMVert *v_del, 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, BMLoop *l_del, 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, GHash *deleted_verts, EdgeQueueContext *eq_ctx)
 
static bool pbvh_bmesh_collapse_short_edges (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, 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, FastNodeBuildInfo *node, int node_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 (BMFace *f)
 
static BMFacebm_face_exists_tri_from_loop_vert (BMLoop *l_radial_first, BMVert *v_opposite)
 
static BMVertbm_vert_hash_lookup_chain (GHash *deleted_verts, BMVert *v)
 

Variables

constexpr int leaf_limit = 400
 

Enumeration Type Documentation

◆ PlaneAABBIsect

Enumerator
ISECT_INSIDE 
ISECT_OUTSIDE 
ISECT_INTERSECT 

Definition at line 2310 of file pbvh.cc.

◆ Type

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

Definition at line 20 of file BKE_pbvh.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 2612 of file pbvh.cc.

References blender::index_mask::IndexMask::from_predicate(), blender::bke::pbvh::Tree::nodes_, and PBVH_Leaf.

Referenced by blender::ed::sculpt_paint::smooth::blur_geometry_data_array(), 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::cloth::cloth_sim_initialize_default_node_state(), blender::ed::sculpt_paint::do_brush_action(), 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::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::undo::restore_face_set_from_undo_step(), 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::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), vertex_color_set_exec(), and blender::ed::sculpt_paint::hide::visibility_invert_exec().

◆ bm_edges_from_tri()

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

Definition at line 124 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 ( BMFace * f)

Definition at line 133 of file pbvh_bmesh.cc.

References BLI_assert, BM_FACE_FIRST_LOOP, l, BMFace::len, BMLoop::next, result, and BMLoop::v.

Referenced by BKE_pbvh_bmesh_node_save_orig().

◆ bm_face_exists_tri_from_loop_vert()

static BMFace * blender::bke::pbvh::bm_face_exists_tri_from_loop_vert ( BMLoop * l_radial_first,
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 165 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()

static BMVert * blender::bke::pbvh::bm_vert_hash_lookup_chain ( GHash * 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 185 of file pbvh_bmesh.cc.

References BLI_ghash_lookup_p(), 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,
bool use_original )

◆ bmesh_normals_update()

void blender::bke::pbvh::bmesh_normals_update ( Tree & pbvh,
const IndexMask & nodes_to_update )

◆ bmesh_update_topology()

◆ bounds_get()

◆ build_mesh_leaf_nodes()

static 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()

static void blender::bke::pbvh::build_nodes_recursive_grids ( const Span< int > material_indices,
const int leaf_limit,
const int node_index,
const std::optional< Bounds< float3 > > & bounds_precalc,
const Span< float3 > face_centers,
const int depth,
MutableSpan< int > faces,
Vector< GridsNode > & nodes )
static

◆ build_nodes_recursive_mesh()

static void blender::bke::pbvh::build_nodes_recursive_mesh ( const Span< int > material_indices,
const int leaf_limit,
const int node_index,
const std::optional< Bounds< float3 > > & bounds_precalc,
const Span< float3 > face_centers,
const int depth,
MutableSpan< int > faces,
Vector< MeshNode > & nodes )
static

◆ build_pixels()

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

◆ calc_boundary_face_normals()

static 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

Definition at line 895 of file pbvh.cc.

References blender::Span< T >::index_range(), and blender::threading::parallel_for().

Referenced by update_normals_mesh().

◆ calc_boundary_vert_normals()

static 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 932 of file pbvh.cc.

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

◆ 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()

static 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()

static 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,
float * depth,
SubdivCCGCoord & r_active_vertex,
int & r_active_grid_index,
float3 & r_face_normal )
static

Definition at line 1889 of file pbvh.cc.

References copy_v3_v3(), len_squared_v3v3(), and normal_quad_v3().

Referenced by node_raycast_grids().

◆ calc_mesh_intersect_data()

static 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

Definition at line 1776 of file pbvh.cc.

References len_squared_v3v3(), and normal_tri_v3().

Referenced by node_raycast_mesh().

◆ calc_node_face_normals()

static 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

◆ calc_node_vert_normals()

static 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()

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

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

Definition at line 779 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 2013 of file pbvh.cc.

References add_v3_v3(), axis_dominant_v3_to_m3(), b, BKE_pbvh_node_get_original_BB(), 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, mid_v3_v3v3(), blender::Bounds< T >::min, min, minmax_v3v3_v3(), mul_m3_v3(), mul_v3_v3fl(), node_bounds(), sub_v3_v3v3(), and tree_is_empty().

Referenced by SCULPT_raycast_init().

◆ copy_edge_data()

static void blender::bke::pbvh::copy_edge_data ( BMesh & bm,
BMEdge & dst,
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 1144 of file pbvh_bmesh.cc.

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

Referenced by pbvh_bmesh_split_edge().

◆ copy_original_vert()

static 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_visibility,
Span< int > grid_indices,
int gridsize,
int display_gridsize )

Returns the number of visible quads in the nodes' grids.

Definition at line 1403 of file pbvh.cc.

References int, blender::bits::BitGroupVector< InlineBufferCapacity, Allocator >::is_empty(), paint_is_grid_face_hidden(), and blender::Span< T >::size().

Referenced by blender::draw::pbvh::create_tri_index_grids().

◆ dist_squared_ray_to_tri_v3_fast()

static 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

Definition at line 1699 of file pbvh.cc.

References copy_v3_v3(), dist_squared_ray_to_seg_v3(), FLT_MAX, and v2.

Referenced by ray_face_nearest_quad(), and ray_face_nearest_tri().

◆ edge_queue_insert()

◆ edge_queue_tri_in_circle()

◆ edge_queue_tri_in_sphere()

static bool blender::bke::pbvh::edge_queue_tri_in_sphere ( const EdgeQueue * q,
BMFace * f )
static

◆ face_normals_cache_eval()

◆ face_normals_cache_eval_for_write()

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

Definition at line 877 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()

static 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 1447 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()

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

Definition at line 605 of file pbvh.cc.

References BLI_assert, blender::bke::pbvh::Tree::nodes_, and tree_is_empty().

Referenced by clip_ray_ortho(), and pbvh_iter_begin().

◆ flush_bounds_to_parents()

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

Run the last step of the BVH bounds recalculation process, propagating updated leaf node bounds to their parent/ancestor inner nodes. This is meant to be used after leaf node bounds have been computed separately.

Definition at line 1132 of file pbvh.cc.

References blender::bke::pbvh::BoundsMergeInfo::bounds, blender::bke::pbvh::Tree::bounds_dirty_, blender::bits::BitVector< InlineBufferCapacity, Allocator >::clear_and_shrink(), merge_child_bounds(), and blender::bke::pbvh::Tree::nodes_.

Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_displacement_eraser_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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(), update_bounds_bmesh(), update_bounds_grids(), and update_bounds_mesh().

◆ free_tree()

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

Definition at line 749 of file pbvh.cc.

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

Referenced by free_tree(), and search_callback_occluded().

◆ get_frustum_planes()

void blender::bke::pbvh::get_frustum_planes ( const Tree & pbvh,
PBVHFrustumPlanes * planes )

◆ is_boundary_edge()

static 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 809 of file pbvh_bmesh.cc.

References BM_edge_is_manifold(), BM_ELEM_SEAM, and BM_ELEM_SMOOTH.

Referenced by is_boundary_vert(), and short_edge_queue_priority().

◆ is_boundary_vert()

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

Definition at line 827 of file pbvh_bmesh.cc.

References BM_DISK_EDGE_NEXT, and is_boundary_edge().

Referenced by is_edge_adjacent_to_boundary(), and pbvh_bmesh_collapse_edge().

◆ is_edge_adjacent_to_boundary()

static 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 844 of file pbvh_bmesh.cc.

References is_boundary_vert().

Referenced by short_edge_queue_priority().

◆ leaf_needs_material_split()

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

◆ long_edge_queue_create()

static void blender::bke::pbvh::long_edge_queue_create ( EdgeQueueContext * eq_ctx,
const float max_edge_len,
MutableSpan< BMeshNode > nodes,
const float center[3],
const float view_normal[3],
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()

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

◆ merge_bounds()

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

◆ merge_child_bounds()

template<typename NodeT >
static BoundsMergeInfo blender::bke::pbvh::merge_child_bounds ( MutableSpan< NodeT > nodes,
const BitSpan dirty,
const int node_index )
static

◆ merge_edge_data()

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

◆ merge_face_edge_data()

static void blender::bke::pbvh::merge_face_edge_data ( BMesh & bm,
BMFace * ,
BMFace * new_face,
BMVert * v_del,
BMLoop * l_del,
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 1521 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()

static void blender::bke::pbvh::merge_flap_edge_data ( BMesh & bm,
BMFace * del_face,
BMFace * flap_face,
BMEdge * e,
BMVert * v_del,
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 1370 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()

static 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 816 of file pbvh.cc.

References b.

Referenced by face_normals_cache_eval(), vert_normals_cache_eval(), vert_positions_eval(), and vert_positions_eval_for_write().

◆ nearest_to_ray_aabb_dist_sq()

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

Definition at line 2102 of file pbvh.cc.

References dist_squared_ray_to_aabb_v3().

Referenced by find_nearest_to_ray().

◆ negative_bounds() [1/2]

◆ negative_bounds() [2/2]

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

Definition at line 119 of file pbvh_bmesh.cc.

◆ node_bounds()

Bounds< float3 > blender::bke::pbvh::node_bounds ( const Node & node)

◆ node_face_indices_calc_grids()

Span< int > blender::bke::pbvh::node_face_indices_calc_grids ( const SubdivCCG & subdiv_ccg,
const GridsNode & node,
Vector< int > & faces )

Gather the indices of all base mesh faces in the node. For convenience, pass a reference to the data in the result.

Definition at line 1583 of file pbvh.cc.

References SubdivCCG::grid_to_face_map.

Referenced by blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step().

◆ node_pixels_free()

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

Definition at line 496 of file pbvh_pixels.cc.

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

◆ node_raycast_bmesh()

bool blender::bke::pbvh::node_raycast_bmesh ( BMeshNode & node,
const float3 & ray_start,
const float3 & ray_normal,
IsectRayPrecalc * isect_precalc,
float * depth,
bool use_original,
BMVert ** r_active_vertex,
float3 & r_face_normal )

◆ 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()

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

◆ node_update_mask_bmesh()

◆ node_update_mask_grids()

◆ node_update_mask_mesh()

◆ node_update_visibility_bmesh()

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

Definition at line 1358 of file pbvh.cc.

References PBVH_FullyHidden, and SET_FLAG_FROM_TEST.

Referenced by update_visibility_bmesh().

◆ node_update_visibility_grids()

◆ node_update_visibility_mesh()

void blender::bke::pbvh::node_update_visibility_mesh ( Span< bool > hide_vert,
MeshNode & node )

◆ 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()

static 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

Definition at line 884 of file pbvh.cc.

References blender::bke::mesh::face_normal_calc(), and blender::Span< T >::slice().

Referenced by calc_node_face_normals().

◆ normals_calc_verts_simple()

static 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 918 of file pbvh.cc.

References blender::math::normalize(), and verts.

Referenced by calc_node_vert_normals().

◆ partition_along_axis()

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

Definition at line 68 of file pbvh.cc.

Referenced by build_nodes_recursive_grids(), and build_nodes_recursive_mesh().

◆ partition_material_indices()

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

Definition at line 79 of file pbvh.cc.

Referenced by build_nodes_recursive_grids(), and build_nodes_recursive_mesh().

◆ pbvh_bmesh_collapse_edge()

static 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,
GHash * deleted_verts,
EdgeQueueContext * eq_ctx )
static

◆ pbvh_bmesh_collapse_short_edges()

◆ pbvh_bmesh_create_nodes_fast_recursive()

◆ pbvh_bmesh_edge_loops()

static Array< BMLoop * > blender::bke::pbvh::pbvh_bmesh_edge_loops ( BMEdge * e)
static

◆ pbvh_bmesh_face_create()

static 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,
int node_index,
const Span< BMVert * > v_tri,
const Span< BMEdge * > e_tri,
const BMFace * f_example )
static
Note
Callers are responsible for checking if the face exists before adding.

Definition at line 469 of file pbvh_bmesh.cc.

References BLI_assert, bm, BM_CREATE_NOP, BM_ELEM_CD_SET_INT, BM_face_create(), BM_face_exists(), BM_log_face_added(), blender::Span< T >::data(), BMFace::head, BMHeader::hflag, and PBVH_TopologyUpdated.

Referenced by pbvh_bmesh_collapse_edge(), and pbvh_bmesh_split_edge().

◆ pbvh_bmesh_face_remove()

◆ pbvh_bmesh_node_drop_orig()

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

Definition at line 670 of file pbvh_bmesh.cc.

Referenced by bmesh_update_topology().

◆ 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 416 of file pbvh_bmesh.cc.

References 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()

static 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,
int node_index )
static

◆ pbvh_bmesh_node_limit_ensure_fast()

static 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()

static void blender::bke::pbvh::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,
int node_index )
static

◆ pbvh_bmesh_node_vert_use_count_at_most()

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

◆ pbvh_bmesh_split_edge()

◆ pbvh_bmesh_subdivide_long_edges()

◆ pbvh_bmesh_vert_create()

static 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 float co[3],
const float no[3],
const int cd_vert_node_offset,
const int cd_vert_mask_offset )
static

◆ pbvh_bmesh_vert_other_node_find()

static 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 527 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()

static 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()

static 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 508 of file pbvh_pixels.cc.

References blender::bke::pbvh::Tree::pixels_.

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

◆ ray_aabb_intersect()

static bool blender::bke::pbvh::ray_aabb_intersect ( Node & node,
const RaycastData & rcd )
static

◆ 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 )

Definition at line 1657 of file pbvh.cc.

References isect_ray_tri_watertight_v3().

Referenced by node_raycast_grids().

◆ 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 )

Definition at line 1723 of file pbvh.cc.

References dist_squared_ray_to_tri_v3_fast().

Referenced by pbvh_grids_node_nearest_to_ray().

◆ 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]

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

◆ raycast_node_detail_bmesh()

bool blender::bke::pbvh::raycast_node_detail_bmesh ( BMeshNode & node,
const float3 & ray_start,
IsectRayPrecalc * isect_precalc,
float * depth,
float * r_edge_length )

◆ search_callback_occluded()

static void blender::bke::pbvh::search_callback_occluded ( Tree & pbvh,
const FunctionRef< bool(Node &)> scb,
const FunctionRef< void(Node &node, float *tmin)> hit_fn )
static

◆ search_gather()

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

Definition at line 2624 of file pbvh.cc.

References node, pbvh_iter_begin(), pbvh_iter_next(), and tree_is_empty().

Referenced by search_nodes().

◆ search_nodes()

◆ set_frustum_planes()

void blender::bke::pbvh::set_frustum_planes ( Tree & pbvh,
PBVHFrustumPlanes * planes )

◆ short_edge_queue_create()

static void blender::bke::pbvh::short_edge_queue_create ( EdgeQueueContext * eq_ctx,
const float min_edge_len,
MutableSpan< BMeshNode > nodes,
const float center[3],
const float view_normal[3],
float radius,
const bool use_frontface,
const bool use_projected )
static

◆ short_edge_queue_edge_add()

static void blender::bke::pbvh::short_edge_queue_edge_add ( EdgeQueueContext * eq_ctx,
BMEdge * e )
static

◆ short_edge_queue_face_add()

◆ short_edge_queue_priority()

static 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 1206 of file pbvh.cc.

References blender::threading::parallel_for().

Referenced by BKE_pbvh_vert_coords_apply(), blender::bke::pbvh::Tree::from_bmesh(), and blender::bke::pbvh::Tree::from_mesh().

◆ test_frustum_aabb()

◆ traverse_tree()

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

Definition at line 734 of file pbvh.cc.

References traverse_tree(), and tree.

Referenced by search_callback_occluded(), and traverse_tree().

◆ tree_is_empty()

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

◆ try_merge_flap_edge_data_before_dissolve()

static 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 1473 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_bounds()

void blender::bke::pbvh::update_bounds ( const Depsgraph & depsgraph,
const Object & object,
Tree & pbvh )

◆ update_bounds_bmesh()

◆ update_bounds_grids()

◆ update_bounds_mesh()

◆ 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 "fully masked" and "fully unmasked" values after mask values have been changed.

Definition at line 1230 of file pbvh.cc.

References blender::index_mask::IndexMask::foreach_index(), node_update_mask_mesh(), blender::bke::pbvh::Tree::nodes(), PBVH_FullyUnmasked, and blender::bke::Point.

◆ update_node_bounds_bmesh()

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

Definition at line 1095 of file pbvh.cc.

References blender::Bounds< T >::max, blender::Bounds< T >::min, blender::math::min_max(), and negative_bounds().

Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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 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 1084 of file pbvh.cc.

References blender::bke::ccg::grid_range(), blender::Bounds< T >::max, blender::Bounds< T >::min, blender::math::min_max(), and negative_bounds().

Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_displacement_eraser_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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 update_bounds_grids().

◆ update_node_bounds_mesh()

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

Definition at line 1075 of file pbvh.cc.

References blender::Bounds< T >::max, blender::Bounds< T >::min, blender::math::min_max(), and negative_bounds().

Referenced by blender::ed::sculpt_paint::boundary::do_bend_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::boundary::do_grab_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::boundary::do_inflate_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::do_snake_hook_brush(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::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::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 update_bounds_mesh().

◆ update_normals() [1/2]

◆ update_normals() [2/2]

◆ 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 1065 of file pbvh.cc.

References DEG_get_original_object(), and update_normals().

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()

◆ update_visibility()

◆ update_visibility_bmesh()

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

◆ update_visibility_faces()

static void blender::bke::pbvh::update_visibility_faces ( const Mesh & mesh,
const MutableSpan< MeshNode > nodes,
const IndexMask & node_mask )
static

◆ update_visibility_grids()

static void blender::bke::pbvh::update_visibility_grids ( const SubdivCCG & subdiv_ccg,
const MutableSpan< GridsNode > nodes,
const IndexMask & node_mask )
static

◆ vert_in_face_adjacent_to_edge()

static 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 1342 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()

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

Definition at line 846 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 the positions from vert_positions_eval. This may be a reference to the normals cache on the original mesh.

Definition at line 2502 of file pbvh.cc.

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

Referenced by blender::ed::sculpt_paint::calc_area_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_foces(), blender::ed::sculpt_paint::cloth::copy_normals_to_array(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_mask_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::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::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::offset_positions(), blender::ed::sculpt_paint::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::set_persistent_base_exec(), 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 2482 of file pbvh.cc.

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

Referenced by SculptSession::active_vert_position(), blender::ed::sculpt_paint::average_unmasked_position(), blender::ed::sculpt_paint::calc_area_center(), blender::ed::sculpt_paint::auto_mask::calc_blurred_cavity_mesh(), blender::ed::sculpt_paint::auto_mask::calc_face_factors(), 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_foces(), blender::ed::sculpt_paint::cloth::copy_positions_to_array(), blender::ed::sculpt_paint::boundary::data_init_mesh(), blender::ed::sculpt_paint::do_mask_brush(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), 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::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::pose::grow_pose_factor(), blender::ed::sculpt_paint::boundary::init_boundary_mesh(), blender::ed::sculpt_paint::paint_cursor_draw_3d_view_brush_cursor_inactive(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::sample_surface(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), SCULPT_cursor_geometry_info_update(), SCULPT_stroke_get_location_ex(), SCULPT_vertex_is_occluded(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), update_bounds(), blender::bke::pbvh::pixels::update_pixels(), vert_positions_eval(), vert_positions_eval_from_eval(), blender::ed::sculpt_paint::vert_positions_for_grab_active_get(), and vpaint_do_draw().

◆ vert_positions_eval() [2/2]

◆ 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 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 2496 of file pbvh.cc.

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

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

◆ vert_positions_eval_for_write() [2/2]

◆ vert_positions_eval_from_eval()

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

Variable Documentation

◆ 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 62 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().