Subdiv: Cleanup, comments
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user