Subsurf: Fix/workaround crashes and failures with non-manifold geometry

The idea is simple: do not provide full topology to OpenSubdiv, leave
edges creation to OpenSubdiv itself. This solves issues with non-manifold
meshes which were known to fail, including the ones from T52059.

On a positive side we can simplify our side of converter, keeping code
shorter.

it is still possible that we'll need to ensure all loops has same
winding, but that is less things to worry about.
This commit is contained in:
Sergey Sharybin
2018-08-01 14:48:32 +02:00
parent ebbeddd2f4
commit ec4ba68730
3 changed files with 58 additions and 11 deletions

View File

@@ -110,6 +110,12 @@ static OpenSubdiv_FVarLinearInterpolation get_fvar_linear_interpolation(
return BKE_subdiv_converter_fvar_linear_from_settings(&storage->settings);
}
static bool specifies_full_topology(
const OpenSubdiv_Converter *UNUSED(converter))
{
return false;
}
static int get_num_faces(const OpenSubdiv_Converter *converter)
{
ConverterStorage *storage = converter->user_data;
@@ -480,8 +486,8 @@ static void free_user_data(const OpenSubdiv_Converter *converter)
static void init_functions(OpenSubdiv_Converter *converter)
{
converter->getSchemeType = get_scheme_type;
converter->getFVarLinearInterpolation = get_fvar_linear_interpolation;
converter->specifiesFullTopology = specifies_full_topology;
converter->getNumFaces = get_num_faces;
converter->getNumEdges = get_num_edges;