|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "BLI_bitmap.h"#include "BLI_linklist.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 "BKE_context.h"#include "BKE_deform.h"#include "BKE_lib_id.h"#include "BKE_mesh.h"#include "BKE_screen.h"#include "UI_interface.h"#include "UI_resources.h"#include "RNA_access.h"#include "MOD_modifiertypes.h"#include "MOD_ui_common.h"#include "MOD_util.h"#include "bmesh.h"Go to the source code of this file.
Classes | |
| struct | ModePair |
| struct | WeightedNormalDataAggregateItem |
| struct | WeightedNormalData |
Macros | |
| #define | CLNORS_VALID_VEC_LEN (1e-6f) |
| #define | NUM_CACHED_INVERSE_POWERS_OF_WEIGHT 128 |
Typedefs | |
| typedef struct ModePair | ModePair |
| typedef struct WeightedNormalDataAggregateItem | WeightedNormalDataAggregateItem |
| typedef struct WeightedNormalData | WeightedNormalData |
Variables | |
| ModifierTypeInfo | modifierType_WeightedNormal |
| #define CLNORS_VALID_VEC_LEN (1e-6f) |
Definition at line 53 of file MOD_weighted_normal.c.
| #define NUM_CACHED_INVERSE_POWERS_OF_WEIGHT 128 |
Definition at line 79 of file MOD_weighted_normal.c.
| typedef struct WeightedNormalData WeightedNormalData |
| typedef struct WeightedNormalDataAggregateItem WeightedNormalDataAggregateItem |
|
static |
Definition at line 138 of file MOD_weighted_normal.c.
References BKE_defvert_find_index(), WeightedNormalData::cached_inverse_powers_of_weight, check_item_poly_strength(), compare_ff(), WeightedNormalDataAggregateItem::curr_val, WeightedNormalData::defgrp_index, WeightedNormalData::dvert, float(), madd_v3_v3fl(), WeightedNormalDataAggregateItem::normal, NULL, NUM_CACHED_INVERSE_POWERS_OF_WEIGHT, WeightedNormalDataAggregateItem::num_loops, WeightedNormalData::polynors, powf, WeightedNormalModifierData::thresh, WeightedNormalData::use_invert_vgroup, and WeightedNormalData::weight.
Referenced by apply_weights_vertex_normal().
|
static |
Definition at line 193 of file MOD_weighted_normal.c.
References aggregate_item_normal(), BKE_lnor_spacearr_free(), BKE_mesh_normals_loop_custom_from_vertices_set(), BKE_mesh_normals_loop_custom_set(), BKE_mesh_normals_loop_split(), BLI_assert, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, WeightedNormalData::clnors, CLNORS_VALID_VEC_LEN, copy_v3_v3(), WeightedNormalDataAggregateItem::curr_strength, WeightedNormalData::dvert, FACE_STRENGTH_WEAK, WeightedNormalModifierData::flag, MLoopNorSpace::flags, float(), WeightedNormalData::has_clnors, ModePair::index, is_zero_v3(), WeightedNormalData::items_data, WeightedNormalData::loop_to_poly, MLoopNorSpace::loops, MPoly::loopstart, MLoopNorSpaceArray::lspacearr, WeightedNormalData::medge, MEM_calloc_arrayN, MEM_freeN, MEM_SAFE_FREE, MLNOR_SPACE_IS_SINGLE, WeightedNormalData::mloop, MOD_WEIGHTEDNORMAL_FACE_INFLUENCE, MOD_WEIGHTEDNORMAL_KEEP_SHARP, MOD_WEIGHTEDNORMAL_MODE_ANGLE, MOD_WEIGHTEDNORMAL_MODE_FACE, MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE, WeightedNormalData::mode, WeightedNormalData::mode_pair, WeightedNormalData::mpoly, WeightedNormalData::mvert, LinkNode::next, normal, WeightedNormalDataAggregateItem::normal, normalize_v3(), NULL, MLoopNorSpaceArray::num_spaces, WeightedNormalData::numEdges, WeightedNormalData::numLoops, WeightedNormalData::numPolys, WeightedNormalData::numVerts, POINTER_AS_INT, WeightedNormalData::poly_strength, WeightedNormalData::polynors, WeightedNormalData::split_angle, MPoly::totloop, MLoopNorSpace::user_data, MLoop::v, ModePair::val, and zero_v3().
Referenced by wn_corner_angle(), wn_face_area(), and wn_face_with_angle().
|
static |
Check strength of given poly compared to those found so far for that given item (vertex or smooth fan), and reset matching item_data in case we get a stronger new strength.
Definition at line 120 of file MOD_weighted_normal.c.
References BLI_assert, WeightedNormalDataAggregateItem::curr_strength, WeightedNormalDataAggregateItem::curr_val, WeightedNormalDataAggregateItem::normal, NULL, WeightedNormalDataAggregateItem::num_loops, WeightedNormalData::poly_strength, and zero_v3().
Referenced by aggregate_item_normal().
|
static |
Definition at line 714 of file MOD_weighted_normal.c.
|
static |
Definition at line 688 of file MOD_weighted_normal.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
|
static |
Definition at line 61 of file MOD_weighted_normal.c.
References ModePair::val.
Referenced by wn_corner_angle(), wn_face_area(), and wn_face_with_angle().
|
static |
Definition at line 561 of file MOD_weighted_normal.c.
References BKE_id_copy_ex(), BKE_mesh_calc_normals_poly(), BKE_modifier_set_error(), CD_CALLOC, CD_CUSTOMLOOPNORMAL, CD_FLAG_TEMPORARY, CD_NORMAL, CD_PROP_INT32, CustomData_add_layer(), CustomData_free_layers(), CustomData_get_layer(), CustomData_get_layer_named(), CustomData_set_layer_flag(), Object::data, WeightedNormalModifierData::defgrp_name, Mesh::flag, WeightedNormalModifierData::flag, float(), Mesh::id, WeightedNormalData::items_data, LIB_ID_COPY_LOCALIZE, WeightedNormalData::loop_to_poly, ME_AUTOSMOOTH, MEM_SAFE_FREE, mesh, MOD_get_vgroup(), MOD_WEIGHTEDNORMAL_INVERT_VGROUP, MOD_WEIGHTEDNORMAL_MODE_ANGLE, MOD_WEIGHTEDNORMAL_MODE_FACE, MOD_WEIGHTEDNORMAL_MODE_FACE_ANGLE, MOD_WEIGHTEDNORMALS_FACEWEIGHT_CDLAYER_ID, WeightedNormalModifierData::mode, WeightedNormalData::mode_pair, NULL, WeightedNormalData::numVerts, ModifierEvalContext::object, result, Mesh::smoothresh, WeightedNormalModifierData::weight, wn_corner_angle(), wn_face_area(), and wn_face_with_angle().
Definition at line 719 of file MOD_weighted_normal.c.
References col, IFACE_, Panel::layout, modifier_panel_end(), modifier_panel_get_property_pointers(), modifier_vgroup_ui(), NULL, ptr, uiItemR(), uiLayoutColumn(), and uiLayoutSetPropSep().
Referenced by panelRegister().
|
static |
Definition at line 743 of file MOD_weighted_normal.c.
References eModifierType_WeightedNormal, modifier_panel_register(), and panel_draw().
|
static |
Definition at line 697 of file MOD_weighted_normal.c.
References CD_MASK_CUSTOMLOOPNORMAL, CD_MASK_MDEFORMVERT, CD_MASK_PROP_INT32, WeightedNormalModifierData::defgrp_name, WeightedNormalModifierData::flag, CustomData_MeshMasks::lmask, MOD_WEIGHTEDNORMAL_FACE_INFLUENCE, CustomData_MeshMasks::pmask, and CustomData_MeshMasks::vmask.
|
static |
Definition at line 477 of file MOD_weighted_normal.c.
References apply_weights_vertex_normal(), BKE_mesh_calc_poly_angles(), float(), ModePair::index, WeightedNormalData::loop_to_poly, MPoly::loopstart, M_PI, MEM_freeN, MEM_malloc_arrayN, WeightedNormalData::mloop, WeightedNormalData::mode_pair, modepair_cmp_by_val_inverse(), WeightedNormalData::mpoly, WeightedNormalData::mvert, WeightedNormalData::numLoops, WeightedNormalData::numPolys, MPoly::totloop, and ModePair::val.
Referenced by modifyMesh().
|
static |
Definition at line 452 of file MOD_weighted_normal.c.
References apply_weights_vertex_normal(), BKE_mesh_calc_poly_area(), ModePair::index, MPoly::loopstart, MEM_malloc_arrayN, WeightedNormalData::mloop, WeightedNormalData::mode_pair, modepair_cmp_by_val_inverse(), WeightedNormalData::mpoly, WeightedNormalData::mvert, WeightedNormalData::numPolys, and ModePair::val.
Referenced by modifyMesh().
|
static |
Definition at line 518 of file MOD_weighted_normal.c.
References apply_weights_vertex_normal(), BKE_mesh_calc_poly_angles(), BKE_mesh_calc_poly_area(), float(), ModePair::index, WeightedNormalData::loop_to_poly, MPoly::loopstart, M_PI, MEM_freeN, MEM_malloc_arrayN, WeightedNormalData::mloop, WeightedNormalData::mode_pair, modepair_cmp_by_val_inverse(), WeightedNormalData::mpoly, WeightedNormalData::mvert, WeightedNormalData::numLoops, WeightedNormalData::numPolys, MPoly::totloop, and ModePair::val.
Referenced by modifyMesh().
| ModifierTypeInfo modifierType_WeightedNormal |
Definition at line 748 of file MOD_weighted_normal.c.