Moved function declarations from BKE_DerivedMesh.h to BKE_mesh_runtime.h
authorSybren A. Stüvel <sybren@stuvel.eu>
Tue, 5 Jun 2018 14:58:08 +0000 (16:58 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Tue, 5 Jun 2018 14:59:25 +0000 (16:59 +0200)
The function definitions still reside in DerivedMesh.c. Once we're done
porting all the DerivedMesh use to Mesh, we'll move the still-relevant
functions to mesh_runtime.c. This move is now cumbersome due to shared
statically-declared utility functions in DerivedMesh.c

25 files changed:
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_mesh_runtime.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/data_transfer.c
source/blender/blenkernel/intern/mesh_convert.c
source/blender/blenkernel/intern/mesh_runtime.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/object_dupli.c
source/blender/blenkernel/intern/paint.c
source/blender/editors/armature/armature_skinning.c
source/blender/editors/mesh/editmesh_knife_project.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_data_transfer.c
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/sculpt_paint/paint_hide.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_vertex_proj.c
source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_iterators.c

index e918f158682e7b5f2813413c5a69036112a27c1d..79b0e5eb95fe4ffd950faee37838ed87da471430 100644 (file)
@@ -531,18 +531,6 @@ DMCoNo *mesh_get_mapped_verts_nors(struct Scene *scene, struct Object *ob);
 void mesh_get_mapped_verts_coords(DerivedMesh *dm, float (*r_cos)[3], const int totcos);
 
 /* */
-DerivedMesh *mesh_get_derived_final(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, CustomDataMask dataMask);
-struct Mesh *mesh_get_eval_final(
-        struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, CustomDataMask dataMask);
-
-DerivedMesh *mesh_get_derived_deform(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, CustomDataMask dataMask);
-struct Mesh *mesh_get_eval_deform(
-        struct Depsgraph *depsgraph, struct Scene *scene,
-        struct Object *ob, CustomDataMask dataMask);
 
 DerivedMesh *mesh_create_derived_for_modifier(
         struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob,
index beca4f9db5a3e19c61f7da0965a15fbc09fe06a0..da11eb81267b8b9ab744484c23316a2fcbdb8f3b 100644 (file)
  * This file contains access functions for the Mesh.runtime struct.
  */
 
+#include "BKE_customdata.h"  /* for CustomDataMask */
+
+struct Depsgraph;
 struct Mesh;
 struct MLoop;
 struct MLoopTri;
 struct MVertTri;
+struct Object;
+struct Scene;
+
+/* Undefine to hide DerivedMesh-based function declarations */
+#define WITH_DERIVEDMESH
+
+#ifdef WITH_DERIVEDMESH
+struct DerivedMesh;
+#endif
 
 void BKE_mesh_runtime_reset(struct Mesh *mesh);
 int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
@@ -51,5 +63,23 @@ void BKE_mesh_runtime_verttri_from_looptri(
         struct MVertTri *r_verttri,
         const struct MLoop *mloop, const struct MLoopTri *looptri, int looptri_num);
 
+/* NOTE: the functions below are defined in DerivedMesh.c, and are intended to be moved
+ * to a more suitable location when that file is removed. */
+#ifdef WITH_DERIVEDMESH
+struct DerivedMesh *mesh_get_derived_final(
+        struct Depsgraph *depsgraph, struct Scene *scene,
+        struct Object *ob, CustomDataMask dataMask);
+#endif
+struct Mesh *mesh_get_eval_final(
+        struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, CustomDataMask dataMask);
+
+#ifdef WITH_DERIVEDMESH
+struct DerivedMesh *mesh_get_derived_deform(
+        struct Depsgraph *depsgraph, struct Scene *scene,
+        struct Object *ob, CustomDataMask dataMask);
+#endif
+struct Mesh *mesh_get_eval_deform(
+        struct Depsgraph *depsgraph, struct Scene *scene,
+        struct Object *ob, CustomDataMask dataMask);
 
 #endif /* __BKE_MESH_RUNTIME_H__ */
index 1c12b73dff938dd0fbe9d150f0a1d1d4111ba3bb..e7e434042dd652d1190f6fe2958c1478b7cc97e7 100644 (file)
@@ -3105,6 +3105,7 @@ void makeDerivedMesh(
 
 /***/
 
+#ifdef WITH_DERIVEDMESH
 /* Deprecated DM, use: 'mesh_get_eval_final'. */
 DerivedMesh *mesh_get_derived_final(
         struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
@@ -3125,6 +3126,7 @@ DerivedMesh *mesh_get_derived_final(
        if (ob->derivedFinal) { BLI_assert(!(ob->derivedFinal->dirty & DM_DIRTY_NORMALS)); }
        return ob->derivedFinal;
 }
+#endif
 Mesh *mesh_get_eval_final(
         struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
 {
@@ -3145,6 +3147,7 @@ Mesh *mesh_get_eval_final(
        return ob->runtime.mesh_eval;
 }
 
+#ifdef WITH_DERIVEDMESH
 /* Deprecated DM, use: 'mesh_get_eval_deform' instead. */
 DerivedMesh *mesh_get_derived_deform(struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
 {
@@ -3164,6 +3167,7 @@ DerivedMesh *mesh_get_derived_deform(struct Depsgraph *depsgraph, Scene *scene,
 
        return ob->derivedDeform;
 }
+#endif
 Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph, Scene *scene, Object *ob, CustomDataMask dataMask)
 {
        /* if there's no derived mesh or the last data mask used doesn't include
index 0451031c5b818d8434287244eaebdd9bba08f193..3639649eab564ee730de66bd9fee1da4bbf75fd4 100644 (file)
@@ -50,6 +50,7 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_mesh_remap.h"
 #include "BKE_object.h"
 #include "BKE_object_deform.h"
index a3eef7b17b2513946e4424e18c48d69aa59b83d2..9773a487b46c13f3b70ec24a347e8117e801ecc1 100644 (file)
@@ -43,6 +43,7 @@
 #include "BKE_global.h"
 #include "BKE_key.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
 #include "BKE_displist.h"
 #include "BKE_library.h"
index 86d3cf7a0c8f8babf89db5dd2aac39f78e79c58c..2109a465c55bdebb9453ea0fa8586fd1262df158 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
 
 #include "BLI_math_geom.h"
 #include "BLI_threads.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_runtime.h"
 
+#ifdef WITH_DERIVEDMESH
+#include "BKE_DerivedMesh.h"
+#endif
+
 /* -------------------------------------------------------------------- */
 /** \name Mesh Runtime Struct Utils
  * \{ */
index ee32c2398b2d5814cfff058c726f00776e1224d6..39a472241bcf4e79a6589f89cd1191337686b6fa 100644 (file)
@@ -51,6 +51,7 @@
 #include "BKE_cdderivedmesh.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
 #include "BKE_multires.h"
 #include "BKE_paint.h"
index 2c94dc76854dfe2f4238a9018e30eb751b5bab7d..01b26600403a4793aa82424bb962bc2d6237b4ee 100644 (file)
@@ -56,6 +56,7 @@
 #include "BKE_lattice.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_object.h"
 #include "BKE_particle.h"
 #include "BKE_scene.h"
index f961510984a4f8dc0d09bf9482da832671ee85e3..8dad89218beff11643d83201699ee0d05af6ab3a 100644 (file)
@@ -59,6 +59,7 @@
 #include "BKE_key.h"
 #include "BKE_library.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
 #include "BKE_object.h"
 #include "BKE_paint.h"
index 463e00957e6d9e8a2e4367b0f9eec817dff80064..87a66514417ba9541b5930d45c40bd08f0613820 100644 (file)
@@ -45,6 +45,7 @@
 #include "BKE_armature.h"
 #include "BKE_context.h"
 #include "BKE_deform.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_object_deform.h"
 #include "BKE_report.h"
 #include "BKE_subsurf.h"
index 5a61c5aab4849d1427f0a32488f68a36d2658776..5ccbcf063ad312cb89ab3f49027972b012d0792c 100644 (file)
@@ -40,6 +40,7 @@
 #include "BKE_curve.h"
 #include "BKE_cdderivedmesh.h"
 #include "BKE_editmesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_report.h"
 
 #include "DEG_depsgraph.h"
index 786b27ee81698b7ced57425ee74cf63793ce4516..41e1ca13b7915782685a10fe7f5303b26cb92b9f 100644 (file)
@@ -54,6 +54,7 @@
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_material.h"
 #include "BKE_object.h"
 #include "BKE_object_deform.h"
index d66a176ddfc838dca167d7c279a573217e288918..375891770374469a8e223ddcd2eedd68d0ebf169 100644 (file)
@@ -82,6 +82,7 @@
 #include "BKE_material.h"
 #include "BKE_mball.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_nla.h"
 #include "BKE_object.h"
 #include "BKE_particle.h"
index d4e8955b38ea25c52fb0011c700ca578be505f8e..db81c51cc90488910aa4abcc52f5047676a55d4c 100644 (file)
@@ -43,6 +43,7 @@
 #include "BKE_DerivedMesh.h"
 #include "BKE_mesh_mapping.h"
 #include "BKE_mesh_remap.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_object.h"
 #include "BKE_report.h"
 
index 28ab43d5def59fbcaa84f5ad5136b78a89755b92..469364b81a636ea6863c2b8103d0743c4cbed1b8 100644 (file)
@@ -63,6 +63,7 @@
 #include "BKE_main.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
 #include "BKE_multires.h"
 #include "BKE_report.h"
index e39d889d9d941505fe4cf411aaa979442576d7b9..84786024160c9ea82218b62a47a9358b63ed87ae 100644 (file)
@@ -58,6 +58,7 @@
 #include "BKE_customdata.h"
 #include "BKE_deform.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_editmesh.h"
 #include "BKE_layer.h"
 #include "BKE_modifier.h"
index c705434c509d15b6cb5bebb8f2be7bdf6e0e5cdf..de12d187c3be6dd3652dfab7c5b5350fc5bb87a5 100644 (file)
@@ -57,6 +57,7 @@
 #include "BKE_object.h"
 #include "BKE_library.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
 #include "BKE_particle.h"
 #include "BKE_report.h"
index 48a80cbbc1f3c8f02b1bef7dc3bdaee32a3a0bdd..fbccdcfcdbaf1dd53295ca8741938ab4b17dd2e9 100644 (file)
@@ -50,6 +50,7 @@
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
 #include "BKE_object.h"
 #include "BKE_particle.h"
index 3d4f6c05ff440470329232f930870841b5b38d27..b8bee42e53d8fb07f9c648ceb134b9a6b9fa2444 100644 (file)
@@ -48,6 +48,7 @@
 #include "BKE_context.h"
 #include "BKE_DerivedMesh.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_multires.h"
 #include "BKE_paint.h"
 #include "BKE_subsurf.h"
index 0e48596ca1a582eb45e6b213bffcaec264197a08..32355d41ada4fcd637dbfb089f7e9e7d2e0dcd0a 100644 (file)
@@ -74,6 +74,7 @@
 #include "BKE_material.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_node.h"
 #include "BKE_paint.h"
 #include "BKE_report.h"
index c5c9aa48760f224a418b98935ac6de47fbbee005..cacfdc2dbba833e95a57ec3cc8d5eeb85128e097 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "BKE_DerivedMesh.h"
 #include "BKE_context.h"
+#include "BKE_mesh_runtime.h"
 
 #include "DEG_depsgraph.h"
 
index e560a4cddffc11ee042855be724382fa81473c4a..7c2977a0788ab8fffafb3eda43a1707d9738db19 100644 (file)
@@ -52,6 +52,7 @@
 #include "BKE_deform.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
 #include "BKE_object_deform.h"
 #include "BKE_paint.h"
index fbdca27b0185331bb78dbdf24ebcb44370bec631..75bfa4fe344881e511914720a5e2d1de1321d329 100644 (file)
@@ -58,6 +58,7 @@
 #include "BKE_paint.h"
 #include "BKE_key.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_subsurf.h"
 #include "BKE_undo_system.h"
 
index 7de7aa77ba39a8c87799dfbc0e5748c3c54e99b7..1224c284d5f7a0cb2a7a45af709824e5544ce59a 100644 (file)
@@ -67,6 +67,7 @@
 #include "BKE_lattice.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_runtime.h"
 #include "BKE_material.h"
 #include "BKE_mball.h"
 #include "BKE_modifier.h"
index 145f57174fd48827e4677fb0bea133e2f1c575e5..eae0cf8e459aecd1ab5403bb7c11a55f3f0758fb 100644 (file)
@@ -42,6 +42,7 @@
 #include "BKE_displist.h"
 #include "BKE_editmesh.h"
 #include "BKE_context.h"
+#include "BKE_mesh_runtime.h"
 
 #include "DEG_depsgraph.h"
 #include "DEG_depsgraph_query.h"