diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-27 12:34:45 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-28 12:06:31 +0300 |
commit | 0bf33a1e33805580e77fe9c13a15f8c67c909906 (patch) | |
tree | 8a09b0533d1dbbe954f61cbc5bdb272c5baea8c4 /source/blender/editors/physics/particle_object.c | |
parent | d125e777b330921067ac06d14d8cf271f2f00def (diff) |
Cleanup: Nuke DM out of particle edit code.
Note that this commit also fixes serious memory leaks, temp Mesh
generated out of Main from the DM were never freed here!
Diffstat (limited to 'source/blender/editors/physics/particle_object.c')
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 10 |
1 files changed, 3 insertions, 7 deletions
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; |