Blender V5.0
multires_reshape_apply_base.cc File Reference
#include "multires_reshape.hh"
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "BLI_math_matrix.hh"
#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 blender::float3 &v, const blender::float3 &center, const blender::float3 &no)
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 139 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 145 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 MultiresReshapeContext::base_corner_verts, MultiresReshapeContext::base_mesh, MultiresReshapeContext::base_positions, D, ReshapeConstGridElement::displacement, GridCoord::grid_index, blender::Span< T >::index_range(), multires_reshape_evaluate_base_mesh_limit_at_grid(), multires_reshape_orig_grid_element_for_grid_coord(), P, blender::math::transform_direction(), GridCoord::u, and GridCoord::v.

Referenced by multiresModifier_base_apply().

◆ v3_dist_from_plane()

float v3_dist_from_plane ( const blender::float3 & v,
const blender::float3 & center,
const blender::float3 & no )
static

Definition at line 57 of file multires_reshape_apply_base.cc.

References blender::math::dot(), and v.

Referenced by multires_reshape_apply_base_refit_base_mesh().