35#include "RNA_prototypes.hh"
80 bool &r_attr_converted)
87 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(name);
89 r_attr_converted =
false;
92 if (meta_data->domain == domain && meta_data->data_type ==
CD_PROP_FLOAT) {
93 r_attr_converted =
false;
98 attributes.lookup<
float>(name, domain).varray.materialize(weight);
101 attributes.add<
float>(
103 r_attr_converted =
true;
118 float weight, weight2;
126 const float value = bmd->
value;
127 const int mat = std::clamp(
int(bmd->
mat), -1, ctx->
object->
totcol - 1);
135 const float spread = bmd->
spread;
141 convert_params.calc_vert_normal =
true;
142 convert_params.add_key_index =
false;
143 convert_params.use_shapekey =
false;
144 convert_params.active_shapekey = 0;
149 bool vert_weight_converted;
152 bool edge_weight_converted;
154 *mesh, bmd->
edge_weight_name, bke::AttrDomain::Edge, edge_weight_converted);
171 if (weight == 0.0f) {
175 else if (vgroup != -1) {
176 weight = invert_vgroup ?
208 if (weight == 0.0f) {
212 else if (vgroup != -1) {
213 weight = invert_vgroup ?
221 if (weight < 0.5f || weight2 < 0.5f) {
255 bweight_offset_edge);
265 if (vert_weight_converted) {
266 result->attributes_for_write().remove(vert_weight_name);
268 if (edge_weight_converted) {
269 result->attributes_for_write().remove(edge_weight_name);
286 return (bmd->
value == 0.0f);
325 const char *prop_name = edge_bevel ?
"edge_weight" :
"vertex_weight";
std::string BKE_attribute_calc_unique_name(const AttributeOwner &owner, const blender::StringRef name)
struct CurveProfile * BKE_curveprofile_copy(const struct CurveProfile *profile)
void BKE_curveprofile_blend_read(struct BlendDataReader *reader, struct CurveProfile *profile)
struct CurveProfile * BKE_curveprofile_add(eCurveProfilePresets preset)
void BKE_curveprofile_blend_write(struct BlendWriter *writer, const struct CurveProfile *profile)
void BKE_curveprofile_free(struct CurveProfile *profile)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
Mesh * BKE_mesh_from_bmesh_for_eval_nomain(BMesh *bm, const CustomData_MeshMasks *cd_mask_extra, const Mesh *me_settings)
BMesh * BKE_mesh_to_bmesh_ex(const Mesh *mesh, const BMeshCreateParams *create_params, const BMeshFromMeshParams *convert_params)
void BKE_modifier_copydata_generic(const ModifierData *md, ModifierData *md_dst, int flag)
@ eModifierTypeFlag_AcceptsCVs
@ eModifierTypeFlag_EnableInEditmode
@ eModifierTypeFlag_SupportsEditmode
@ eModifierTypeFlag_AcceptsMesh
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define CD_MASK_ORIGINDEX
#define CD_MASK_MDEFORMVERT
#define DNA_struct_default_get(struct_name)
@ MOD_BEVEL_HARDEN_NORMALS
@ MOD_BEVEL_INVERT_VGROUP
struct BevelModifierData BevelModifierData
@ MOD_BEVEL_AFFECT_VERTICES
@ MOD_BEVEL_PROFILE_CUSTOM
@ MOD_BEVEL_PROFILE_SUPERELLIPSE
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
static void panel_register(ARegionType *region_type)
static void geometry_panel_draw(const bContext *, Panel *panel)
static std::string ensure_weight_attribute_meta_data(Mesh &mesh, const blender::StringRef name, const blender::bke::AttrDomain domain, bool &r_attr_converted)
static void shading_panel_draw(const bContext *, Panel *panel)
static void copy_data(const ModifierData *md_src, ModifierData *md_dst, const int flag)
static Mesh * modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
static void free_data(ModifierData *md)
static void blend_read(BlendDataReader *reader, ModifierData *md)
static void profile_panel_draw(const bContext *, Panel *panel)
static void panel_draw(const bContext *, Panel *panel)
static void required_data_mask(ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
static void blend_write(BlendWriter *writer, const ID *, const ModifierData *md)
ModifierTypeInfo modifierType_Bevel
PanelType * modifier_subpanel_register(ARegionType *region_type, const char *name, const char *label, PanelDrawFn draw_header, PanelDrawFn draw, PanelType *parent)
void modifier_panel_end(uiLayout *layout, PointerRNA *ptr)
PanelType * modifier_panel_register(ARegionType *region_type, ModifierType type, PanelDrawFn draw)
PointerRNA * modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr)
void modifier_vgroup_ui(uiLayout *layout, PointerRNA *ptr, PointerRNA *ob_ptr, const char *vgroup_prop, const char *invert_vgroup_prop, const char *text)
void MOD_get_vgroup(const Object *ob, const Mesh *mesh, const char *name, const MDeformVert **dvert, int *defgrp_index)
void uiLayoutSetActive(uiLayout *layout, bool active)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemS(uiLayout *layout)
uiLayout * uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char *heading)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
void uiTemplateCurveProfile(uiLayout *layout, PointerRNA *ptr, const char *propname)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
void BM_mesh_bevel(BMesh *bm, const float offset, const int offset_type, const int profile_type, const int segments, const float profile, const bool affect_type, const bool use_weights, const bool limit_offset, const MDeformVert *dvert, const int vertex_group, const int mat, const bool loop_slide, const bool mark_seam, const bool mark_sharp, const bool harden_normals, const int face_strength_mode, const int miter_outer, const int miter_inner, const float spread, const CurveProfile *custom_profile, const int vmesh_method, const int bweight_offset_vert, const int bweight_offset_edge)
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_elem_index_get(ele)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
ATTR_WARN_UNUSED_RESULT const BMVert * v
static AttributeOwner from_id(ID *id)
std::optional< AttributeMetaData > lookup_meta_data(const StringRef attribute_id) const
bool allow_procedural_attribute_access(StringRef attribute_name)
void debug_randomize_mesh_order(Mesh *mesh)
int RNA_enum_get(PointerRNA *ptr, const char *name)
struct BLI_mempool * vtoolflagpool
struct BLI_mempool * etoolflagpool
struct BLI_mempool * ftoolflagpool
char edge_weight_name[64]
struct CurveProfile * custom_profile
char vertex_weight_name[64]