diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-03 16:42:55 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-04 15:02:58 +0300 |
commit | d8a03c77d796db4ae2546fbcbe230dbf4846b0ea (patch) | |
tree | df3426bdeb08321f7654bfe0ca5f814469c2d384 /source/blender/modifiers | |
parent | 4880e2e75a860f4716e3122f5ae14f34f50a9452 (diff) |
Allocate/free meshes with generic library functions.
This avoids the need to use Mesh-specific functions, and makes allocation
and freeing easy oneliners.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_armature.c | 6 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_lattice.c | 4 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_mirror.c | 7 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_skin.c | 5 |
4 files changed, 9 insertions, 13 deletions
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index 488d04a1466..8e8b095d069 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -152,8 +152,7 @@ static void deformVertsEM( } if (!mesh) { - BKE_mesh_free(mesh_src); - MEM_freeN(mesh_src); + BKE_id_free(NULL, mesh_src); } } @@ -173,8 +172,7 @@ static void deformMatricesEM( amd->deformflag, NULL, amd->defgrp_name); if (!mesh) { - BKE_mesh_free(mesh_src); - MEM_freeN(mesh_src); + BKE_id_free(NULL, mesh_src); } } diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index 25f1ae1a687..87933558d86 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -41,6 +41,7 @@ #include "BKE_editmesh.h" #include "BKE_lattice.h" +#include "BKE_library.h" #include "BKE_library_query.h" #include "BKE_mesh.h" #include "BKE_modifier.h" @@ -129,8 +130,7 @@ static void deformVertsEM( deformVerts(md, ctx, mesh_src, vertexCos, numVerts); if (!mesh) { - BKE_mesh_free(mesh_src); - MEM_freeN(mesh_src); + BKE_id_free(NULL, mesh_src); } } diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 78a2f43c8e2..4edfbd43d7a 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -39,6 +39,7 @@ #include "BLI_math.h" +#include "BKE_library.h" #include "BKE_library_query.h" #include "BKE_mesh.h" #include "BKE_modifier.h" @@ -313,8 +314,7 @@ static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd, result = doMirrorOnAxis(mmd, ob, result, 1); if (tmp != mesh) { /* free intermediate results */ - BKE_mesh_free(tmp); - MEM_freeN(tmp); + BKE_id_free(NULL, tmp); } } if (mmd->flag & MOD_MIR_AXIS_Z) { @@ -322,8 +322,7 @@ static Mesh *mirrorModifier__doMirror(MirrorModifierData *mmd, result = doMirrorOnAxis(mmd, ob, result, 2); if (tmp != mesh) { /* free intermediate results */ - BKE_mesh_free(tmp); - MEM_freeN(tmp); + BKE_id_free(NULL, tmp); } } diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 080706c00c5..defb661d9d8 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -72,6 +72,7 @@ #include "BLI_bitmap.h" #include "BKE_deform.h" +#include "BKE_library.h" #include "BKE_mesh.h" #include "BKE_mesh_mapping.h" #include "BKE_modifier.h" @@ -1885,9 +1886,7 @@ static Mesh *final_skin(SkinModifierData *smd, Mesh *mesh) mesh = subdivide_base(mesh); result = base_skin(mesh, smd); - BKE_mesh_free(mesh); - MEM_freeN(mesh); - + BKE_id_free(NULL, mesh); return result; } |