diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-01 18:33:04 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2018-05-01 19:02:17 +0300 |
commit | 334b55fd2e89d66023a499e1ce7f867d9789290d (patch) | |
tree | 3afcc711d6a9eeda85d9ae069ce1ac9cfc9fcb89 /source/blender/editors/object | |
parent | 6b9f1ffe6e56ee4d55f4cde5c724c31a3a90292b (diff) |
Extract common modifier parameters into ModifierEvalContext struct
The contents of the ModifierEvalContext struct are constant while iterating
over the modifier stack. The struct thus should be only created once, outside
any loop over the modifiers.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index a02e68e8a60..e2197c58d49 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -631,6 +631,7 @@ static int modifier_apply_obdata(ReportList *reports, Depsgraph *depsgraph, Scen Curve *cu; int numVerts; float (*vertexCos)[3]; + ModifierEvalContext mectx = {depsgraph, ob, 0}; if (ELEM(mti->type, eModifierTypeType_Constructive, eModifierTypeType_Nonconstructive)) { BKE_report(reports, RPT_ERROR, "Cannot apply constructive modifiers on curve"); @@ -641,7 +642,7 @@ static int modifier_apply_obdata(ReportList *reports, Depsgraph *depsgraph, Scen BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tessellated/bevel vertices"); vertexCos = BKE_curve_nurbs_vertexCos_get(&cu->nurb, &numVerts); - modifier_deformVerts_DM_deprecated(md, depsgraph, ob, NULL, vertexCos, numVerts, 0); + modifier_deformVerts_DM_deprecated(md, &mectx, NULL, vertexCos, numVerts); BK_curve_nurbs_vertexCos_apply(&cu->nurb, vertexCos); MEM_freeN(vertexCos); |