34 for (
const int p : faces.index_range()) {
36 const float3 face_center = mesh::face_center_calc(positions, corner_verts.
slice(face));
37 for (
int l = 0;
l < face.size();
l++) {
38 const int loop_index = face[
l];
42 mdisps[loop_index].
level = 1;
44 int prev_loop_index =
l - 1 >= 0 ? loop_index - 1 : loop_index + face.size() - 1;
45 int next_loop_index =
l + 1 < face.size() ? loop_index + 1 : face.start();
47 const int vert = corner_verts[loop_index];
48 const int vert_next = corner_verts[next_loop_index];
49 const int vert_prev = corner_verts[prev_loop_index];
52 mid_v3_v3v3(disps[1], positions[vert], positions[vert_next]);
53 mid_v3_v3v3(disps[2], positions[vert], positions[vert_prev]);
62 Mesh *coarse_mesh =
static_cast<Mesh *
>(
object->data);
67 const int new_top_level = mmd->
totlvl + 1;
75 if (new_top_level == 1) {
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_get_layer_for_write(CustomData *data, eCustomDataType type, int totelem)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
void * CustomData_add_layer(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
void multires_force_sculpt_rebuild(Object *object)
void multires_set_tot_level(Object *ob, MultiresModifierData *mmd, int lvl)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
constexpr Span slice(int64_t start, int64_t size) const
draw_view in_light_buf[] float
void multires_reshape_context_free(MultiresReshapeContext *reshape_context)
void multires_reshape_ensure_grids(Mesh *mesh, int level)
bool multires_reshape_context_create_from_modifier(MultiresReshapeContext *reshape_context, Object *object, MultiresModifierData *mmd, int top_level)
void multires_reshape_object_grids_to_tangent_displacement(const MultiresReshapeContext *reshape_context)
static void multires_subdivide_create_object_space_linear_grids(Mesh *mesh)
void multires_subdivide_create_tangent_displacement_linear_grids(Object *object, MultiresModifierData *mmd)