diff options
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 17 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 10 |
2 files changed, 10 insertions, 17 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d2ca8471d82..6e3f90588bc 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -53,7 +53,6 @@ #include "BLI_utildefines.h" #include "BKE_context.h" -#include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_object.h" #include "BKE_library.h" @@ -3532,7 +3531,7 @@ static void intersect_dm_quad_weights(const float v1[3], const float v2[3], cons interp_weights_poly_v3(w, vert, 4, co); } -/* check intersection with a derivedmesh */ +/** Check intersection with an evaluated mesh. */ static int particle_intersect_mesh(Depsgraph *depsgraph, Scene *scene, Object *ob, Mesh *mesh, float *vert_cos, const float co1[3], const float co2[3], @@ -3549,18 +3548,16 @@ static int particle_intersect_mesh(Depsgraph *depsgraph, Scene *scene, Object *o if (mesh == NULL) { psys_disable_all(ob); - /* TODO(Sybren): port to Mesh when we have decided how to handle derivedFinal and derivedDeform */ - DerivedMesh *dm = mesh_get_derived_final(depsgraph, scene, ob, 0); - if (dm == NULL) - dm = mesh_get_derived_deform(depsgraph, scene, ob, 0); + mesh = mesh_get_eval_final(depsgraph, scene, ob, CD_MASK_BAREMESH); + if (mesh == NULL) { + mesh = mesh_get_eval_deform(depsgraph, scene, ob, CD_MASK_BAREMESH); + } psys_enable_all(ob); - if (dm == NULL) + if (mesh == NULL) { return 0; - - mesh = BKE_id_new_nomain(ID_ME, NULL); - DM_to_mesh(dm, mesh, ob, CD_MASK_EVERYTHING, false); + } } /* BMESH_ONLY, deform dm may not have tessface */ diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 8a9eb369e66..e531836d744 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -43,9 +43,8 @@ #include "BLI_utildefines.h" #include "BLI_string.h" +#include "BKE_bvhutils.h" #include "BKE_context.h" -#include "BKE_DerivedMesh.h" -#include "BKE_cdderivedmesh.h" #include "BKE_global.h" #include "BKE_library.h" #include "BKE_main.h" @@ -1046,11 +1045,8 @@ static bool copy_particle_systems_to_object(const bContext *C, */ psys_start = totpsys > 0 ? tmp_psys[0] : NULL; - /* get the DM (psys and their modifiers have not been appended yet) */ - /* TODO(Sybren): use mesh_eval instead */ - DerivedMesh *final_dm = mesh_get_derived_final(depsgraph, scene, ob_to, cdmask); - final_mesh = BKE_id_new_nomain(ID_ME, NULL); - DM_to_mesh(final_dm, final_mesh, ob_to, CD_MASK_EVERYTHING, false); + /* Get the evaluated mesh (psys and their modifiers have not been appended yet) */ + final_mesh = mesh_get_eval_final(depsgraph, scene, ob_to, cdmask); /* now append psys to the object and make modifiers */ for (i = 0, psys_from = PSYS_FROM_FIRST; |