diff options
author | Hans Goudey <h.goudey@me.com> | 2020-07-21 23:32:00 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-07-21 23:32:00 +0300 |
commit | 4aa2a5481cec4edc4694ee1edbde4ed3f3986313 (patch) | |
tree | 0dd39e7392e62963a2bcb7d82249e9c84e032fb2 /source/blender/blenloader | |
parent | a39da2cbca19102589d5141c80a6bc013bd4c963 (diff) |
Bevel: Refactor "Vertex Only" to an enum
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.
This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.
Tests are adjusted and still pass.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index a84d9711491..b6caa018756 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -413,5 +413,19 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } FOREACH_NODETREE_END; } + + /* Refactor bevel affect type to use an enum. */ + if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "char", "affect_type")) { + for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) { + LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { + if (md->type == eModifierType_Bevel) { + BevelModifierData *bmd = (BevelModifierData *)md; + const bool use_vertex_bevel = bmd->flags & MOD_BEVEL_VERT_DEPRECATED; + bmd->affect_type = use_vertex_bevel ? MOD_BEVEL_AFFECT_VERTICES : + MOD_BEVEL_AFFECT_EDGES; + } + } + } + } } } |