Blender V4.3
MOD_correctivesmooth.cc File Reference
#include "BLI_math_base.hh"
#include "BLI_math_matrix.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DNA_defaults.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
#include "BKE_deform.hh"
#include "BKE_editmesh.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"
#include "MOD_modifiertypes.hh"
#include "MOD_ui_common.hh"
#include "MOD_util.hh"
#include "BLO_read_write.hh"
#include "DEG_depsgraph_query.hh"
#include "BLI_time.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Functions

static void init_data (ModifierData *md)
 
static void copy_data (const ModifierData *md, ModifierData *target, const int flag)
 
static void freeBind (CorrectiveSmoothModifierData *csmd)
 
static void free_data (ModifierData *md)
 
static void required_data_mask (ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
 
static void mesh_get_weights (const MDeformVert *dvert, const int defgrp_index, const uint verts_num, const bool use_invert_vgroup, float *smooth_weights)
 
static void mesh_get_boundaries (Mesh *mesh, float *smooth_weights)
 
static void smooth_iter__simple (CorrectiveSmoothModifierData *csmd, Mesh *mesh, blender::MutableSpan< blender::float3 > vertexCos, const float *smooth_weights, uint iterations)
 
static void smooth_iter__length_weight (CorrectiveSmoothModifierData *csmd, Mesh *mesh, blender::MutableSpan< blender::float3 > vertexCos, const float *smooth_weights, uint iterations)
 
static void smooth_iter (CorrectiveSmoothModifierData *csmd, Mesh *mesh, blender::MutableSpan< blender::float3 > vertexCos, const float *smooth_weights, uint iterations)
 
static void smooth_verts (CorrectiveSmoothModifierData *csmd, Mesh *mesh, const MDeformVert *dvert, const int defgrp_index, blender::MutableSpan< blender::float3 > vertexCos)
 
static bool calc_tangent_loop (const float v_dir_prev[3], const float v_dir_next[3], float r_tspace[3][3])
 
static void calc_tangent_spaces (const Mesh *mesh, blender::Span< blender::float3 > vertexCos, float(*r_tangent_spaces)[3][3], float *r_tangent_weights, float *r_tangent_weights_per_vertex)
 
static void store_cache_settings (CorrectiveSmoothModifierData *csmd)
 
static bool cache_settings_equal (CorrectiveSmoothModifierData *csmd)
 
static void calc_deltas (CorrectiveSmoothModifierData *csmd, Mesh *mesh, const MDeformVert *dvert, const int defgrp_index, const blender::Span< blender::float3 > rest_coords)
 
static void correctivesmooth_modifier_do (ModifierData *md, Depsgraph *depsgraph, Object *ob, Mesh *mesh, blender::MutableSpan< blender::float3 > vertexCos, BMEditMesh *em)
 
static void deform_verts (ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, blender::MutableSpan< blender::float3 > positions)
 
static void panel_draw (const bContext *, Panel *panel)
 
static void panel_register (ARegionType *region_type)
 
static void blend_write (BlendWriter *writer, const ID *id_owner, const ModifierData *md)
 
static void blend_read (BlendDataReader *reader, ModifierData *md)
 

Variables

ModifierTypeInfo modifierType_CorrectiveSmooth
 

Detailed Description

Method of smoothing deformation, also known as 'delta-mush'.

Definition in file MOD_correctivesmooth.cc.

Function Documentation

◆ blend_read()

◆ blend_write()

◆ cache_settings_equal()

◆ calc_deltas()

◆ calc_tangent_loop()

static bool calc_tangent_loop ( const float v_dir_prev[3],
const float v_dir_next[3],
float r_tspace[3][3] )
static

Calculate an orthogonal 3x3 matrix from 2 edge vectors.

Returns
false if this loop should be ignored (have zero influence).

Definition at line 385 of file MOD_correctivesmooth.cc.

References add_v3_v3(), compare_v3v3(), copy_v3_v3(), cross_v3_v3v3(), normalize_v3(), unit_m3(), and UNLIKELY.

Referenced by calc_tangent_spaces().

◆ calc_tangent_spaces()

static void calc_tangent_spaces ( const Mesh * mesh,
blender::Span< blender::float3 > vertexCos,
float(*) r_tangent_spaces[3][3],
float * r_tangent_weights,
float * r_tangent_weights_per_vertex )
static
Parameters
r_tangent_spacesLoop aligned array of tangents.
r_tangent_weightsLoop aligned array of weights (may be nullptr).
r_tangent_weights_per_vertexVertex aligned array, accumulating weights for each loop (may be nullptr).

Definition at line 421 of file MOD_correctivesmooth.cc.

References calc_tangent_loop(), copy_v3_v3(), copy_vn_fl(), dot_v3v3(), fabsf, float, int, normalize_v3(), blender::math::safe_acos_approx(), and sub_v3_v3v3().

Referenced by calc_deltas(), and correctivesmooth_modifier_do().

◆ copy_data()

◆ correctivesmooth_modifier_do()

◆ deform_verts()

static void deform_verts ( ModifierData * md,
const ModifierEvalContext * ctx,
Mesh * mesh,
blender::MutableSpan< blender::float3 > positions )
static

◆ free_data()

static void free_data ( ModifierData * md)
static

Definition at line 86 of file MOD_correctivesmooth.cc.

References freeBind().

◆ freeBind()

◆ init_data()

◆ mesh_get_boundaries()

static void mesh_get_boundaries ( Mesh * mesh,
float * smooth_weights )
static

Definition at line 123 of file MOD_correctivesmooth.cc.

References MEM_calloc_arrayN, MEM_freeN(), and blender::Span< T >::slice().

Referenced by smooth_verts().

◆ mesh_get_weights()

static void mesh_get_weights ( const MDeformVert * dvert,
const int defgrp_index,
const uint verts_num,
const bool use_invert_vgroup,
float * smooth_weights )
static

Definition at line 103 of file MOD_correctivesmooth.cc.

References BKE_defvert_find_weight(), and w().

Referenced by smooth_verts().

◆ panel_draw()

◆ panel_register()

static void panel_register ( ARegionType * region_type)
static

◆ required_data_mask()

static void required_data_mask ( ModifierData * md,
CustomData_MeshMasks * r_cddata_masks )
static

◆ smooth_iter()

◆ smooth_iter__length_weight()

static void smooth_iter__length_weight ( CorrectiveSmoothModifierData * csmd,
Mesh * mesh,
blender::MutableSpan< blender::float3 > vertexCos,
const float * smooth_weights,
uint iterations )
static

◆ smooth_iter__simple()

static void smooth_iter__simple ( CorrectiveSmoothModifierData * csmd,
Mesh * mesh,
blender::MutableSpan< blender::float3 > vertexCos,
const float * smooth_weights,
uint iterations )
static

◆ smooth_verts()

◆ store_cache_settings()

Variable Documentation

◆ modifierType_CorrectiveSmooth

ModifierTypeInfo modifierType_CorrectiveSmooth

Definition at line 814 of file MOD_correctivesmooth.cc.