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
This commit is contained in:
parent
958fc6944f
commit
5b8503425a
|
@ -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 ============================== */
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue