Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-04 16:26:02 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-04 16:26:02 +0300
commit10fb83e3f06f80a2e6ec19c4f46f41721e2142a6 (patch)
tree313df01965355532ae462f2bf06aa9b044d1a4dd /source/blender/blenkernel/intern/modifier.c
parent49407122ea6852704a43cc2df5de0f5179758491 (diff)
parent0a79de526d41e9880ee9d4f4b25fabd0fecdb3a4 (diff)
Merge branch 'blender2.8' into tmp-static-override-insertion
Diffstat (limited to 'source/blender/blenkernel/intern/modifier.c')
-rw-r--r--source/blender/blenkernel/intern/modifier.c43
1 files changed, 15 insertions, 28 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 5153951d2a2..29a4fcbb9c7 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -60,6 +60,7 @@
#include "BKE_appdir.h"
#include "BKE_cdderivedmesh.h"
+#include "BKE_idcode.h"
#include "BKE_key.h"
#include "BKE_library.h"
#include "BKE_library_query.h"
@@ -1003,16 +1004,14 @@ void modifier_deformVerts_DM_deprecated(struct ModifierData *md, const ModifierE
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
- mesh = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh);
+ mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformVerts(md, ctx, mesh, vertexCos, numVerts);
if (mesh != NULL) {
- BKE_mesh_free(mesh);
- MEM_freeN(mesh);
+ BKE_id_free(NULL, mesh);
}
}
}
@@ -1031,16 +1030,14 @@ void modifier_deformMatrices_DM_deprecated(struct ModifierData *md, const Modifi
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
- mesh = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh);
+ mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformMatrices(md, ctx, mesh, vertexCos, defMats, numVerts);
if (mesh != NULL) {
- BKE_mesh_free(mesh);
- MEM_freeN(mesh);
+ BKE_id_free(NULL, mesh);
}
}
}
@@ -1058,16 +1055,14 @@ void modifier_deformVertsEM_DM_deprecated(struct ModifierData *md, const Modifie
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
- mesh = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh);
+ mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformVertsEM(md, ctx, editData, mesh, vertexCos, numVerts);
if (mesh != NULL) {
- BKE_mesh_free(mesh);
- MEM_freeN(mesh);
+ BKE_id_free(NULL, mesh);
}
}
}
@@ -1085,16 +1080,14 @@ void modifier_deformMatricesEM_DM_deprecated(struct ModifierData *md, const Modi
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
- mesh = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh);
+ mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
mti->deformMatricesEM(md, ctx, editData, mesh, vertexCos, defMats, numVerts);
if (mesh != NULL) {
- BKE_mesh_free(mesh);
- MEM_freeN(mesh);
+ BKE_id_free(NULL, mesh);
}
}
}
@@ -1111,8 +1104,7 @@ struct DerivedMesh *modifier_applyModifier_DM_deprecated(struct ModifierData *md
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
- mesh = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh);
+ mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
@@ -1122,12 +1114,10 @@ struct DerivedMesh *modifier_applyModifier_DM_deprecated(struct ModifierData *md
DerivedMesh *ndm = CDDM_from_mesh_ex(new_mesh, CD_DUPLICATE);
if(new_mesh != mesh) {
- BKE_mesh_free(new_mesh);
- MEM_freeN(new_mesh);
+ BKE_id_free(NULL, new_mesh);
}
if (mesh != NULL) {
- BKE_mesh_free(mesh);
- MEM_freeN(mesh);
+ BKE_id_free(NULL, mesh);
}
return ndm;
@@ -1147,8 +1137,7 @@ struct DerivedMesh *modifier_applyModifierEM_DM_deprecated(struct ModifierData *
/* TODO(sybren): deduplicate all the copies of this code in this file. */
Mesh *mesh = NULL;
if (dm != NULL) {
- mesh = BKE_libblock_alloc_notest(ID_ME);
- BKE_mesh_init(mesh);
+ mesh = BKE_id_new_nomain(ID_ME, NULL);
DM_to_mesh(dm, mesh, ctx->object, CD_MASK_EVERYTHING, false);
}
@@ -1158,12 +1147,10 @@ struct DerivedMesh *modifier_applyModifierEM_DM_deprecated(struct ModifierData *
DerivedMesh *ndm = CDDM_from_mesh_ex(new_mesh, CD_DUPLICATE);
if(new_mesh != mesh) {
- BKE_mesh_free(new_mesh);
- MEM_freeN(new_mesh);
+ BKE_id_free(NULL, new_mesh);
}
if (mesh != NULL) {
- BKE_mesh_free(mesh);
- MEM_freeN(mesh);
+ BKE_id_free(NULL, mesh);
}
return ndm;