From 5e696fdcd646ca8643f617046a22da0a825f56d4 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 14 Aug 2018 12:17:10 +0200 Subject: Multires: Begin hooking it up to the new subdiv code Currently behaves same as subsurf, support of displacement is the next task in the line to tackle! --- source/blender/blenkernel/intern/subdiv.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/blenkernel/intern/subdiv.c') diff --git a/source/blender/blenkernel/intern/subdiv.c b/source/blender/blenkernel/intern/subdiv.c index 207fdf43c55..4f630e8c38c 100644 --- a/source/blender/blenkernel/intern/subdiv.c +++ b/source/blender/blenkernel/intern/subdiv.c @@ -30,6 +30,7 @@ #include "BKE_subdiv.h" #include "DNA_mesh_types.h" +#include "DNA_modifier_types.h" #include "BLI_utildefines.h" @@ -42,6 +43,27 @@ #include "opensubdiv_evaluator_capi.h" #include "opensubdiv_topology_refiner_capi.h" +eSubdivFVarLinearInterpolation +BKE_subdiv_fvar_interpolation_from_uv_smooth(int uv_smooth) +{ + switch (uv_smooth) { + case SUBSURF_UV_SMOOTH_NONE: + return SUBDIV_FVAR_LINEAR_INTERPOLATION_ALL; + case SUBSURF_UV_SMOOTH_PRESERVE_CORNERS: + return SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_ONLY; + case SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_AND_JUNCTIONS: + return SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_AND_JUNCTIONS; + case SUBSURF_UV_SMOOTH_PRESERVE_CORNERS_JUNCTIONS_AND_CONCAVE: + return SUBDIV_FVAR_LINEAR_INTERPOLATION_CORNERS_JUNCTIONS_AND_CONCAVE; + case SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES: + return SUBDIV_FVAR_LINEAR_INTERPOLATION_BOUNDARIES; + case SUBSURF_UV_SMOOTH_ALL: + return SUBDIV_FVAR_LINEAR_INTERPOLATION_NONE; + } + BLI_assert(!"Unknown uv smooth flag"); + return SUBSURF_UV_SMOOTH_NONE; +} + Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings, struct OpenSubdiv_Converter *converter) { -- cgit v1.2.3