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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-02-18 22:00:23 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-03-13 15:46:55 +0300
commita1a7317f6b098ab6928f33754e57de219877cb64 (patch)
treed14b44056f99d292567fe82c39d6f8d14e6f634d /source/blender/editors/object
parent2ef2f085fb743c12d1cabd71d42dd00334de696b (diff)
Add argument to DM_to_mesh() function to take ownership over the DM
The idea is pretty simple: instead of making temporary copy of all the related custom data layers just pass the ownership from the DM to the mesh. This is really handy in cases when you've got DM which you need to convert to Mesh datablock and wouldn't need that DM after conversion anyway. Foe example, render database conversion, exporters and even Modifier Apply will benefit from this option. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D1127
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.c3
-rw-r--r--source/blender/editors/object/object_modifier.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index db7cd991338..99b351561c7 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1700,11 +1700,10 @@ static int convert_exec(bContext *C, wmOperator *op)
dm = mesh_get_derived_final(scene, newob, CD_MASK_MESH);
// dm = mesh_create_derived_no_deform(ob1, NULL); /* this was called original (instead of get_derived). man o man why! (ton) */
- DM_to_mesh(dm, newob->data, newob, CD_MASK_MESH);
+ DM_to_mesh(dm, newob->data, newob, CD_MASK_MESH, true);
/* re-tessellation is called by DM_to_mesh */
- dm->release(dm);
BKE_object_free_modifiers(newob); /* after derivedmesh calls! */
}
else if (ob->type == OB_FONT) {
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index bed85444101..710cf2dbdd2 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -614,9 +614,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
return 0;
}
- DM_to_mesh(dm, me, ob, CD_MASK_MESH);
-
- dm->release(dm);
+ DM_to_mesh(dm, me, ob, CD_MASK_MESH, true);
if (md->type == eModifierType_Multires)
multires_customdata_delete(me);