From ac077f016d3667a3b15853ac79b272cb0b6fd661 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 10 Jan 2014 02:10:43 +0600 Subject: Remove direct displist creation from array modifier First of all, it was needed to have that set scenes fix which was done recently so curve is being evaluated properly on file load. And last but not least, also needed to tag DAG node to evaluate path regardless to curve datablock settings so curve length is always known. --- source/blender/modifiers/intern/MOD_array.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source/blender/modifiers/intern') diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 80caa384086..77fa7d8c3f0 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -125,6 +125,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, } if (amd->curve_ob) { DagNode *curNode = dag_get_node(forest, amd->curve_ob); + curNode->eval_flags |= DAG_EVAL_NEED_CURVE_PATH; dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Array Modifier"); @@ -321,7 +322,7 @@ static void merge_first_last(BMesh *bm, } static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, - Scene *scene, Object *ob, DerivedMesh *dm, + Object *ob, DerivedMesh *dm, ModifierApplyFlag flag) { DerivedMesh *result; @@ -376,10 +377,6 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if (amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) { Curve *cu = amd->curve_ob->data; if (cu) { - if (!amd->curve_ob->curve_cache || !amd->curve_ob->curve_cache->path) { - cu->flag |= CU_PATH; // needed for path & bevlist - BKE_displist_make_curveTypes(scene, amd->curve_ob, 0); - } if (amd->curve_ob->curve_cache->path) { float scale = mat4_to_scale(amd->curve_ob->obmat); length = scale * amd->curve_ob->curve_cache->path->totdist; @@ -578,7 +575,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *result; ArrayModifierData *amd = (ArrayModifierData *) md; - result = arrayModifier_doArray(amd, md->scene, ob, dm, flag); + result = arrayModifier_doArray(amd, ob, dm, flag); return result; } -- cgit v1.2.3