35 for (
const int loop_index : corner_verts.
index_range()) {
45 reshape_context, &grid_coord,
P, tangent_matrix);
48 reshape_context, &grid_coord);
51 base_positions[corner_verts[loop_index]] =
P +
D;
76 for (
int i = 0; i < base_mesh->
verts_num; i++) {
77 origco[i] = base_positions[i];
80 for (
int i = 0; i < base_mesh->
verts_num; i++) {
85 if (vert_to_face_map[i].is_empty()) {
91 for (
const int face : vert_to_face_map[i]) {
93 for (
const int corner : reshape_context->
base_faces[face]) {
96 center += origco[vndx];
104 for (
int j = 0; j < vert_to_face_map[i].
size(); j++) {
111 for (
int k = 0; k < face.
size(); k++) {
120 fake_co[k] = origco[vndx];
131 const float3 push = avg_no * dist;
132 base_positions[i] += push;
138 base_mesh->tag_positions_changed();
147 base_positions.
size());
148 basis_key_data.
copy_from(base_positions);
159 Depsgraph *depsgraph = reshape_context->
depsgraph;
167 depsgraph,
object, mmd);
Read Blender memory allocation and freeing.
constexpr int64_t size() const
constexpr int64_t size() const
constexpr void copy_from(Span< T > values) const
constexpr IndexRange index_range() const
float3 face_normal_calc(Span< float3 > vert_positions, Span< int > face_verts)
bool eval_refine_from_mesh(Subdiv *subdiv, const Mesh *mesh, Span< float3 > coarse_vert_positions)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void multires_reshape_apply_base_update_mesh_coords(MultiresReshapeContext *reshape_context)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)
void multires_reshape_apply_base_refit_base_mesh(MultiresReshapeContext *reshape_context)
ATTR_WARN_UNUSED_RESULT const BMVert * v
Array< float3 > BKE_multires_create_deformed_base_mesh_vert_coords(Depsgraph *depsgraph, Object *object, MultiresModifierData *mmd)
void multires_reshape_apply_base_refine_from_base(MultiresReshapeContext *reshape_context)
void multires_reshape_apply_base_update_shape_key(MultiresReshapeContext *reshape_context)
MatBase< float, 3, 3 > float3x3
void multires_reshape_apply_base_refine_from_deform(MultiresReshapeContext *reshape_context)
ReshapeConstGridElement multires_reshape_orig_grid_element_for_grid_coord(const MultiresReshapeContext *reshape_context, const GridCoord *grid_coord)
static float v3_dist_from_plane(const float3 &v, const float3 ¢er, const float3 &no)
void multires_reshape_evaluate_base_mesh_limit_at_grid(const MultiresReshapeContext *reshape_context, const GridCoord *grid_coord, float3 &r_P, float3x3 &r_tangent_matrix)
VecBase< float, 3 > float3
struct blender::MultiresReshapeContext::@061205041363017306277142220221215107241001341347 orig
MultiresModifierData * mmd
bke::subdiv::Subdiv * subdiv
Span< float3 > base_positions
struct KeyBlock * basis_shape_key
OffsetIndices< int > base_faces
Span< int > base_corner_verts