diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-10 00:10:43 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-13 13:57:51 +0400 |
commit | ac077f016d3667a3b15853ac79b272cb0b6fd661 (patch) | |
tree | b498339ba75b292fd5473fe5d6b7f544badaecec | |
parent | ce7e6cebf23a82c3bcc90f84765b32234f76bf1f (diff) |
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.
-rw-r--r-- | source/blender/modifiers/intern/MOD_array.c | 9 |
1 files changed, 3 insertions, 6 deletions
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; } |