Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-10-01 18:39:24 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-10-01 18:43:41 +0300
commit5b8503425a491f94f526d1f65cefea1599cafd92 (patch)
treea429b4fa652175e727e7cccd2eee1e164ceabf88
parent958fc6944f75f51b9fe5b47f29ff82156b3c6286 (diff)
Fix subdivision surface wrong for non-limit surface and subdivision level 1
Remove the workaround for T59395 that increases the minimal refinement to 2 to work around an OpenSubdiv bug. This bug appears to be fixed in the latest OpenSubdiv version we are using. Problem found by Piotr Ostrowski. Ref D9076
-rw-r--r--source/blender/blenkernel/BKE_subdiv.h2
-rw-r--r--source/blender/blenkernel/intern/subdiv.c21
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c2
-rw-r--r--source/blender/modifiers/intern/MOD_subsurf.c2
4 files changed, 0 insertions, 27 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv.h b/source/blender/blenkernel/BKE_subdiv.h
index 92da909b2ae..3d47c8d3bc5 100644
--- a/source/blender/blenkernel/BKE_subdiv.h
+++ b/source/blender/blenkernel/BKE_subdiv.h
@@ -220,8 +220,6 @@ void BKE_subdiv_stats_print(const SubdivStats *stats);
/* ================================ SETTINGS ================================ */
-void BKE_subdiv_settings_validate_for_mesh(SubdivSettings *settings, const struct Mesh *mesh);
-
bool BKE_subdiv_settings_equal(const SubdivSettings *settings_a, const SubdivSettings *settings_b);
/* ============================== CONSTRUCTION ============================== */
diff --git a/source/blender/blenkernel/intern/subdiv.c b/source/blender/blenkernel/intern/subdiv.c
index f1cde39f657..e6b51c586c3 100644
--- a/source/blender/blenkernel/intern/subdiv.c
+++ b/source/blender/blenkernel/intern/subdiv.c
@@ -87,27 +87,6 @@ eSubdivVtxBoundaryInterpolation BKE_subdiv_vtx_boundary_interpolation_from_subsu
/* ================================ SETTINGS ================================ */
-static bool check_mesh_has_non_quad(const Mesh *mesh)
-{
- for (int poly_index = 0; poly_index < mesh->totpoly; poly_index++) {
- const MPoly *poly = &mesh->mpoly[poly_index];
- if (poly->totloop != 4) {
- return true;
- }
- }
- return false;
-}
-
-void BKE_subdiv_settings_validate_for_mesh(SubdivSettings *settings, const Mesh *mesh)
-{
- if (settings->level != 1) {
- return;
- }
- if (check_mesh_has_non_quad(mesh)) {
- settings->level = 2;
- }
-}
-
bool BKE_subdiv_settings_equal(const SubdivSettings *settings_a, const SubdivSettings *settings_b)
{
return (settings_a->is_simple == settings_b->is_simple &&
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index f1c07b47c26..e1b89019d3a 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -225,7 +225,6 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
if (subdiv_settings.level == 0) {
return result;
}
- BKE_subdiv_settings_validate_for_mesh(&subdiv_settings, mesh);
MultiresRuntimeData *runtime_data = multires_ensure_runtime(mmd);
Subdiv *subdiv = subdiv_descriptor_ensure(mmd, &subdiv_settings, mesh);
if (subdiv == NULL) {
@@ -322,7 +321,6 @@ static void deformMatrices(ModifierData *md,
return;
}
- BKE_subdiv_settings_validate_for_mesh(&subdiv_settings, mesh);
MultiresRuntimeData *runtime_data = multires_ensure_runtime(mmd);
Subdiv *subdiv = subdiv_descriptor_ensure(mmd, &subdiv_settings, mesh);
if (subdiv == NULL) {
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index f730ccf5e29..7efb9d77eb5 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -263,7 +263,6 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
if (subdiv_settings.level == 0) {
return result;
}
- BKE_subdiv_settings_validate_for_mesh(&subdiv_settings, mesh);
SubsurfRuntimeData *runtime_data = subsurf_ensure_runtime(smd);
Subdiv *subdiv = subdiv_descriptor_ensure(smd, &subdiv_settings, mesh);
if (subdiv == NULL) {
@@ -323,7 +322,6 @@ static void deformMatrices(ModifierData *md,
if (subdiv_settings.level == 0) {
return;
}
- BKE_subdiv_settings_validate_for_mesh(&subdiv_settings, mesh);
SubsurfRuntimeData *runtime_data = subsurf_ensure_runtime(smd);
Subdiv *subdiv = subdiv_descriptor_ensure(smd, &subdiv_settings, mesh);
if (subdiv == NULL) {