[Bf-blender-cvs] [6c196248bea] master: Subdiv: Cleanup, comments
Sergey Sharybin
noreply at git.blender.org
Wed Jan 16 11:33:34 CET 2019
Commit: 6c196248beab63fa07a5a0990e1d172b42430451
Author: Sergey Sharybin
Date: Mon Jan 14 11:11:42 2019 +0100
Branches: master
https://developer.blender.org/rB6c196248beab63fa07a5a0990e1d172b42430451
Subdiv: Cleanup, comments
===================================================================
M source/blender/blenkernel/BKE_subdiv.h
M source/blender/blenkernel/intern/subdiv.c
===================================================================
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) {
More information about the Bf-blender-cvs
mailing list