diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-23 05:25:55 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-23 05:25:55 +0300 |
commit | 6703c7f7f1f68ae59f9ccbf4fcabc3c035d648bf (patch) | |
tree | bf5def93b54ba810bbaef693ecc79d81e97e635b /source/blender/blenloader/intern/versioning_290.c | |
parent | 716a8241d387180fd8ad69cdec33633bc7a0f963 (diff) |
Bevel: Refactor profile type input to use an enum
This will allow the easier addition of a constant radius mode in the
future and some changes in the UI to mirror the recent similar change
from "Only Vertices" to the "Affect" enum.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-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 bf4ed270e33..843bf4c98d9 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -333,4 +333,18 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* Refactor bevel profile type to use an enum. */ + if (!DNA_struct_elem_find(fd->filesdna, "BevelModifier", "short", "profile_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; + bool use_custom_profile = bmd->flags & MOD_BEVEL_CUSTOM_PROFILE_DEPRECATED; + bmd->profile_type = use_custom_profile ? MOD_BEVEL_PROFILE_CUSTOM : + MOD_BEVEL_PROFILE_SUPERELLIPSE; + } + } + } + } } |