Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/opensubdiv/internal/opensubdiv_converter_internal.cc')
-rw-r--r--intern/opensubdiv/internal/opensubdiv_converter_internal.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/intern/opensubdiv/internal/opensubdiv_converter_internal.cc b/intern/opensubdiv/internal/opensubdiv_converter_internal.cc
index 56b5657121d..32815dc34dc 100644
--- a/intern/opensubdiv/internal/opensubdiv_converter_internal.cc
+++ b/intern/opensubdiv/internal/opensubdiv_converter_internal.cc
@@ -49,6 +49,10 @@ getFVarLinearInterpolationFromCAPI(
return Options::FVAR_LINEAR_NONE;
case OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_ONLY:
return Options::FVAR_LINEAR_CORNERS_ONLY;
+ case OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_PLUS1:
+ return Options::FVAR_LINEAR_CORNERS_PLUS1;
+ case OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_PLUS2:
+ return Options::FVAR_LINEAR_CORNERS_PLUS2;
case OSD_FVAR_LINEAR_INTERPOLATION_BOUNDARIES:
return Options::FVAR_LINEAR_BOUNDARIES;
case OSD_FVAR_LINEAR_INTERPOLATION_ALL:
@@ -58,6 +62,28 @@ getFVarLinearInterpolationFromCAPI(
return Options::FVAR_LINEAR_NONE;
}
+OpenSubdiv_FVarLinearInterpolation
+getCAPIFVarLinearInterpolationFromOSD(
+ OpenSubdiv::Sdc::Options::FVarLinearInterpolation linear_interpolation) {
+ typedef OpenSubdiv::Sdc::Options Options;
+ switch (linear_interpolation) {
+ case Options::FVAR_LINEAR_NONE:
+ return OSD_FVAR_LINEAR_INTERPOLATION_NONE;
+ case Options::FVAR_LINEAR_CORNERS_ONLY:
+ return OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_ONLY;
+ case Options::FVAR_LINEAR_CORNERS_PLUS1:
+ return OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_PLUS1;
+ case Options::FVAR_LINEAR_CORNERS_PLUS2:
+ return OSD_FVAR_LINEAR_INTERPOLATION_CORNERS_PLUS2;
+ case Options::FVAR_LINEAR_BOUNDARIES:
+ return OSD_FVAR_LINEAR_INTERPOLATION_BOUNDARIES;
+ case Options::FVAR_LINEAR_ALL:
+ return OSD_FVAR_LINEAR_INTERPOLATION_ALL;
+ }
+ assert(!"Unknown fvar linear interpolation passed via C-API");
+ return OSD_FVAR_LINEAR_INTERPOLATION_NONE;
+}
+
float getCompatibleEdgeSharpness(const OpenSubdiv_Converter* converter,
int edge_index) {
if (converter->getNumEdgeFaces(converter, edge_index) == 2) {