diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-05-18 11:49:23 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-05-18 11:49:23 +0300 |
commit | 470ed9f07453acdf59b9ff8feac71df52409f0ab (patch) | |
tree | 9616c3ea319e9caad20ebcef3f211f7570364a48 | |
parent | a4b2734fe2675fbe2aeacc813b3dcd716fe81782 (diff) | |
parent | 04d15f162546ea9269b08525dac66482b83e8fe2 (diff) |
Merge branch 'blender-v2.83-release'
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires_reshape.c | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 9aedd7ef0b3..6fc29119cdc 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -309,16 +309,18 @@ class TOPBAR_MT_file_new(Menu): template_paths = bpy.utils.app_template_paths() - # expand template paths - app_templates = [] + # Expand template paths. + + # Use a set to avoid duplicate user/system templates. + # This is a corner case, but users managed to do it! T76849. + app_templates = set() for path in template_paths: for d in os.listdir(path): if d.startswith(("__", ".")): continue template = os.path.join(path, d) if os.path.isdir(template): - # template_paths_expand.append(template) - app_templates.append(d) + app_templates.add(d) return sorted(app_templates) diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c index e59b19638f8..64cc9130e25 100644 --- a/source/blender/blenkernel/intern/multires_reshape.c +++ b/source/blender/blenkernel/intern/multires_reshape.c @@ -197,7 +197,16 @@ void multiresModifier_subdivide_to_level(struct Object *object, if (!has_mdisps) { CustomData_add_layer(&coarse_mesh->ldata, CD_MDISPS, CD_CALLOC, NULL, coarse_mesh->totloop); } - if (!has_mdisps || top_level == 1) { + + /* NOTE: Subdivision happens from the top level of the existing multires modifier. If it is set + * to 0 and there is mdisps layer it would mean that the modifier went out of sync with the data. + * This happens when, for example, linking modifiers from one object to another. + * + * In such cases simply ensure grids to be the proper level. + * + * If something smarter is needed it is up to the operators which does data synchronization, so + * that the mdisps layer is also synchronized. */ + if (!has_mdisps || top_level == 1 || mmd->totlvl == 0) { multires_reshape_ensure_grids(coarse_mesh, top_level); if (ELEM(mode, MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE)) { multires_subdivide_create_tangent_displacement_linear_grids(object, mmd); |