diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-14 13:11:42 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-16 13:00:42 +0300 |
commit | 6c196248beab63fa07a5a0990e1d172b42430451 (patch) | |
tree | 5d3216bb6bc4e3eac32a95e26d40b3ea02b9e6a8 /source/blender/blenkernel | |
parent | 3d4e92eb9625c8cfd09cba650ff292b0eb634c0b (diff) |
Subdiv: Cleanup, comments
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv.h | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subdiv.c | 9 |
2 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv.h b/source/blender/blenkernel/BKE_subdiv.h index 352581c99d6..ab540b85daf 100644 --- a/source/blender/blenkernel/BKE_subdiv.h +++ b/source/blender/blenkernel/BKE_subdiv.h @@ -167,13 +167,12 @@ typedef struct Subdiv { /* Cached values, are not supposed to be accessed directly. */ struct { /* Indexed by base face index, element indicates total number of ptex - *faces created for preceding base faces. - */ + *faces created for preceding base faces. */ int *face_ptex_offset; } cache_; } Subdiv; -/* ================================ HELPERS ================================= */ +/* ========================== CONVERSION HELPERS ============================ */ /* NOTE: uv_smooth is eSubsurfUVSmooth. */ eSubdivFVarLinearInterpolation @@ -211,7 +210,7 @@ void BKE_subdiv_displacement_detach(Subdiv *subdiv); int *BKE_subdiv_face_ptex_offset_get(Subdiv *subdiv); -/* ============================= VARIOUS HELPERS ============================ */ +/* =========================== PTEX FACES AND GRIDS ========================= */ /* For a given (ptex_u, ptex_v) within a ptex face get corresponding * (grid_u, grid_v) within a grid. */ diff --git a/source/blender/blenkernel/intern/subdiv.c b/source/blender/blenkernel/intern/subdiv.c index b2736ed8f37..26088248d51 100644 --- a/source/blender/blenkernel/intern/subdiv.c +++ b/source/blender/blenkernel/intern/subdiv.c @@ -43,6 +43,8 @@ #include "opensubdiv_evaluator_capi.h" #include "opensubdiv_topology_refiner_capi.h" +/* ========================== CONVERSION HELPERS ============================ */ + eSubdivFVarLinearInterpolation BKE_subdiv_fvar_interpolation_from_uv_smooth(int uv_smooth) { @@ -64,6 +66,8 @@ BKE_subdiv_fvar_interpolation_from_uv_smooth(int uv_smooth) return SUBDIV_FVAR_LINEAR_INTERPOLATION_ALL; } +/* ============================== CONSTRUCTION ============================== */ + Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings, struct OpenSubdiv_Converter *converter) { @@ -83,8 +87,7 @@ Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings, else { /* TODO(sergey): Check whether original geometry had any vertices. * The thing here is: OpenSubdiv can only deal with faces, but our - * side of subdiv also deals with loose vertices and edges. - */ + * side of subdiv also deals with loose vertices and edges. */ } Subdiv *subdiv = MEM_callocN(sizeof(Subdiv), "subdiv from converetr"); subdiv->settings = *settings; @@ -124,6 +127,8 @@ void BKE_subdiv_free(Subdiv *subdiv) MEM_freeN(subdiv); } +/* =========================== PTEX FACES AND GRIDS ========================= */ + int *BKE_subdiv_face_ptex_offset_get(Subdiv *subdiv) { if (subdiv->cache_.face_ptex_offset != NULL) { |