Blender V4.3
multires_reshape_apply_base.cc File Reference
#include "multires_reshape.hh"
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BKE_mesh.hh"
#include "BKE_multires.hh"
#include "BKE_subdiv_eval.hh"

Go to the source code of this file.

Functions

void multires_reshape_apply_base_update_mesh_coords (MultiresReshapeContext *reshape_context)
 
static float v3_dist_from_plane (const float v[3], const float center[3], const float no[3])
 
void multires_reshape_apply_base_refit_base_mesh (MultiresReshapeContext *reshape_context)
 
void multires_reshape_apply_base_refine_from_base (MultiresReshapeContext *reshape_context)
 
void multires_reshape_apply_base_refine_from_deform (MultiresReshapeContext *reshape_context)
 

Function Documentation

◆ multires_reshape_apply_base_refine_from_base()

void multires_reshape_apply_base_refine_from_base ( MultiresReshapeContext * reshape_context)

Refine subdivision surface to the new positions of the base mesh.

Definition at line 136 of file multires_reshape_apply_base.cc.

References MultiresReshapeContext::base_mesh, blender::bke::subdiv::eval_refine_from_mesh(), and MultiresReshapeContext::subdiv.

Referenced by multiresModifier_base_apply().

◆ multires_reshape_apply_base_refine_from_deform()

void multires_reshape_apply_base_refine_from_deform ( MultiresReshapeContext * reshape_context)

Refine subdivision surface to the new positions of the deformed mesh (base mesh with all modifiers leading the multi-res applied).

Note
Will re-evaluate all leading modifiers, so it's not cheap.

Definition at line 142 of file multires_reshape_apply_base.cc.

References MultiresReshapeContext::base_mesh, BKE_multires_create_deformed_base_mesh_vert_coords(), BLI_assert, depsgraph, MultiresReshapeContext::depsgraph, blender::bke::subdiv::eval_refine_from_mesh(), MultiresReshapeContext::mmd, MultiresReshapeContext::object, and MultiresReshapeContext::subdiv.

Referenced by multiresModifier_base_apply().

◆ multires_reshape_apply_base_refit_base_mesh()

◆ multires_reshape_apply_base_update_mesh_coords()

void multires_reshape_apply_base_update_mesh_coords ( MultiresReshapeContext * reshape_context)

Update mesh coordinates to the final positions of displacement in object space. This is effectively desired position of base mesh vertices after canceling out displacement.

Note
Expects that mesh's CD_MDISPS has been set to object space positions.

Definition at line 22 of file multires_reshape_apply_base.cc.

References add_v3_v3v3(), MultiresReshapeContext::base_corner_verts, MultiresReshapeContext::base_mesh, MultiresReshapeContext::base_positions, ReshapeConstGridElement::displacement, GridCoord::grid_index, blender::Span< T >::index_range(), mul_v3_m3v3(), multires_reshape_evaluate_limit_at_grid(), multires_reshape_orig_grid_element_for_grid_coord(), P, GridCoord::u, and GridCoord::v.

Referenced by multiresModifier_base_apply().

◆ v3_dist_from_plane()

static float v3_dist_from_plane ( const float v[3],
const float center[3],
const float no[3] )
static

Definition at line 52 of file multires_reshape_apply_base.cc.

References dot_v3v3(), sub_v3_v3v3(), and v.

Referenced by multires_reshape_apply_base_refit_base_mesh().