From ec4ba68730f8e286559b0de433dfd821e6eeee6d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 1 Aug 2018 14:48:32 +0200 Subject: 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. --- source/blender/blenkernel/intern/subdiv_converter_mesh.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/subdiv_converter_mesh.c') diff --git a/source/blender/blenkernel/intern/subdiv_converter_mesh.c b/source/blender/blenkernel/intern/subdiv_converter_mesh.c index 50143dd46e1..83b1e4a6ce9 100644 --- a/source/blender/blenkernel/intern/subdiv_converter_mesh.c +++ b/source/blender/blenkernel/intern/subdiv_converter_mesh.c @@ -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; -- cgit v1.2.3