Bevel mod: cleanup flags and extra data.

Removed a clnors field unneeded after a recent refactor.
Finished deprecation of flags that haven't been used since pre-bmesh.
This commit is contained in:
Howard Trickey 2019-02-26 07:33:41 -05:00
parent 95b7d2be2c
commit f76c15efb7
Notes: blender-bot 2023-02-14 06:23:08 +01:00
Referenced by issue #62063, Python error on extrude
4 changed files with 7 additions and 42 deletions

View File

@ -5778,10 +5778,6 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
}
}
}
else if (md->type == eModifierType_Bevel) {
BevelModifierData *bmd = (BevelModifierData *)md;
bmd->clnordata.faceHash = NULL;
}
else if (md->type == eModifierType_Multires) {
MultiresModifierData *mmd = (MultiresModifierData *)md;
mmd->subdiv = NULL;

View File

@ -357,10 +357,6 @@ enum {
MOD_EDGESPLIT_FROMFLAG = (1 << 2),
};
typedef struct BevelModNorEditData {
struct GHash *faceHash;
} BevelModNorEditData;
typedef struct BevelModifierData {
ModifierData modifier;
@ -393,25 +389,21 @@ typedef struct BevelModifierData {
/** if the MOD_BEVEL_VWEIGHT option is set,
* this will be the name of the vert group, MAX_VGROUP_NAME */
char defgrp_name[64];
struct BevelModNorEditData clnordata;
} BevelModifierData;
/* BevelModifierData->flags and BevelModifierData->lim_flags */
enum {
MOD_BEVEL_VERT = (1 << 1),
/* MOD_BEVEL_RADIUS = (1 << 2), */
/* unused = (1 << 2), */
MOD_BEVEL_ANGLE = (1 << 3),
MOD_BEVEL_WEIGHT = (1 << 4),
MOD_BEVEL_VGROUP = (1 << 5),
MOD_BEVEL_EMIN = (1 << 7),
MOD_BEVEL_EMAX = (1 << 8),
/* MOD_BEVEL_RUNNING = (1 << 9), */
/* MOD_BEVEL_RES = (1 << 10), */
/* This is a new setting not related to old (trunk bmesh bevel code)
* but adding here because they are mixed - campbell
*/
/* MOD_BEVEL_EVEN = (1 << 11), */
/* MOD_BEVEL_DIST = (1 << 12), */ /* same as above */
/* unused = (1 << 7), */
/* unused = (1 << 8), */
/* unused = (1 << 9), */
/* unused = (1 << 10), */
/* unused = (1 << 11), */
/* unused = (1 << 12), */
MOD_BEVEL_OVERLAP_OK = (1 << 13),
MOD_BEVEL_EVEN_WIDTHS = (1 << 14),
MOD_BEVEL_HARDEN_NORMALS = (1 << 15),

View File

@ -3035,14 +3035,6 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL},
};
/* TO BE DEPRECATED */
static const EnumPropertyItem prop_edge_weight_method_items[] = {
{0, "AVERAGE", 0, "Average", ""},
{MOD_BEVEL_EMIN, "SHARPEST", 0, "Sharpest", ""},
{MOD_BEVEL_EMAX, "LARGEST", 0, "Largest", ""},
{0, NULL, 0, NULL, NULL},
};
static EnumPropertyItem prop_harden_normals_items[] = {
{ MOD_BEVEL_FACE_STRENGTH_NONE, "FSTR_NONE", 0, "None", "Do not set face strength" },
{ MOD_BEVEL_FACE_STRENGTH_NEW, "FSTR_NEW", 0, "New", "Set face strength on new faces only" },
@ -3095,13 +3087,6 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Limit Method", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* TO BE DEPRECATED */
prop = RNA_def_property(srna, "edge_weight_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "e_flags");
RNA_def_property_enum_items(prop, prop_edge_weight_method_items);
RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "bevel_angle");
RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));

View File

@ -62,16 +62,11 @@ static void initData(ModifierData *md)
bmd->profile = 0.5f;
bmd->bevel_angle = DEG2RADF(30.0f);
bmd->defgrp_name[0] = '\0';
bmd->clnordata.faceHash = NULL;
}
static void copyData(const ModifierData *md_src, ModifierData *md_dst, const int flag)
{
BevelModifierData *bmd_dst = (BevelModifierData *)md_dst;
modifier_copyData_generic(md_src, md_dst, flag);
bmd_dst->clnordata.faceHash = NULL;
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
@ -200,9 +195,6 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes
bm->ftoolflagpool == NULL); /* make sure we never alloc'd these */
BM_mesh_free(bm);
if (bmd->clnordata.faceHash)
BLI_ghash_free(bmd->clnordata.faceHash, NULL, NULL);
result->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
return result;