Blender
V3.3
|
#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 "RNA_prototypes.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 |
Definition at line 40 of file MOD_weighted_normal.c.
#define NUM_CACHED_INVERSE_POWERS_OF_WEIGHT 128 |
Definition at line 66 of file MOD_weighted_normal.c.
typedef struct WeightedNormalData WeightedNormalData |
typedef struct WeightedNormalDataAggregateItem WeightedNormalDataAggregateItem |
|
static |
Definition at line 126 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(), WeightedNormalDataAggregateItem::loops_num, madd_v3_v3fl(), WeightedNormalDataAggregateItem::normal, NULL, NUM_CACHED_INVERSE_POWERS_OF_WEIGHT, WeightedNormalData::polynors, powf, WeightedNormalModifierData::thresh, WeightedNormalData::use_invert_vgroup, and WeightedNormalData::weight.
Referenced by apply_weights_vertex_normal().
|
static |
Definition at line 181 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_assert_unreachable, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, WeightedNormalData::clnors, CLNORS_VALID_VEC_LEN, copy_v3_v3(), WeightedNormalDataAggregateItem::curr_strength, WeightedNormalData::dvert, WeightedNormalData::edges_num, 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, WeightedNormalData::loops_num, 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, POINTER_AS_INT, WeightedNormalData::poly_strength, WeightedNormalData::polynors, WeightedNormalData::polys_num, MLoopNorSpaceArray::spaces_num, WeightedNormalData::split_angle, MPoly::totloop, MLoopNorSpace::user_data, MLoop::v, ModePair::val, WeightedNormalData::vert_normals, WeightedNormalData::verts_num, 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 108 of file MOD_weighted_normal.c.
References BLI_assert, WeightedNormalDataAggregateItem::curr_strength, WeightedNormalDataAggregateItem::curr_val, WeightedNormalDataAggregateItem::loops_num, WeightedNormalDataAggregateItem::normal, NULL, WeightedNormalData::poly_strength, and zero_v3().
Referenced by aggregate_item_normal().
|
static |
Definition at line 694 of file MOD_weighted_normal.c.
|
static |
Definition at line 668 of file MOD_weighted_normal.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
Definition at line 48 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 554 of file MOD_weighted_normal.c.
References BKE_id_copy_ex(), BKE_mesh_poly_normals_ensure(), BKE_mesh_vertex_normals_ensure(), BKE_modifier_set_error(), CD_CALLOC, CD_CUSTOMLOOPNORMAL, CD_PROP_INT32, CustomData_add_layer(), CustomData_get_layer(), CustomData_get_layer_named(), 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, ModifierEvalContext::object, result, Mesh::smoothresh, WeightedNormalData::verts_num, WeightedNormalModifierData::weight, wn_corner_angle(), wn_face_area(), and wn_face_with_angle().
Definition at line 699 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 723 of file MOD_weighted_normal.c.
References eModifierType_WeightedNormal, modifier_panel_register(), and panel_draw().
|
static |
Definition at line 677 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 470 of file MOD_weighted_normal.c.
References apply_weights_vertex_normal(), BKE_mesh_calc_poly_angles(), float(), ModePair::index, WeightedNormalData::loop_to_poly, WeightedNormalData::loops_num, MPoly::loopstart, M_PI, MEM_freeN, MEM_malloc_arrayN, WeightedNormalData::mloop, WeightedNormalData::mode_pair, modepair_cmp_by_val_inverse(), WeightedNormalData::mpoly, WeightedNormalData::mvert, WeightedNormalData::polys_num, MPoly::totloop, and ModePair::val.
Referenced by modifyMesh().
|
static |
Definition at line 445 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::polys_num, and ModePair::val.
Referenced by modifyMesh().
|
static |
Definition at line 511 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, WeightedNormalData::loops_num, MPoly::loopstart, M_PI, MEM_freeN, MEM_malloc_arrayN, WeightedNormalData::mloop, WeightedNormalData::mode_pair, modepair_cmp_by_val_inverse(), WeightedNormalData::mpoly, WeightedNormalData::mvert, WeightedNormalData::polys_num, MPoly::totloop, and ModePair::val.
Referenced by modifyMesh().
ModifierTypeInfo modifierType_WeightedNormal |
Definition at line 728 of file MOD_weighted_normal.c.