diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-13 13:51:34 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-08-13 13:51:34 +0300 |
commit | e6827ad9a6fe2810d50b44106bac7c4b2fa55127 (patch) | |
tree | 19e30cb5f5cb54cf212bbc24fd130ded6fcff2d4 /source/blender | |
parent | 517f58be3cf52da5d22e739f2aa40a5b5142885a (diff) |
Fix T56290: Segfault when loading file - OpenSubdiv
Filled missing callbacks to converter.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c index 649b7c7fa4c..b378744fa7a 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c +++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c @@ -94,6 +94,12 @@ static OpenSubdiv_FVarLinearInterpolation conv_dm_get_fvar_linear_interpolation( return OSD_FVAR_LINEAR_INTERPOLATION_ALL; } +static bool conv_dm_specifies_full_topology( + const OpenSubdiv_Converter *UNUSED(converter)) +{ + return true; +} + static int conv_dm_get_num_faces(const OpenSubdiv_Converter *converter) { ConvDMStorage *storage = converter->user_data; @@ -306,6 +312,20 @@ static void conv_dm_get_vert_faces(const OpenSubdiv_Converter *converter, #endif } +static bool conv_dm_is_infinite_sharp_vertex( + const OpenSubdiv_Converter *UNUSED(converter), + int UNUSED(manifold_vertex_index)) +{ + return false; +} + +static float conv_dm_get_vertex_sharpness( + const OpenSubdiv_Converter *UNUSED(converter), + int UNUSED(manifold_vertex_index)) +{ + return 0.0f; +} + static int conv_dm_get_num_uv_layers(const OpenSubdiv_Converter *converter) { ConvDMStorage *storage = converter->user_data; @@ -430,6 +450,7 @@ void ccgSubSurf_converter_setup_from_derivedmesh( converter->getFVarLinearInterpolation = conv_dm_get_fvar_linear_interpolation; + converter->specifiesFullTopology = conv_dm_specifies_full_topology; converter->getNumFaces = conv_dm_get_num_faces; converter->getNumEdges = conv_dm_get_num_edges; @@ -448,6 +469,8 @@ void ccgSubSurf_converter_setup_from_derivedmesh( converter->getVertexEdges = conv_dm_get_vert_edges; converter->getNumVertexFaces = conv_dm_get_num_vert_faces; converter->getVertexFaces = conv_dm_get_vert_faces; + converter->isInfiniteSharpVertex = conv_dm_is_infinite_sharp_vertex; + converter->getVertexSharpness = conv_dm_get_vertex_sharpness; converter->getNumUVLayers = conv_dm_get_num_uv_layers; converter->precalcUVLayer = conv_dm_precalc_uv_layer; @@ -533,6 +556,12 @@ conv_ccg_get_fvar_linear_interpolation(const OpenSubdiv_Converter *converter) return OSD_FVAR_LINEAR_INTERPOLATION_ALL; } +static bool conv_ccg_specifies_full_topology( + const OpenSubdiv_Converter *UNUSED(converter)) +{ + return true; +} + static int conv_ccg_get_num_faces(const OpenSubdiv_Converter *converter) { CCGSubSurf *ss = converter->user_data; @@ -676,6 +705,20 @@ static void conv_ccg_get_vert_faces(const OpenSubdiv_Converter *converter, } } +static bool conv_ccg_is_infinite_sharp_vertex( + const OpenSubdiv_Converter *UNUSED(converter), + int UNUSED(manifold_vertex_index)) +{ + return false; +} + +static float conv_ccg_get_vertex_sharpness( + const OpenSubdiv_Converter *UNUSED(converter), + int UNUSED(manifold_vertex_index)) +{ + return 0.0f; +} + static int conv_ccg_get_num_uv_layers(const OpenSubdiv_Converter *UNUSED(converter)) { return 0; @@ -709,6 +752,7 @@ void ccgSubSurf_converter_setup_from_ccg(CCGSubSurf *ss, converter->getFVarLinearInterpolation = conv_ccg_get_fvar_linear_interpolation; + converter->specifiesFullTopology = conv_ccg_specifies_full_topology; converter->getNumFaces = conv_ccg_get_num_faces; converter->getNumEdges = conv_ccg_get_num_edges; @@ -727,6 +771,8 @@ void ccgSubSurf_converter_setup_from_ccg(CCGSubSurf *ss, converter->getVertexEdges = conv_ccg_get_vert_edges; converter->getNumVertexFaces = conv_ccg_get_num_vert_faces; converter->getVertexFaces = conv_ccg_get_vert_faces; + converter->isInfiniteSharpVertex = conv_ccg_is_infinite_sharp_vertex; + converter->getVertexSharpness = conv_ccg_get_vertex_sharpness; converter->getNumUVLayers = conv_ccg_get_num_uv_layers; converter->precalcUVLayer = conv_ccg_precalc_uv_layer; |