116 const struct MPoly *mpoly,
117 const struct MLoop *mloop,
134 unsigned int **grid_hidden);
142 int cd_vert_node_offset,
143 int cd_face_node_offset);
172 const float ray_start[3],
173 const float ray_normal[3],
180 const float ray_start[3],
181 const float ray_normal[3],
184 int *active_vertex_index,
185 int *active_face_grid_index,
189 const float ray_start[3],
192 float *r_edge_length);
199 PBVH *pbvh,
bool original,
float ray_start[3],
float ray_end[3],
float ray_normal[3]);
204 const float ray_start[3],
205 const float ray_normal[3],
212 const float ray_start[3],
213 const float ray_normal[3],
220 bool update_only_visible,
256 const int *grid_indices,
288 const float view_normal[3],
323 const int **r_vert_indices,
324 struct MVert **r_verts);
327 const int **r_loop_indices,
328 const struct MLoop **r_loops);
368 unsigned int **grid_hidden);
390 #define PBVH_ITER_ALL 0
391 #define PBVH_ITER_UNIQUE 1
439 #define BKE_pbvh_vertex_iter_begin(pbvh, node, vi, mode) \
440 pbvh_vertex_iter_init(pbvh, node, &vi, mode); \
442 for (vi.i = 0, vi.g = 0; vi.g < vi.totgrid; vi.g++) { \
444 vi.width = vi.gridsize; \
445 vi.height = vi.gridsize; \
446 vi.index = vi.grid_indices[vi.g] * vi.key.grid_area - 1; \
447 vi.grid = vi.grids[vi.grid_indices[vi.g]]; \
448 if (mode == PBVH_ITER_UNIQUE) { \
449 vi.gh = vi.grid_hidden[vi.grid_indices[vi.g]]; \
453 vi.width = vi.totvert; \
457 for (vi.gy = 0; vi.gy < vi.height; vi.gy++) { \
458 for (vi.gx = 0; vi.gx < vi.width; vi.gx++, vi.i++) { \
460 vi.co = CCG_elem_co(&vi.key, vi.grid); \
461 vi.fno = CCG_elem_no(&vi.key, vi.grid); \
462 vi.mask = vi.key.has_mask ? CCG_elem_mask(&vi.key, vi.grid) : NULL; \
463 vi.grid = CCG_elem_next(&vi.key, vi.grid); \
467 if (BLI_BITMAP_TEST(vi.gh, vi.gy * vi.gridsize + vi.gx)) { \
472 else if (vi.mverts) { \
473 vi.mvert = &vi.mverts[vi.vert_indices[vi.gx]]; \
474 if (vi.respect_hide) { \
475 vi.visible = !(vi.mvert->flag & ME_HIDE); \
476 if (mode == PBVH_ITER_UNIQUE && !vi.visible) { \
481 BLI_assert(vi.visible); \
483 vi.co = vi.mvert->co; \
484 vi.no = vi.vert_normals[vi.vert_indices[vi.gx]]; \
485 vi.index = vi.vert_indices[vi.i]; \
487 vi.mask = &vi.vmask[vi.index]; \
491 if (!BLI_gsetIterator_done(&vi.bm_unique_verts)) { \
492 vi.bm_vert = (BMVert *)BLI_gsetIterator_getKey(&vi.bm_unique_verts); \
493 BLI_gsetIterator_step(&vi.bm_unique_verts); \
496 vi.bm_vert = (BMVert *)BLI_gsetIterator_getKey(&vi.bm_other_verts); \
497 BLI_gsetIterator_step(&vi.bm_other_verts); \
499 vi.visible = !BM_elem_flag_test_bool(vi.bm_vert, BM_ELEM_HIDDEN); \
500 if (mode == PBVH_ITER_UNIQUE && !vi.visible) { \
503 vi.co = vi.bm_vert->co; \
504 vi.fno = vi.bm_vert->no; \
505 vi.index = BM_elem_index_get(vi.bm_vert); \
506 vi.mask = (float *)BM_ELEM_CD_GET_VOID_P(vi.bm_vert, vi.cd_vert_mask_offset); \
509 #define BKE_pbvh_vertex_iter_end \
520 int (**r_orco_tris)[3],
521 int *r_orco_tris_num,
522 float (**r_orco_coords)[3]);
559 const int indices_num,
566 const int indices_num,
572 const int indices_num,
typedef float(TangentPoint)[2]
Generic geometry attributes built on CustomData.
bool BKE_pbvh_node_fully_masked_get(PBVHNode *node)
void BKE_pbvh_build_grids(PBVH *pbvh, struct CCGElem **grids, int totgrid, struct CCGKey *key, void **gridfaces, struct DMFlagMat *flagmats, unsigned int **grid_hidden)
int BKE_pbvh_get_grid_num_faces(const PBVH *pbvh)
void BKE_pbvh_node_free_proxies(PBVHNode *node)
void BKE_pbvh_set_frustum_planes(PBVH *pbvh, PBVHFrustumPlanes *planes)
void BKE_pbvh_node_mark_update(PBVHNode *node)
BLI_bitmap ** BKE_pbvh_get_grid_visibility(const PBVH *pbvh)
void BKE_pbvh_node_get_bm_orco_data(PBVHNode *node, int(**r_orco_tris)[3], int *r_orco_tris_num, float(**r_orco_coords)[3])
void BKE_pbvh_sync_face_sets_to_grids(PBVH *pbvh)
void BKE_pbvh_node_get_verts(PBVH *pbvh, PBVHNode *node, const int **r_vert_indices, struct MVert **r_verts)
void BKE_pbvh_node_fully_masked_set(PBVHNode *node, int fully_masked)
void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max[3])
void BKE_pbvh_is_drawing_set(PBVH *pbvh, bool val)
void BKE_pbvh_build_mesh(PBVH *pbvh, struct Mesh *mesh, const struct MPoly *mpoly, const struct MLoop *mloop, struct MVert *verts, int totvert, struct CustomData *vdata, struct CustomData *ldata, struct CustomData *pdata, const struct MLoopTri *looptri, int looptri_num)
void BKE_pbvh_node_mark_update_visibility(PBVHNode *node)
struct CCGElem ** BKE_pbvh_get_grids(const PBVH *pbvh)
void BKE_pbvh_node_mark_update_color(PBVHNode *node)
void BKE_pbvh_get_frustum_planes(PBVH *pbvh, PBVHFrustumPlanes *planes)
void BKE_pbvh_raycast_project_ray_root(PBVH *pbvh, bool original, float ray_start[3], float ray_end[3], float ray_normal[3])
void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot)
void BKE_pbvh_update_active_vcol(PBVH *pbvh, const struct Mesh *mesh)
void BKE_pbvh_redraw_BB(PBVH *pbvh, float bb_min[3], float bb_max[3])
void BKE_pbvh_node_num_verts(PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert)
bool BKE_pbvh_node_frustum_contain_AABB(PBVHNode *node, void *frustum)
void BKE_pbvh_find_nearest_to_ray(PBVH *pbvh, BKE_pbvh_HitOccludedCallback cb, void *data, const float ray_start[3], const float ray_normal[3], bool original)
void BKE_pbvh_bmesh_node_save_orig(struct BMesh *bm, PBVHNode *node)
void BKE_pbvh_node_fully_unmasked_set(PBVHNode *node, int fully_masked)
void BKE_pbvh_draw_debug_cb(PBVH *pbvh, void(*draw_fn)(void *user_data, const float bmin[3], const float bmax[3], PBVHNodeFlags flag), void *user_data)
void BKE_pbvh_pmap_set(PBVH *pbvh, const struct MeshElemMap *pmap)
void BKE_pbvh_swap_colors(PBVH *pbvh, const int *indices, const int indices_num, float(*colors)[4])
void BKE_pbvh_update_visibility(PBVH *pbvh)
void BKE_pbvh_store_colors_vertex(PBVH *pbvh, const int *indices, const int indices_num, float(*colors)[4])
void BKE_pbvh_get_grid_updates(PBVH *pbvh, bool clear, void ***r_gridfaces, int *r_totface)
void pbvh_show_mask_set(PBVH *pbvh, bool show_mask)
float(* BKE_pbvh_vert_coords_alloc(struct PBVH *pbvh))[3]
struct PBVHPixelsNode PBVHPixelsNode
void BKE_pbvh_free(PBVH *pbvh)
bool BKE_pbvh_is_deformed(struct PBVH *pbvh)
void BKE_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3])
void BKE_pbvh_node_color_buffer_free(PBVH *pbvh)
PBVHType BKE_pbvh_type(const PBVH *pbvh)
void pbvh_show_face_sets_set(PBVH *pbvh, bool show_face_sets)
float BKE_pbvh_node_get_tmin(PBVHNode *node)
bool BKE_pbvh_is_drawing(const PBVH *pbvh)
void BKE_pbvh_subdiv_cgg_set(PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
void BKE_pbvh_store_colors(PBVH *pbvh, const int *indices, const int indices_num, float(*colors)[4])
void BKE_pbvh_mark_rebuild_pixels(PBVH *pbvh)
bool BKE_pbvh_node_frustum_exclude_AABB(PBVHNode *node, void *frustum)
bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh, PBVHTopologyUpdateMode mode, const float center[3], const float view_normal[3], float radius, bool use_frontface, bool use_projected)
bool BKE_pbvh_node_has_vert_with_normal_update_tag(PBVH *pbvh, PBVHNode *node)
void(* BKE_pbvh_HitCallback)(PBVHNode *node, void *data)
void BKE_pbvh_build_bmesh(PBVH *pbvh, struct BMesh *bm, bool smooth_shading, struct BMLog *log, int cd_vert_node_offset, int cd_face_node_offset)
struct BMesh * BKE_pbvh_get_bmesh(PBVH *pbvh)
void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node)
bool BKE_pbvh_node_raycast(PBVH *pbvh, PBVHNode *node, float(*origco)[3], bool use_origco, const float ray_start[3], const float ray_normal[3], struct IsectRayPrecalc *isect_precalc, float *depth, int *active_vertex_index, int *active_face_grid_index, float *face_normal)
void BKE_pbvh_node_mark_normals_update(PBVHNode *node)
void BKE_pbvh_vert_coords_apply(struct PBVH *pbvh, const float(*vertCos)[3], int totvert)
void BKE_pbvh_face_sets_color_set(PBVH *pbvh, int seed, int color_default)
void BKE_pbvh_raycast(PBVH *pbvh, BKE_pbvh_HitOccludedCallback cb, void *data, const float ray_start[3], const float ray_normal[3], bool original)
void BKE_pbvh_node_get_loops(PBVH *pbvh, PBVHNode *node, const int **r_loop_indices, const struct MLoop **r_loops)
void BKE_pbvh_vert_tag_update_normal(PBVH *pbvh, int index)
const float(* BKE_pbvh_get_vert_normals(const PBVH *pbvh))[3]
int BKE_pbvh_get_grid_num_vertices(const PBVH *pbvh)
int BKE_pbvh_count_grid_quads(BLI_bitmap **grid_hidden, const int *grid_indices, int totgrid, int gridsize)
bool BKE_pbvh_bmesh_node_raycast_detail(PBVHNode *node, const float ray_start[3], struct IsectRayPrecalc *isect_precalc, float *depth, float *r_edge_length)
bool pbvh_has_mask(const PBVH *pbvh)
void BKE_pbvh_update_normals(PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
const struct CCGKey * BKE_pbvh_get_grid_key(const PBVH *pbvh)
struct GSet * BKE_pbvh_bmesh_node_other_verts(PBVHNode *node)
void BKE_pbvh_build_pixels(PBVH *pbvh, struct Mesh *mesh, struct Image *image, struct ImageUser *image_user)
bool BKE_pbvh_node_find_nearest_to_ray(PBVH *pbvh, PBVHNode *node, float(*origco)[3], bool use_origco, const float ray_start[3], const float ray_normal[3], float *depth, float *dist_sq)
struct GSet * BKE_pbvh_bmesh_node_faces(PBVHNode *node)
void BKE_pbvh_ensure_node_loops(PBVH *pbvh)
struct PBVHFrustumPlanes PBVHFrustumPlanes
void BKE_pbvh_draw_cb(PBVH *pbvh, bool update_only_visible, PBVHFrustumPlanes *update_frustum, PBVHFrustumPlanes *draw_frustum, void(*draw_fn)(void *user_data, struct GPU_PBVH_Buffers *buffers), void *user_data, bool full_render)
PBVHProxyNode * BKE_pbvh_node_add_proxy(PBVH *pbvh, PBVHNode *node)
PBVH * BKE_pbvh_new(void)
bool BKE_pbvh_has_faces(const PBVH *pbvh)
void BKE_pbvh_node_get_grids(PBVH *pbvh, PBVHNode *node, int **grid_indices, int *totgrid, int *maxgrid, int *gridsize, struct CCGElem ***r_griddata)
void BKE_pbvh_vertex_color_set(PBVH *pbvh, int vertex, const float color[4])
bool BKE_pbvh_node_fully_hidden_get(PBVHNode *node)
void BKE_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden)
void(* BKE_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float *tmin)
void BKE_pbvh_parallel_range_settings(struct TaskParallelSettings *settings, bool use_threading, int totnode)
struct MVert * BKE_pbvh_get_verts(const PBVH *pbvh)
void BKE_pbvh_node_num_loops(PBVH *pbvh, PBVHNode *node, int *r_totloop)
PBVHColorBufferNode * BKE_pbvh_node_color_buffer_get(PBVHNode *node)
struct GSet * BKE_pbvh_bmesh_node_unique_verts(PBVHNode *node)
void BKE_pbvh_update_vertex_data(PBVH *pbvh, int flags)
void BKE_pbvh_bmesh_after_stroke(PBVH *pbvh)
void BKE_pbvh_vertex_color_get(const PBVH *pbvh, int vertex, float r_color[4])
void BKE_pbvh_respect_hide_set(PBVH *pbvh, bool respect_hide)
void BKE_pbvh_node_mark_update_mask(PBVHNode *node)
bool BKE_pbvh_node_fully_unmasked_get(PBVHNode *node)
void BKE_pbvh_update_bounds(PBVH *pbvh, int flags)
void BKE_pbvh_bounding_box(const PBVH *pbvh, float min[3], float max[3])
void BKE_pbvh_search_callback(PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, BKE_pbvh_HitCallback hcb, void *hit_data)
bool BKE_pbvh_draw_cache_invalid(const PBVH *pbvh)
void BKE_pbvh_node_mark_redraw(PBVHNode *node)
void(* BKE_pbvh_SearchNearestCallback)(PBVHNode *node, void *data, float *tmin)
void BKE_pbvh_grids_update(PBVH *pbvh, struct CCGElem **grids, void **gridfaces, struct DMFlagMat *flagmats, unsigned int **grid_hidden)
unsigned int ** BKE_pbvh_grid_hidden(const PBVH *pbvh)
struct PBVHVertexIter PBVHVertexIter
void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int mode)
void BKE_pbvh_bmesh_detail_size_set(PBVH *pbvh, float detail_size)
void BKE_pbvh_face_sets_set(PBVH *pbvh, int *face_sets)
void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count)
void BKE_pbvh_node_mark_topology_update(PBVHNode *node)
void BKE_pbvh_search_gather(PBVH *pbvh, BKE_pbvh_SearchCallback scb, void *search_data, PBVHNode ***array, int *tot)
@ PBVH_RebuildDrawBuffers
bool BKE_pbvh_get_color_layer(const struct Mesh *me, CustomDataLayer **r_layer, eAttrDomain *r_attr)
bool(* BKE_pbvh_SearchCallback)(PBVHNode *node, void *data)
bool pbvh_has_face_sets(PBVH *pbvh)
NSNotificationCenter * center
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT BMesh * bm
static unsigned long seed
SyclQueue void void size_t num_bytes void
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
ccl_gpu_kernel_postfix int ccl_global int * indices
ccl_device_inline float3 log(float3 v)
static void clear(Message *msg)
BLI_bitmap ** grid_hidden
struct GSetIterator bm_other_verts
struct GSetIterator bm_unique_verts
struct CustomData * bm_vdata