Cleanup: remove some more DM usages...
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 26 Jun 2018 15:45:00 +0000 (17:45 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 27 Jun 2018 08:37:57 +0000 (10:37 +0200)
source/blender/blenkernel/intern/editmesh_tangent.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_runtime.c
source/blender/blenkernel/intern/mesh_validate.c

index 9e8b4fa87826e25a1686ad3bed0b271fb4e39ffa..4231ad54ea80b9ea5b69f7c2246e3fe8fdc8c2de 100644 (file)
@@ -25,7 +25,9 @@
 #include "BLI_math.h"
 #include "BLI_task.h"
 
-#include "BKE_DerivedMesh.h"
+#include "DNA_defs.h"
+#include "DNA_customdata_types.h"
+#include "DNA_meshdata_types.h"
 
 #include "BKE_mesh.h"
 #include "BKE_mesh_tangent.h"  /* for utility functions */
@@ -360,7 +362,7 @@ void BKE_editmesh_loop_tangent_calc(
                                mesh2tangent->face_as_quad_map = face_as_quad_map;
                                mesh2tangent->num_face_as_quad_map = num_face_as_quad_map;
 #endif
-                               mesh2tangent->precomputedFaceNormals = poly_normals;  /* dm->getPolyDataArray(dm, CD_NORMAL) */
+                               mesh2tangent->precomputedFaceNormals = poly_normals;
                                /* Note, we assume we do have tessellated loop normals at this point (in case it is object-enabled),
                                 * have to check this is valid...
                                 */
index bb4cf1c57536a4aec03201a42bdfe5da56a03ce4..b6eb26443ea4f8aef11d33c51d715acfe619c6b9 100644 (file)
@@ -40,6 +40,7 @@
 #include "DNA_curve_types.h"
 #include "DNA_group_types.h"
 #include "DNA_listBase.h"
+#include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_object_types.h"
 #include "DNA_object_force_types.h"
 #include "PIL_time.h"
 
 #include "BKE_anim.h"          /* needed for where_on_path */
+#include "BKE_bvhutils.h"
 #include "BKE_collection.h"
 #include "BKE_collision.h"
 #include "BKE_curve.h"
 #include "BKE_displist.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_cdderivedmesh.h"
 #include "BKE_effect.h"
 #include "BKE_global.h"
 #include "BKE_layer.h"
@@ -314,7 +314,7 @@ ListBase *BKE_effectors_create(
                        else if (weights->weight[ob->pd->forcefield] == 0.0f) {
                                continue;
                        }
-                       else if (ob->pd->shape == PFIELD_SHAPE_POINTS && !ob->derivedFinal) {
+                       else if (ob->pd->shape == PFIELD_SHAPE_POINTS && ob->runtime.mesh_eval == NULL) {
                                continue;
                        }
 
@@ -606,12 +606,10 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
                efd->size = 0.0f;
        }
        else if (eff->pd && eff->pd->shape==PFIELD_SHAPE_POINTS) {
-
-               if (eff->ob->derivedFinal) {
-                       DerivedMesh *dm = eff->ob->derivedFinal;
-
-                       dm->getVertCo(dm, *efd->index, efd->loc);
-                       dm->getVertNo(dm, *efd->index, efd->nor);
+               Mesh *me_eval = eff->ob->runtime.mesh_eval;
+               if (me_eval != NULL) {
+                       copy_v3_v3(efd->loc, me_eval->mvert[*efd->index].co);
+                       normal_short_to_float_v3(efd->nor, me_eval->mvert[*efd->index].no);
 
                        mul_m4_v3(eff->ob->obmat, efd->loc);
                        mul_mat3_m4_v3(eff->ob->obmat, efd->nor);
@@ -719,7 +717,8 @@ static void get_effector_tot(EffectorCache *eff, EffectorData *efd, EffectedPoin
        efd->index = p;
 
        if (eff->pd->shape == PFIELD_SHAPE_POINTS) {
-               *tot = eff->ob->derivedFinal ? eff->ob->derivedFinal->numVertData : 1;
+               Mesh *me_eval = eff->ob->runtime.mesh_eval;
+               *tot = me_eval != NULL ? me_eval->totvert : 1;
 
                if (*tot && eff->pd->forcefield == PFIELD_HARMONIC && point->index >= 0) {
                        *p = point->index % *tot;
index f502d7e394f514013bebba18b3076f21e87045fd..b13f45499f147b66bce93f22126036eb57ba0592 100644 (file)
 #include "DNA_object_types.h"
 #include "DNA_key_types.h"
 #include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
 
 #include "BLI_utildefines.h"
+#include "BLI_bitmap.h"
 #include "BLI_math.h"
 #include "BLI_linklist.h"
 #include "BLI_memarena.h"
@@ -43,7 +45,6 @@
 #include "BKE_animsys.h"
 #include "BKE_idcode.h"
 #include "BKE_main.h"
-#include "BKE_DerivedMesh.h"
 #include "BKE_global.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_runtime.h"
index 657cd3b6c5222dec00798d11e99e0a7a21fe1975..07c354559b85bc85fc73e19479c2b3882cc41f1e 100644 (file)
 #include "BKE_mesh.h"
 #include "BKE_mesh_runtime.h"
 
-#ifdef USE_DERIVEDMESH
-#include "BKE_DerivedMesh.h"
-#endif
-
 /* -------------------------------------------------------------------- */
 /** \name Mesh Runtime Struct Utils
  * \{ */
index 2b43d49a10f292b6b00bdb3dc573147792a8308d..62d8210d1470c5217adbd7e66c7da2ed2f168f82 100644 (file)
@@ -43,7 +43,6 @@
 #include "BLI_math_vector.h"
 
 #include "BKE_deform.h"
-#include "BKE_DerivedMesh.h"
 #include "BKE_mesh.h"
 
 #include "DEG_depsgraph.h"