OpenSubdiv
OpenSubdiv copied to clipboard
What is the cause of the "no specialization" error TopologyRefinerFactory<>::resizeComponentTopology() ?
static void createOsdMesh(ShapeDesc const & shapeDesc, int level) {
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
CODE
// create Far mesh (topology)
OpenSubdiv::Sdc::SchemeType sdctype = GetSdcType(*shape);
OpenSubdiv::Sdc::Options sdcoptions = GetSdcOptions(*shape);
printf("Hello 001\n");
OpenSubdiv::Far::TopologyRefiner *topologyRefiner =
OpenSubdiv::Far::TopologyRefinerFactory<Shape>::Create(*shape,
OpenSubdiv::Far::TopologyRefinerFactory<Shape>::Options(sdctype, sdcoptions));
printf("Hello 002\n");
OUTPUT
[100%] Built target standaloneCPUEvalLimit Number of shapes = 1 Hello 001 Error: Failure in TopologyRefinerFactory<>::resizeComponentTopology() -- no specialization provided. Hello 002 Segmentation fault: 11
Hi,
Since you are specializing Far::TopologyRefinerFactory for your own MESH class <Shape> you must provide specializations for a few protected methods so that TopologyRefinerFactory can correctly access Shape data. See the section of far/topologyRefinerFactory.h labeled "Methods to be provided to complete assembly of the TopologyRefiner" or the example code in tutorial_1/far_tutorial_1.cpp (lines 226-379).
Ideally, this requirement would be expressed as a compile-time static assertion, but the current implementation instead raises a runtime error when the fallback implementation of one of these methods is executed.
Thanks! -David
I'm going to switch labels on this from "wontfix" to "documentation".
Filed as internal issue #151666.