From a1a7317f6b098ab6928f33754e57de219877cb64 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 19 Feb 2015 00:00:23 +0500 Subject: 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 --- source/blender/blenkernel/BKE_customdata.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenkernel/BKE_customdata.h') diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 9028ad09265..6a0cfefb1c2 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -96,6 +96,11 @@ bool CustomData_has_math(const struct CustomData *data); bool CustomData_has_interp(const struct CustomData *data); bool CustomData_bmesh_has_free(const struct CustomData *data); +/** + * Checks if any of the customdata layers is referenced. + */ +bool CustomData_has_referenced(const struct CustomData *data); + /* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to * another, while not overwriting anything else (e.g. flags). probably only * implemented for mloopuv/mloopcol, for now.*/ @@ -142,6 +147,9 @@ void CustomData_reset(struct CustomData *data); */ void CustomData_free(struct CustomData *data, int totelem); +/* same as above, but only frees layers which matches the given mask. */ +void CustomData_free_typemask(struct CustomData *data, int totelem, CustomDataMask mask); + /* frees all layers with CD_FLAG_TEMPORARY */ void CustomData_free_temporary(struct CustomData *data, int totelem); -- cgit v1.2.3