diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-02 14:36:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-13 13:37:46 +0300 |
commit | 517f58be3cf52da5d22e739f2aa40a5b5142885a (patch) | |
tree | c12e08b3af29aba20863efa93f99388ea3638ca4 /source/blender/blenloader | |
parent | f8a499b596b8af46201b86a30c9807ca54363e25 (diff) |
Subsurf: Make uv boundaries easily extendible
This replaces old single toggle option to subdivide UVs with
an enum which can have more options. The usecase for this is
to be compatible with other software. But we also might choose
different subdivision type as default in the future.
DNA and underlying code supports all possible options, but
only the ones which are compatible with old subdivision code
are currently exposes.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D3575
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index aed1fd8b416..f9bf1d9baa6 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -48,6 +48,7 @@ #include "DNA_lightprobe_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" +#include "DNA_modifier_types.h" #include "DNA_particle_types.h" #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" @@ -1838,4 +1839,21 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + { + if (!DNA_struct_elem_find(fd->filesdna, "SubsurfModifier", "short", "uv_smooth")) { + for (Object *object = bmain->object.first; object != NULL; object = object->id.next) { + for (ModifierData *md = object->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_Subsurf) { + SubsurfModifierData *smd = (SubsurfModifierData *)md; + if (smd->flags & eSubsurfModifierFlag_SubsurfUv) { + smd->uv_smooth = SUBSURF_UV_SMOOTH_PRESERVE_CORNERS; + } + else { + smd->uv_smooth = SUBSURF_UV_SMOOTH_NONE; + } + } + } + } + } + } } |