[Bf-blender-cvs] [c9707a408f5] blender2.8: Subdiv: Move mesh creation functionality to own header

Sergey Sharybin noreply at git.blender.org
Tue Sep 4 15:35:04 CEST 2018


Commit: c9707a408f575ee98dc81238244cbfa1f741c116
Author: Sergey Sharybin
Date:   Tue Sep 4 15:32:01 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc9707a408f575ee98dc81238244cbfa1f741c116

Subdiv: Move mesh creation functionality to own header

===================================================================

M	source/blender/blenkernel/BKE_subdiv.h
A	source/blender/blenkernel/BKE_subdiv_mesh.h
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/multires_reshape.c
M	source/blender/blenkernel/intern/multires_subdiv.c
M	source/blender/blenkernel/intern/subdiv_foreach.c
M	source/blender/blenkernel/intern/subdiv_mesh.c
M	source/blender/modifiers/intern/MOD_multires.c
M	source/blender/modifiers/intern/MOD_subsurf.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_subdiv.h b/source/blender/blenkernel/BKE_subdiv.h
index 111f04915ad..28b2942a70f 100644
--- a/source/blender/blenkernel/BKE_subdiv.h
+++ b/source/blender/blenkernel/BKE_subdiv.h
@@ -171,22 +171,6 @@ Subdiv *BKE_subdiv_new_from_mesh(const SubdivSettings *settings,
 
 void BKE_subdiv_free(Subdiv *subdiv);
 
-/* =========================== SUBDIV TO MESH API =========================== */
-
-typedef struct SubdivToMeshSettings {
-	/* Resolution at which ptex are being evaluated.
-	 * This defines how many vertices final mesh will have: every ptex has
-	 * resolution^2 vertices.
-	 */
-	int resolution;
-} SubdivToMeshSettings;
-
-/* Create real hi-res mesh from subdivision, all geometry is "real". */
-struct Mesh *BKE_subdiv_to_mesh(
-        Subdiv *subdiv,
-        const SubdivToMeshSettings *settings,
-        const struct Mesh *coarse_mesh);
-
 /* ============================ DISPLACEMENT API ============================ */
 
 void BKE_subdiv_displacement_attach_from_multires(
diff --git a/source/blender/blenkernel/BKE_subdiv_mesh.h b/source/blender/blenkernel/BKE_subdiv_mesh.h
new file mode 100644
index 00000000000..3a902c4f29e
--- /dev/null
+++ b/source/blender/blenkernel/BKE_subdiv_mesh.h
@@ -0,0 +1,54 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2018 by Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Sergey Sharybin.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file BKE_subdiv_mesh.h
+ *  \ingroup bke
+ *  \since July 2018
+ *  \author Sergey Sharybin
+ */
+
+#ifndef __BKE_SUBDIV_MESH_H__
+#define __BKE_SUBDIV_MESH_H__
+
+#include "BLI_sys_types.h"
+
+struct Mesh;
+struct Subdiv;
+
+typedef struct SubdivToMeshSettings {
+	/* Resolution at which ptex are being evaluated.
+	 * This defines how many vertices final mesh will have: every ptex has
+	 * resolution^2 vertices.
+	 */
+	int resolution;
+} SubdivToMeshSettings;
+
+/* Create real hi-res mesh from subdivision, all geometry is "real". */
+struct Mesh *BKE_subdiv_to_mesh(
+        struct Subdiv *subdiv,
+        const SubdivToMeshSettings *settings,
+        const struct Mesh *coarse_mesh);
+
+#endif  /* __BKE_SUBDIV)MESH_H__ */
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 0c5428aad57..deb2cb3bac5 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -327,6 +327,7 @@ set(SRC
 	BKE_subdiv.h
 	BKE_subdiv_eval.h
 	BKE_subdiv_foreach.h
+	BKE_subdiv_mesh.h
 	BKE_subsurf.h
 	BKE_suggestions.h
 	BKE_text.h
diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c
index 182e957ce4a..e452b551751 100644
--- a/source/blender/blenkernel/intern/multires_reshape.c
+++ b/source/blender/blenkernel/intern/multires_reshape.c
@@ -44,6 +44,7 @@
 #include "BKE_subdiv.h"
 #include "BKE_subdiv_eval.h"
 #include "BKE_subdiv_foreach.h"
+#include "BKE_subdiv_mesh.h"
 
 #include "DEG_depsgraph_query.h"
 
diff --git a/source/blender/blenkernel/intern/multires_subdiv.c b/source/blender/blenkernel/intern/multires_subdiv.c
index 2df931328c2..f745418295d 100644
--- a/source/blender/blenkernel/intern/multires_subdiv.c
+++ b/source/blender/blenkernel/intern/multires_subdiv.c
@@ -39,6 +39,7 @@
 #include "BKE_modifier.h"
 #include "BKE_multires.h"
 #include "BKE_subdiv.h"
+#include "BKE_subdiv_mesh.h"
 
 void BKE_multires_subdiv_settings_init(
         SubdivSettings *settings,
diff --git a/source/blender/blenkernel/intern/subdiv_foreach.c b/source/blender/blenkernel/intern/subdiv_foreach.c
index 80471b19ec0..8fa060f2931 100644
--- a/source/blender/blenkernel/intern/subdiv_foreach.c
+++ b/source/blender/blenkernel/intern/subdiv_foreach.c
@@ -43,6 +43,7 @@
 #include "BKE_mesh.h"
 #include "BKE_key.h"
 #include "BKE_subdiv.h"
+#include "BKE_subdiv_mesh.h"
 
 #include "MEM_guardedalloc.h"
 
diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c
index 7e8dd06ce9b..f4c229cb701 100644
--- a/source/blender/blenkernel/intern/subdiv_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_mesh.c
@@ -27,7 +27,7 @@
  *  \ingroup bke
  */
 
-#include "BKE_subdiv.h"
+#include "BKE_subdiv_mesh.h"
 
 #include "atomic_ops.h"
 
@@ -42,6 +42,7 @@
 
 #include "BKE_mesh.h"
 #include "BKE_key.h"
+#include "BKE_subdiv.h"
 #include "BKE_subdiv_eval.h"
 #include "BKE_subdiv_foreach.h"
 
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index 24495efa08d..870d91282b6 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -46,6 +46,7 @@
 #include "BKE_multires.h"
 #include "BKE_modifier.h"
 #include "BKE_subdiv.h"
+#include "BKE_subdiv_mesh.h"
 #include "BKE_subsurf.h"
 
 #include "DEG_depsgraph_query.h"
diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c
index a6e85bfb813..f1205e4d36b 100644
--- a/source/blender/modifiers/intern/MOD_subsurf.c
+++ b/source/blender/modifiers/intern/MOD_subsurf.c
@@ -44,6 +44,7 @@
 #include "BKE_cdderivedmesh.h"
 #include "BKE_scene.h"
 #include "BKE_subdiv.h"
+#include "BKE_subdiv_mesh.h"
 #include "BKE_subsurf.h"
 
 #include "DEG_depsgraph.h"



More information about the Bf-blender-cvs mailing list