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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-02-28 22:40:21 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-28 22:47:50 +0300
commit993f43dc9ed30a674628299f661df0c6e6e63e36 (patch)
tree7d36f030e796392080ba8d71479098056621086a /source/blender/blenkernel/BKE_mesh.h
parent090b8c14d2fc7e90e905906e5a7bb552583b7563 (diff)
Cleanup/refactor clnor code: add high-level helpers to set custom normals.
Now it will be simpler for code jsut wanting to preserve custom normals around to set them, without having to add same boiler plate code all the time around actual code.
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh.h')
-rw-r--r--source/blender/blenkernel/BKE_mesh.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index d6b9f0a70ca..07d04a55496 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -295,6 +295,7 @@ enum {
MLNOR_SPACEARR_BMLOOP_PTR = 1,
};
+/* Low-level custom normals functions. */
void BKE_lnor_spacearr_init(MLoopNorSpaceArray *lnors_spacearr, const int numLoops, const char data_type);
void BKE_lnor_spacearr_clear(MLoopNorSpaceArray *lnors_spacearr);
void BKE_lnor_spacearr_free(MLoopNorSpaceArray *lnors_spacearr);
@@ -308,11 +309,7 @@ void BKE_lnor_space_add_loop(
void BKE_lnor_space_custom_data_to_normal(MLoopNorSpace *lnor_space, const short clnor_data[2], float r_custom_lnor[3]);
void BKE_lnor_space_custom_normal_to_data(MLoopNorSpace *lnor_space, const float custom_lnor[3], short r_clnor_data[2]);
-bool BKE_mesh_has_custom_loop_normals(struct Mesh *me);
-
-void BKE_mesh_calc_normals_split(struct Mesh *mesh);
-void BKE_mesh_calc_normals_split_ex(struct Mesh *mesh, struct MLoopNorSpaceArray *r_lnors_spacearr);
-
+/* Medium-level custom normals functions. */
void BKE_mesh_normals_loop_split(
const struct MVert *mverts, const int numVerts, struct MEdge *medges, const int numEdges,
struct MLoop *mloops, float (*r_loopnors)[3], const int numLoops,
@@ -335,6 +332,16 @@ void BKE_mesh_normals_loop_to_vertex(
const int numVerts, const struct MLoop *mloops, const int numLoops,
const float (*clnors)[3], float (*r_vert_clnors)[3]);
+/* High-level custom normals functions. */
+bool BKE_mesh_has_custom_loop_normals(struct Mesh *me);
+
+void BKE_mesh_calc_normals_split(struct Mesh *mesh);
+void BKE_mesh_calc_normals_split_ex(struct Mesh *mesh, struct MLoopNorSpaceArray *r_lnors_spacearr);
+
+void BKE_mesh_set_custom_normals(struct Mesh *mesh, float (*r_custom_loopnors)[3]);
+void BKE_mesh_set_custom_normals_from_vertices(struct Mesh *mesh, float (*r_custom_vertnors)[3]);
+
+
void BKE_mesh_calc_poly_normal(
const struct MPoly *mpoly, const struct MLoop *loopstart,
const struct MVert *mvarray, float r_no[3]);