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-30 12:34:08 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-30 13:04:06 +0300
commit72f4ac99c70b02e095cc9a71d501d6b1dc85ac3e (patch)
tree940c598d4efb2246eb7b523840e2b7337a59bc1b /source/blender/modifiers/intern/MOD_array.c
parente55c1a9b5a089f3c688a0b47cba363cb0d6f92d0 (diff)
Cleanup/fix wrong modifiers targets handling in COW context.
Modifiers stack only get COW/evaluated IDs, so no need to go auery again DEG for those. Further more, now unified handling of EditBMesh case (was done on case-by-case basis in a few modifiers, not all for some reason). We are still missing the ability to get final and cage deformed meshes when in Edit mode though, this is to be defined/implemented in depsgraph.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_array.c')
-rw-r--r--source/blender/modifiers/intern/MOD_array.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index e74d9087427..c1268157d58 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -49,6 +49,7 @@
#include "BKE_cdderivedmesh.h"
#include "BKE_displist.h"
#include "BKE_curve.h"
+#include "BKE_library.h"
#include "BKE_library_query.h"
#include "BKE_modifier.h"
#include "BKE_mesh.h"
@@ -373,6 +374,7 @@ static Mesh *arrayModifier_doArray(
int first_chunk_start, first_chunk_nverts, last_chunk_start, last_chunk_nverts;
Mesh *result, *start_cap_mesh = NULL, *end_cap_mesh = NULL;
+ bool start_cap_mesh_free, end_cap_mesh_free;
int *vgroup_start_cap_remap = NULL;
int vgroup_start_cap_remap_len = 0;
@@ -390,7 +392,7 @@ static Mesh *arrayModifier_doArray(
vgroup_start_cap_remap = BKE_object_defgroup_index_map_create(
amd->start_cap, ctx->object, &vgroup_start_cap_remap_len);
- start_cap_mesh = BKE_modifier_get_evaluated_mesh_from_object(ctx, amd->start_cap);
+ start_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(amd->start_cap, &start_cap_mesh_free);
if (start_cap_mesh) {
start_cap_nverts = start_cap_mesh->totvert;
start_cap_nedges = start_cap_mesh->totedge;
@@ -402,7 +404,7 @@ static Mesh *arrayModifier_doArray(
vgroup_end_cap_remap = BKE_object_defgroup_index_map_create(
amd->end_cap, ctx->object, &vgroup_end_cap_remap_len);
- end_cap_mesh = BKE_modifier_get_evaluated_mesh_from_object(ctx, amd->end_cap);
+ end_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(amd->end_cap, &end_cap_mesh_free);
if (end_cap_mesh) {
end_cap_nverts = end_cap_mesh->totvert;
end_cap_nedges = end_cap_mesh->totedge;
@@ -737,6 +739,12 @@ static Mesh *arrayModifier_doArray(
if (vgroup_end_cap_remap) {
MEM_freeN(vgroup_end_cap_remap);
}
+ if (start_cap_mesh != NULL && start_cap_mesh_free) {
+ BKE_id_free(NULL, start_cap_mesh);
+ }
+ if (end_cap_mesh != NULL && end_cap_mesh_free) {
+ BKE_id_free(NULL, end_cap_mesh);
+ }
return result;
}