diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2008-06-21 01:10:16 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2008-06-21 01:10:16 +0400 |
commit | 824eac5095924ffdc1fea213a925054c88bf05d7 (patch) | |
tree | fb6545989e9e4739dbe0b77e5922facdb91be60e /source/blender/blenkernel/intern/modifier.c | |
parent | 91f8ad839805a64364f2685a00cc8309688d2f44 (diff) |
Added cut-plane option.
Its now possible to project 2 planes over a model and get a cloth..
Tought it still has a few issues.. related with distance to kept from mesh.
Diffstat (limited to 'source/blender/blenkernel/intern/modifier.c')
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index cd65aace158..dfd76a9c9d4 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7022,6 +7022,9 @@ static void shrinkwrapModifier_initData(ModifierData *md) smd->shrinkOpts = MOD_SHRINKWRAP_ALLOW_DEFAULT_NORMAL; smd->keptDist = 0.0f; smd->mergeDist = 0.0f; + + smd->target = 0; + smd->cutPlane = 0; } static void shrinkwrapModifier_copyData(ModifierData *md, ModifierData *target) @@ -7045,6 +7048,7 @@ static void shrinkwrapModifier_foreachObjectLink(ModifierData *md, Object *ob, O ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; walk(userData, ob, &smd->target); + walk(userData, ob, &smd->cutPlane); } static DerivedMesh *shrinkwrapModifier_applyModifier(ModifierData *md, Object *ob, DerivedMesh *derivedData, int useRenderParams, int isFinalCalc) @@ -7061,12 +7065,11 @@ static void shrinkwrapModifier_updateDepgraph(ModifierData *md, DagForest *fores { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData*) md; - if (smd->target) { - DagNode *curNode = dag_get_node(forest, smd->target); + if (smd->target) + dag_add_relation(forest, dag_get_node(forest, smd->target), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); - dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, - "Shrinkwrap Modifier"); - } + if (smd->cutPlane) + dag_add_relation(forest, dag_get_node(forest, smd->cutPlane), obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Shrinkwrap Modifier"); } |