Blender
V3.3
|
#include "BLI_utildefines.h"
#include "BLI_math.h"
#include "BLT_translation.h"
#include "DNA_defaults.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "MEM_guardedalloc.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_editmesh.h"
#include "BKE_lib_id.h"
#include "BKE_mesh.h"
#include "BKE_mesh_wrapper.h"
#include "BKE_screen.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "MOD_modifiertypes.h"
#include "MOD_ui_common.h"
#include "MOD_util.h"
#include "BLO_read_write.h"
#include "DEG_depsgraph_query.h"
#include "PIL_time.h"
#include "BLI_strict_flags.h"
Go to the source code of this file.
Macros | |
#define | USE_TANGENT_CALC_INLINE |
Functions | |
static void | initData (ModifierData *md) |
static void | copyData (const ModifierData *md, ModifierData *target, const int flag) |
static void | freeBind (CorrectiveSmoothModifierData *csmd) |
static void | freeData (ModifierData *md) |
static void | requiredDataMask (Object *UNUSED(ob), ModifierData *md, CustomData_MeshMasks *r_cddata_masks) |
static void | mesh_get_weights (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, float(*vertexCos)[3], uint verts_num, const float *smooth_weights, uint iterations) |
static void | smooth_iter__length_weight (CorrectiveSmoothModifierData *csmd, Mesh *mesh, float(*vertexCos)[3], uint verts_num, const float *smooth_weights, uint iterations) |
static void | smooth_iter (CorrectiveSmoothModifierData *csmd, Mesh *mesh, float(*vertexCos)[3], uint verts_num, const float *smooth_weights, uint iterations) |
static void | smooth_verts (CorrectiveSmoothModifierData *csmd, Mesh *mesh, MDeformVert *dvert, const int defgrp_index, float(*vertexCos)[3], uint verts_num) |
static void | calc_tangent_ortho (float ts[3][3]) |
static void | calc_tangent_loop_accum (const float v_dir_prev[3], const float v_dir_next[3], float r_tspace[3][3]) |
static void | calc_tangent_spaces (Mesh *mesh, float(*vertexCos)[3], float(*r_tangent_spaces)[3][3]) |
static void | store_cache_settings (CorrectiveSmoothModifierData *csmd) |
static bool | cache_settings_equal (CorrectiveSmoothModifierData *csmd) |
static void | calc_deltas (CorrectiveSmoothModifierData *csmd, Mesh *mesh, MDeformVert *dvert, const int defgrp_index, const float(*rest_coords)[3], uint verts_num) |
static void | correctivesmooth_modifier_do (ModifierData *md, Depsgraph *depsgraph, Object *ob, Mesh *mesh, float(*vertexCos)[3], uint verts_num, struct BMEditMesh *em) |
static void | deformVerts (ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, float(*vertexCos)[3], int verts_num) |
static void | deformVertsEM (ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *editData, Mesh *mesh, float(*vertexCos)[3], int verts_num) |
static void | panel_draw (const bContext *UNUSED(C), Panel *panel) |
static void | panelRegister (ARegionType *region_type) |
static void | blendWrite (BlendWriter *writer, const ID *id_owner, const ModifierData *md) |
static void | blendRead (BlendDataReader *reader, ModifierData *md) |
Variables | |
ModifierTypeInfo | modifierType_CorrectiveSmooth |
Method of smoothing deformation, also known as 'delta-mush'.
Definition in file MOD_correctivesmooth.c.
#define USE_TANGENT_CALC_INLINE |
Definition at line 55 of file MOD_correctivesmooth.c.
|
static |
Definition at line 824 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::bind_coords, CorrectiveSmoothModifierData::bind_coords_num, BLO_read_float3_array(), CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::deltas, NULL, and CorrectiveSmoothDeltaCache::totverts.
|
static |
Definition at line 801 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::bind_coords, CorrectiveSmoothModifierData::bind_coords_num, BLI_assert, BLO_write_float3_array(), BLO_write_is_undo(), BLO_write_struct_at_address, eModifierFlag_OverrideLibrary_Local, ModifierData::flag, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, and NULL.
|
static |
Definition at line 508 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::flag, CorrectiveSmoothModifierData::flag, CorrectiveSmoothDeltaCache::lambda, CorrectiveSmoothModifierData::lambda, CorrectiveSmoothDeltaCache::repeat, CorrectiveSmoothModifierData::repeat, CorrectiveSmoothDeltaCache::rest_source, CorrectiveSmoothModifierData::rest_source, CorrectiveSmoothDeltaCache::smooth_type, and CorrectiveSmoothModifierData::smooth_type.
Referenced by correctivesmooth_modifier_do().
|
static |
This calculates CorrectiveSmoothModifierData.delta_cache It's not run on every update (during animation for example).
Definition at line 520 of file MOD_correctivesmooth.c.
References calc_tangent_ortho(), calc_tangent_spaces(), CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::deltas, float(), invert_m3_m3(), MEM_calloc_arrayN, MEM_dupallocN, MEM_freeN, MEM_malloc_arrayN, MEM_SAFE_FREE, mesh, mul_v3_m3v3(), smooth_verts(), sub_v3_v3v3(), CorrectiveSmoothDeltaCache::totverts, transpose_m3_m3(), and UNLIKELY.
Referenced by correctivesmooth_modifier_do().
|
static |
accumulate edge-vectors from all polys.
Definition at line 428 of file MOD_correctivesmooth.c.
References acosf, add_v3_v3(), add_v3_v3v3(), compare_v3v3(), cross_v3_v3v3(), dot_v3v3(), fabsf, mul_v3_fl(), nor, and normalize_v3().
Referenced by calc_tangent_spaces().
finalize after accumulation.
Definition at line 398 of file MOD_correctivesmooth.c.
References copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), mul_v3_fl(), mul_v3_v3fl(), normalize_v3(), sub_v3_v3(), and sub_v3_v3v3().
Referenced by calc_deltas(), calc_tangent_spaces(), and correctivesmooth_modifier_do().
|
static |
Definition at line 449 of file MOD_correctivesmooth.c.
References calc_tangent_loop_accum(), calc_tangent_ortho(), copy_v3_v3(), float(), MPoly::loopstart, mesh, Mesh::mloop, Mesh::mpoly, normalize_v3(), sub_v3_v3v3(), MPoly::totloop, Mesh::totpoly, USE_TANGENT_CALC_INLINE, and MLoop::v.
Referenced by calc_deltas(), and correctivesmooth_modifier_do().
|
static |
Definition at line 70 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::bind_coords, BKE_modifier_copydata_generic(), CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::deltas, MEM_dupallocN, NULL, and CorrectiveSmoothDeltaCache::totverts.
|
static |
Definition at line 565 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::bind_coords, CorrectiveSmoothModifierData::bind_coords_num, BKE_editmesh_vert_coords_alloc_orco(), BKE_mesh_vert_coords_alloc(), BKE_modifier_get_original(), BKE_modifier_set_error(), BLI_assert, BMEditMesh::bm, cache_settings_equal(), calc_deltas(), calc_tangent_ortho(), calc_tangent_spaces(), Object::data, CorrectiveSmoothModifierData::defgrp_name, DEG_is_active(), CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::deltas, depsgraph, error(), CorrectiveSmoothModifierData::flag, float(), ID_RECALC_ALL, madd_v3_v3fl(), MEM_calloc_arrayN, MEM_dupallocN, MEM_freeN, MEM_SAFE_FREE, mesh, MOD_CORRECTIVESMOOTH_ONLY_SMOOTH, MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND, MOD_CORRECTIVESMOOTH_RESTSOURCE_ORCO, MOD_get_vgroup(), CorrectiveSmoothModifierData::modifier, mul_v3_m3v3(), NULL, OB_MESH, CorrectiveSmoothModifierData::rest_source, CorrectiveSmoothModifierData::scale, smooth_verts(), store_cache_settings(), TIMEIT_END, TIMEIT_START, BMesh::totvert, CorrectiveSmoothDeltaCache::totverts, Object::type, and UNLIKELY.
Referenced by deformVerts(), and deformVertsEM().
|
static |
Definition at line 726 of file MOD_correctivesmooth.c.
References BKE_id_free(), correctivesmooth_modifier_do(), ModifierEvalContext::depsgraph, ELEM, mesh, MOD_deform_mesh_eval_get(), NULL, and ModifierEvalContext::object.
|
static |
Definition at line 743 of file MOD_correctivesmooth.c.
References BKE_id_free(), BKE_mesh_wrapper_ensure_mdata(), correctivesmooth_modifier_do(), ModifierEvalContext::depsgraph, ELEM, mesh, MOD_deform_mesh_eval_get(), NULL, and ModifierEvalContext::object.
|
static |
Definition at line 85 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::bind_coords, CorrectiveSmoothModifierData::bind_coords_num, CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::deltas, and MEM_SAFE_FREE.
Referenced by freeData().
|
static |
Definition at line 93 of file MOD_correctivesmooth.c.
References freeBind().
|
static |
Definition at line 57 of file MOD_correctivesmooth.c.
References BLI_assert, CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::deltas, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, and NULL.
Definition at line 132 of file MOD_correctivesmooth.c.
References MLoop::e, MPoly::loopstart, Mesh::medge, MEM_calloc_arrayN, MEM_freeN, mesh, Mesh::mloop, Mesh::mpoly, Mesh::totedge, MPoly::totloop, Mesh::totpoly, and MEdge::v1.
Referenced by smooth_verts().
|
static |
Definition at line 112 of file MOD_correctivesmooth.c.
References BKE_defvert_find_weight(), and w().
Referenced by smooth_verts().
Definition at line 766 of file MOD_correctivesmooth.c.
References IFACE_, Panel::layout, MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND, modifier_panel_end(), modifier_panel_get_property_pointers(), modifier_vgroup_ui(), NULL, ptr, RNA_boolean_get(), RNA_enum_get(), uiItemO(), uiItemR(), and uiLayoutSetPropSep().
Referenced by panelRegister().
|
static |
Definition at line 796 of file MOD_correctivesmooth.c.
References eModifierType_CorrectiveSmooth, modifier_panel_register(), and panel_draw().
|
static |
Definition at line 99 of file MOD_correctivesmooth.c.
References CD_MASK_MDEFORMVERT, CorrectiveSmoothModifierData::defgrp_name, and CustomData_MeshMasks::vmask.
|
static |
Definition at line 340 of file MOD_correctivesmooth.c.
References mesh, MOD_CORRECTIVESMOOTH_SMOOTH_LENGTH_WEIGHT, smooth_iter__length_weight(), smooth_iter__simple(), and CorrectiveSmoothModifierData::smooth_type.
Referenced by bevel_list_smooth(), make_bevel_list_3D(), and smooth_verts().
|
static |
Definition at line 246 of file MOD_correctivesmooth.c.
References eps, CorrectiveSmoothModifierData::lambda, Mesh::medge, mesh, and Mesh::totedge.
Referenced by smooth_iter().
|
static |
Definition at line 170 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::lambda, Mesh::medge, mesh, and Mesh::totedge.
Referenced by smooth_iter().
|
static |
Definition at line 359 of file MOD_correctivesmooth.c.
References copy_vn_fl(), CorrectiveSmoothModifierData::flag, MEM_freeN, MEM_malloc_arrayN, mesh, mesh_get_boundaries(), mesh_get_weights(), MOD_CORRECTIVESMOOTH_INVERT_VGROUP, MOD_CORRECTIVESMOOTH_PIN_BOUNDARY, NULL, CorrectiveSmoothModifierData::repeat, and smooth_iter().
Referenced by calc_deltas(), and correctivesmooth_modifier_do().
|
static |
Definition at line 499 of file MOD_correctivesmooth.c.
References CorrectiveSmoothModifierData::delta_cache, CorrectiveSmoothDeltaCache::flag, CorrectiveSmoothModifierData::flag, CorrectiveSmoothDeltaCache::lambda, CorrectiveSmoothModifierData::lambda, CorrectiveSmoothDeltaCache::repeat, CorrectiveSmoothModifierData::repeat, CorrectiveSmoothDeltaCache::rest_source, CorrectiveSmoothModifierData::rest_source, CorrectiveSmoothDeltaCache::smooth_type, and CorrectiveSmoothModifierData::smooth_type.
Referenced by correctivesmooth_modifier_do().
ModifierTypeInfo modifierType_CorrectiveSmooth |
Definition at line 837 of file MOD_correctivesmooth.c.