Cleanup: remove some more DM usages...

This commit is contained in:
Bastien Montagne 2018-06-26 17:45:00 +02:00
parent c3544df207
commit 9c7a561883
5 changed files with 15 additions and 18 deletions

View 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...
*/

View 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"
@ -57,12 +58,11 @@
#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;

View File

@ -32,8 +32,10 @@
#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"

View File

@ -44,10 +44,6 @@
#include "BKE_mesh.h"
#include "BKE_mesh_runtime.h"
#ifdef USE_DERIVEDMESH
#include "BKE_DerivedMesh.h"
#endif
/* -------------------------------------------------------------------- */
/** \name Mesh Runtime Struct Utils
* \{ */

View 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"