diff options
Diffstat (limited to 'intern/opensubdiv/internal/opensubdiv_converter_factory.cc')
-rw-r--r-- | intern/opensubdiv/internal/opensubdiv_converter_factory.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/intern/opensubdiv/internal/opensubdiv_converter_factory.cc b/intern/opensubdiv/internal/opensubdiv_converter_factory.cc index 901a421314a..4f3fb1462f3 100644 --- a/intern/opensubdiv/internal/opensubdiv_converter_factory.cc +++ b/intern/opensubdiv/internal/opensubdiv_converter_factory.cc @@ -441,6 +441,26 @@ inline void TopologyRefinerFactory<TopologyRefinerData>::reportInvalidTopology( namespace opensubdiv_capi { +namespace { + +OpenSubdiv::Sdc::Options::VtxBoundaryInterpolation +getVtxBoundaryInterpolationFromCAPI( + OpenSubdiv_VtxBoundaryInterpolation boundary_interpolation) { + using OpenSubdiv::Sdc::Options; + switch (boundary_interpolation) { + case OSD_VTX_BOUNDARY_NONE: + return Options::VTX_BOUNDARY_NONE; + case OSD_VTX_BOUNDARY_EDGE_ONLY: + return Options::VTX_BOUNDARY_EDGE_ONLY; + case OSD_VTX_BOUNDARY_EDGE_AND_CORNER: + return Options::VTX_BOUNDARY_EDGE_AND_CORNER; + } + assert(!"Unknown veretx boundary interpolation."); + return Options::VTX_BOUNDARY_EDGE_ONLY; +} + +} // namespace + OpenSubdiv::Far::TopologyRefiner* createOSDTopologyRefinerFromConverter( OpenSubdiv_Converter* converter) { using OpenSubdiv::Sdc::Options; @@ -451,7 +471,9 @@ OpenSubdiv::Far::TopologyRefiner* createOSDTopologyRefinerFromConverter( getFVarLinearInterpolationFromCAPI( converter->getFVarLinearInterpolation(converter)); Options options; - options.SetVtxBoundaryInterpolation(Options::VTX_BOUNDARY_EDGE_ONLY); + options.SetVtxBoundaryInterpolation( + getVtxBoundaryInterpolationFromCAPI( + converter->getVtxBoundaryInterpolation(converter))); options.SetCreasingMethod(Options::CREASE_UNIFORM); options.SetFVarLinearInterpolation(linear_interpolation); |