Modifiers: Simple Deform & Build, DerivedMesh → Mesh

This commit introduces `EditMeshData`. The fields in this struct are
extracted from `EditDerivedBMesh` into their own struct `EditMeshData`,
which can then also be used by the `Mesh` struct. This allows passing
deformed vertices efficiently to the draw routines.

The modifier code constructs a new Mesh instead of writing to ob->data;
even when ob->data is a CoW copy, it can still be used by different
objects and thus shouldn't be modified by a modifier.
This commit is contained in:
2018-04-19 11:03:58 +02:00
parent be4df85919
commit 7efc75c709
11 changed files with 374 additions and 183 deletions

View File

@@ -93,6 +93,14 @@ struct Mesh *BKE_mesh_copy(struct Main *bmain, const struct Mesh *me);
void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd);
void BKE_mesh_ensure_skin_customdata(struct Mesh *me);
struct Mesh * BKE_mesh_from_template(
struct Mesh *me_src,
int numVerts, int numEdges, int numTessFaces,
int numLoops, int numPolys);
bool BKE_mesh_ensure_edit_data(struct Mesh *me);
bool BKE_mesh_clear_edit_data(struct Mesh *me);
bool BKE_mesh_ensure_facemap_customdata(struct Mesh *me);
bool BKE_mesh_clear_facemap_customdata(struct Mesh *me);