diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-13 06:31:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-13 08:41:57 +0300 |
commit | 494560f19dacd8cc8dd58113a079980a759a3195 (patch) | |
tree | 390d24594bb9e32af2e2e63577cc111928ff49d6 /source/blender | |
parent | a45f2fd1fbf34c5fef62d22fd3d377e0916b06d3 (diff) |
Cleanup: remove unused struct members from dupli-face/vert
Replace the evaluated mesh with VertexDupliData.mvert since only
vertices are used. This makes dupli-vert similar to how dupli-face
was already working.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index b1c141756e5..db38740c640 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -380,9 +380,9 @@ static const DupliGenerator gen_dupli_collection = { * \{ */ typedef struct VertexDupliData { - Mesh *me_eval; - BMEditMesh *edit_mesh; int totvert; + const MVert *mvert; + const float (*orco)[3]; bool use_rotation; @@ -452,15 +452,14 @@ static void vertex_dupli(const VertexDupliData *vdd, static void make_child_duplis_verts(const DupliContext *ctx, void *userdata, Object *child) { VertexDupliData *vdd = userdata; - Mesh *me_eval = vdd->me_eval; vdd->inst_ob = child; invert_m4_m4(child->imat, child->obmat); /* Relative transform from parent to child space. */ mul_m4_m4m4(vdd->child_imat, child->imat, ctx->object->obmat); - const MVert *mv = me_eval->mvert; - for (int i = 0; i < me_eval->totvert; i++, mv++) { + const MVert *mv = vdd->mvert; + for (int i = 0; i < vdd->totvert; i++, mv++) { const float no[3] = {mv->no[0], mv->no[1], mv->no[2]}; vertex_dupli(vdd, i, mv->co, no); } @@ -482,14 +481,12 @@ static void make_duplis_verts(const DupliContext *ctx) } { - vdd.me_eval = me_eval; vdd.orco = CustomData_get_layer(&me_eval->vdata, CD_ORCO); + vdd.mvert = me_eval->mvert; vdd.totvert = me_eval->totvert; } make_child_duplis(ctx, &vdd, make_child_duplis_verts); - - vdd.me_eval = NULL; } static const DupliGenerator gen_dupli_verts = { @@ -636,7 +633,6 @@ static const DupliGenerator gen_dupli_verts_font = { * \{ */ typedef struct FaceDupliData { - Mesh *me_eval; int totface; const MPoly *mpoly; const MLoop *mloop; @@ -759,7 +755,6 @@ static void make_duplis_faces(const DupliContext *ctx) } { - fdd.me_eval = me_eval; fdd.orco = CustomData_get_layer(&me_eval->vdata, CD_ORCO); const int uv_idx = CustomData_get_render_layer(&me_eval->ldata, CD_MLOOPUV); fdd.mloopuv = CustomData_get_layer_n(&me_eval->ldata, CD_MLOOPUV, uv_idx); @@ -771,8 +766,6 @@ static void make_duplis_faces(const DupliContext *ctx) } make_child_duplis(ctx, &fdd, make_child_duplis_faces); - - fdd.me_eval = NULL; } static const DupliGenerator gen_dupli_faces = { |