|
Blender
V2.93
|
Go to the source code of this file.
Classes | |
| struct | ShrinkwrapBoundaryVertData |
| struct | ShrinkwrapBoundaryData |
| struct | ShrinkwrapTreeData |
Macros | |
| #define | NULL_ShrinkwrapCalcData |
| #define | NULL_BVHTreeFromMesh |
| #define | NULL_BVHTreeRayHit |
| #define | NULL_BVHTreeNearest |
Typedefs | |
| typedef struct ShrinkwrapBoundaryVertData | ShrinkwrapBoundaryVertData |
| typedef struct ShrinkwrapBoundaryData | ShrinkwrapBoundaryData |
| typedef struct ShrinkwrapTreeData | ShrinkwrapTreeData |
Functions | |
| void | BKE_shrinkwrap_discard_boundary_data (struct Mesh *mesh) |
| void | BKE_shrinkwrap_compute_boundary_data (struct Mesh *mesh) |
| bool | BKE_shrinkwrap_needs_normals (int shrinkType, int shrinkMode) |
| bool | BKE_shrinkwrap_init_tree (struct ShrinkwrapTreeData *data, Mesh *mesh, int shrinkType, int shrinkMode, bool force_normals) |
| void | BKE_shrinkwrap_free_tree (struct ShrinkwrapTreeData *data) |
| void | shrinkwrapModifier_deform (struct ShrinkwrapModifierData *smd, const struct ModifierEvalContext *ctx, struct Scene *scene, struct Object *ob, struct Mesh *mesh, struct MDeformVert *dvert, const int defgrp_index, float(*vertexCos)[3], int numVerts) |
| void | BKE_shrinkwrap_mesh_nearest_surface_deform (struct bContext *C, struct Object *ob_source, struct Object *ob_target) |
| void | BKE_shrinkwrap_remesh_target_project (struct Mesh *src_me, struct Mesh *target_me, struct Object *ob_target) |
| bool | BKE_shrinkwrap_project_normal (char options, const float vert[3], const float dir[3], const float ray_radius, const struct SpaceTransform *transf, struct ShrinkwrapTreeData *tree, BVHTreeRayHit *hit) |
| void | BKE_shrinkwrap_find_nearest_surface (struct ShrinkwrapTreeData *tree, struct BVHTreeNearest *nearest, float co[3], int type) |
| void | BKE_shrinkwrap_compute_smooth_normal (const struct ShrinkwrapTreeData *tree, const struct SpaceTransform *transform, int looptri_idx, const float hit_co[3], const float hit_no[3], float r_no[3]) |
| void | BKE_shrinkwrap_snap_point_to_surface (const struct ShrinkwrapTreeData *tree, const struct SpaceTransform *transform, int mode, int hit_idx, const float hit_co[3], const float hit_no[3], float goal_dist, const float point_co[3], float r_point_co[3]) |
| #define NULL_BVHTreeFromMesh |
Definition at line 178 of file BKE_shrinkwrap.h.
| #define NULL_BVHTreeNearest |
Definition at line 186 of file BKE_shrinkwrap.h.
| #define NULL_BVHTreeRayHit |
Definition at line 182 of file BKE_shrinkwrap.h.
| #define NULL_ShrinkwrapCalcData |
Definition at line 174 of file BKE_shrinkwrap.h.
| typedef struct ShrinkwrapBoundaryData ShrinkwrapBoundaryData |
| typedef struct ShrinkwrapBoundaryVertData ShrinkwrapBoundaryVertData |
| typedef struct ShrinkwrapTreeData ShrinkwrapTreeData |
| void BKE_shrinkwrap_compute_boundary_data | ( | struct Mesh * | mesh | ) |
Definition at line 341 of file shrinkwrap.c.
References BKE_shrinkwrap_discard_boundary_data(), mesh, Mesh::runtime, shrinkwrap_build_boundary_data(), and Mesh_Runtime::shrinkwrap_data.
Referenced by mesh_build_extra_data().
| void BKE_shrinkwrap_compute_smooth_normal | ( | const struct ShrinkwrapTreeData * | tree, |
| const struct SpaceTransform * | transform, | ||
| int | looptri_idx, | ||
| const float | hit_co[3], | ||
| const float | hit_no[3], | ||
| float | r_no[3] | ||
| ) |
Compute a smooth normal of the target (if applicable) at the hit location.
| tree | information about the mesh |
| transform | transform from the hit coordinate space to the object space; may be null |
| r_no | output in hit coordinate space; may be shared with inputs |
Definition at line 1206 of file shrinkwrap.c.
References BLI_space_transform_apply(), BLI_space_transform_invert_normal(), copy_v3_v3(), interp_v3_v3v3v3(), interp_weights_tri_v3(), BVHTreeFromMesh::loop, BVHTreeFromMesh::looptri, ME_SMOOTH, normal_short_to_float_v3(), normalize_v3(), NULL, MLoopTri::poly, transform(), tree, MLoopTri::tri, MLoop::v, BVHTreeFromMesh::vert, verts, and w().
Referenced by BKE_shrinkwrap_snap_point_to_surface(), and shrinkwrap_get_tarmat().
| void BKE_shrinkwrap_discard_boundary_data | ( | struct Mesh * | mesh | ) |
Definition at line 170 of file shrinkwrap.c.
References data, MEM_freeN, mesh, NULL, Mesh::runtime, and Mesh_Runtime::shrinkwrap_data.
Referenced by BKE_mesh_runtime_clear_geometry(), and BKE_shrinkwrap_compute_boundary_data().
| void BKE_shrinkwrap_find_nearest_surface | ( | struct ShrinkwrapTreeData * | tree, |
| struct BVHTreeNearest * | nearest, | ||
| float | co[3], | ||
| int | type | ||
| ) |
Definition at line 1095 of file shrinkwrap.c.
References BLI_bvhtree_find_nearest(), BLI_bvhtree_find_nearest_ex(), BVH_NEAREST_OPTIMAL_ORDER, BVHTreeNearest::dist_sq, BVHTreeNearest::index, mesh_looptri_target_project(), MOD_SHRINKWRAP_TARGET_PROJECT, BVHTreeFromMesh::nearest_callback, tree, and type.
Referenced by shrinkwrap_calc_nearest_surface_point_cb_ex(), and shrinkwrap_get_tarmat().
| void BKE_shrinkwrap_free_tree | ( | struct ShrinkwrapTreeData * | data | ) |
Definition at line 164 of file shrinkwrap.c.
References data, and free_bvhtree_from_mesh().
Referenced by BKE_shrinkwrap_remesh_target_project(), shrinkwrap_calc_normal_projection(), shrinkwrap_get_tarmat(), and shrinkwrapModifier_deform().
| bool BKE_shrinkwrap_init_tree | ( | struct ShrinkwrapTreeData * | data, |
| Mesh * | mesh, | ||
| int | shrinkType, | ||
| int | shrinkMode, | ||
| bool | force_normals | ||
| ) |
Definition at line 113 of file shrinkwrap.c.
References BKE_bvhtree_from_mesh_get(), BKE_mesh_wrapper_ensure_mdata(), BKE_shrinkwrap_needs_normals(), BVHTREE_FROM_LOOPTRI, BVHTREE_FROM_VERTS, CD_NORMAL, CustomData_get_layer(), data, Mesh::flag, Mesh::ldata, ME_AUTOSMOOTH, mesh, MOD_SHRINKWRAP_NEAREST_VERTEX, MOD_SHRINKWRAP_TARGET_PROJECT, NULL, Mesh::runtime, Mesh_Runtime::shrinkwrap_data, Mesh::totpoly, and Mesh::totvert.
Referenced by BKE_shrinkwrap_remesh_target_project(), shrinkwrap_calc_normal_projection(), shrinkwrap_get_tarmat(), and shrinkwrapModifier_deform().
| void BKE_shrinkwrap_mesh_nearest_surface_deform | ( | struct bContext * | C, |
| struct Object * | ob_source, | ||
| struct Object * | ob_target | ||
| ) |
Definition at line 1516 of file shrinkwrap.c.
References BKE_mesh_vert_coords_alloc(), BKE_mesh_vert_coords_apply(), C, CTX_data_depsgraph_pointer(), CTX_data_scene(), Object::data, depsgraph, float(), ShrinkwrapModifierData::keepDist, MEM_freeN, MOD_SHRINKWRAP_NEAREST_SURFACE, MOD_SHRINKWRAP_ON_SURFACE, NULL, ShrinkwrapModifierData::shrinkMode, ShrinkwrapModifierData::shrinkType, shrinkwrapModifier_deform(), and ShrinkwrapModifierData::target.
Referenced by geometry_extract_apply().
| bool BKE_shrinkwrap_needs_normals | ( | int | shrinkType, |
| int | shrinkMode | ||
| ) |
Definition at line 105 of file shrinkwrap.c.
References MOD_SHRINKWRAP_ABOVE_SURFACE, MOD_SHRINKWRAP_NEAREST_VERTEX, and MOD_SHRINKWRAP_TARGET_PROJECT.
Referenced by BKE_shrinkwrap_init_tree(), blender::deg::DepsgraphRelationBuilder::build_constraints(), and updateDepsgraph().
| bool BKE_shrinkwrap_project_normal | ( | char | options, |
| const float | vert[3], | ||
| const float | dir[3], | ||
| const float | ray_radius, | ||
| const struct SpaceTransform * | transf, | ||
| struct ShrinkwrapTreeData * | tree, | ||
| BVHTreeRayHit * | hit | ||
| ) |
Referenced by shrinkwrap_get_tarmat().
| void BKE_shrinkwrap_remesh_target_project | ( | struct Mesh * | src_me, |
| struct Mesh * | target_me, | ||
| struct Object * | ob_target | ||
| ) |
Definition at line 1541 of file shrinkwrap.c.
References BKE_mesh_vert_coords_alloc(), BKE_mesh_vert_coords_apply(), BKE_shrinkwrap_free_tree(), BKE_shrinkwrap_init_tree(), BLI_SPACE_TRANSFORM_SETUP, float(), ShrinkwrapCalcData::keepDist, ShrinkwrapModifierData::keepDist, ShrinkwrapCalcData::local2target, MEM_freeN, MOD_SHRINKWRAP_ON_SURFACE, MOD_SHRINKWRAP_PROJECT, MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR, MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR, Mesh::mvert, NULL_ShrinkwrapCalcData, ShrinkwrapCalcData::numVerts, ShrinkwrapModifierData::projLimit, Mesh::remesh_voxel_size, ShrinkwrapModifierData::shrinkMode, ShrinkwrapModifierData::shrinkOpts, ShrinkwrapModifierData::shrinkType, shrinkwrap_calc_normal_projection(), ShrinkwrapCalcData::smd, ShrinkwrapCalcData::target, ShrinkwrapModifierData::target, TIMEIT_BENCH, Mesh::totvert, ShrinkwrapCalcData::tree, tree, ShrinkwrapCalcData::vert, ShrinkwrapCalcData::vertexCos, and ShrinkwrapCalcData::vgroup.
Referenced by voxel_remesh_exec().
| void BKE_shrinkwrap_snap_point_to_surface | ( | const struct ShrinkwrapTreeData * | tree, |
| const struct SpaceTransform * | transform, | ||
| int | mode, | ||
| int | hit_idx, | ||
| const float | hit_co[3], | ||
| const float | hit_no[3], | ||
| float | goal_dist, | ||
| const float | point_co[3], | ||
| float | r_point_co[3] | ||
| ) |
Apply the shrink to surface modes to the given original coordinates and nearest point.
| tree | mesh data for smooth normals |
| transform | transform from the hit coordinate space to the object space; may be null |
| r_point_co | may be the same memory location as point_co, hit_co, or hit_no. |
Definition at line 1328 of file shrinkwrap.c.
References BKE_shrinkwrap_compute_smooth_normal(), copy_v3_v3(), madd_v3_v3v3fl(), MOD_SHRINKWRAP_ABOVE_SURFACE, MOD_SHRINKWRAP_INSIDE, MOD_SHRINKWRAP_ON_SURFACE, MOD_SHRINKWRAP_OUTSIDE, MOD_SHRINKWRAP_OUTSIDE_SURFACE, shrinkwrap_snap_with_side(), transform(), and tree.
Referenced by shrinkwrap_calc_nearest_surface_point_cb_ex(), shrinkwrap_calc_normal_projection_cb_ex(), and shrinkwrap_get_tarmat().
| void shrinkwrapModifier_deform | ( | struct ShrinkwrapModifierData * | smd, |
| const struct ModifierEvalContext * | ctx, | ||
| struct Scene * | scene, | ||
| struct Object * | ob, | ||
| struct Mesh * | mesh, | ||
| struct MDeformVert * | dvert, | ||
| const int | defgrp_index, | ||
| float(*) | vertexCos[3], | ||
| int | numVerts | ||
| ) |
Referenced by deformVerts(), and deformVertsEM().