diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-04-19 12:03:58 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-01 19:02:17 +0300 |
commit | 7efc75c7092b085fe3f5ef2dcab3669d466dfadc (patch) | |
tree | cbadfa4924b27dbd39f362025538857983c60d6d /source/blender/makesdna/DNA_mesh_types.h | |
parent | be4df85919b42cb2cf8a01c904a8552c5c173944 (diff) |
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.
Diffstat (limited to 'source/blender/makesdna/DNA_mesh_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 505b1f7157b..e8790a86fc5 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -52,6 +52,19 @@ struct Material; struct Mesh; struct Multires; +# +# +typedef struct EditMeshData { + /** when set, \a vertexNos, polyNos are lazy initialized */ + const float (*vertexCos)[3]; + + /** lazy initialize (when \a vertexCos is set) */ + float const (*vertexNos)[3]; + float const (*polyNos)[3]; + /** also lazy init but dont depend on \a vertexCos */ + const float (*polyCos)[3]; +} EditMeshData; + typedef struct Mesh { ID id; struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ @@ -87,6 +100,7 @@ typedef struct Mesh { /* When the object is available, the preferred access method is: BKE_editmesh_from_object(ob) */ struct BMEditMesh *edit_btmesh; /* not saved in file! */ + struct EditMeshData *emd; /* not saved in file! */ struct CustomData vdata, edata, fdata; |