Fix T56290: Segfault when loading file - OpenSubdiv
Filled missing callbacks to converter.
This commit is contained in:
parent
517f58be3c
commit
e6827ad9a6
Notes:
blender-bot
2023-02-14 05:28:01 +01:00
Referenced by issue #56290, Segfault when loading file - OpenSubdiv?
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue