Fix compilation error with legacy depsgraph disabled
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 Jan 2017 17:08:41 +0000 (18:08 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 23 Jan 2017 17:08:41 +0000 (18:08 +0100)
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/intern/MOD_cloth.c
source/blender/modifiers/intern/MOD_dynamicpaint.c
source/blender/modifiers/intern/MOD_smoke.c
source/blender/modifiers/intern/MOD_softbody.c

index b8ebb375a484d56d3f044243548a57854298401e..bacfc177432a60e515142995f766ba6f0e14134c 100644 (file)
@@ -113,6 +113,10 @@ set(SRC
        intern/MOD_weightvg_util.h
 )
 
+if(WITH_LEGACY_DEPSGRAPH)
+       add_definitions(-DWITH_LEGACY_DEPSGRAPH)
+endif()
+
 if(WITH_ALEMBIC)
        add_definitions(-DWITH_ALEMBIC)
        list(APPEND INC
index d15a6fcb1c8020927600b5f4e58122dc33954da5..ac75b4dbee910a65fd70e92331a89b849cf4041f 100644 (file)
@@ -125,9 +125,15 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
        
        if (clmd) {
                /* Actual code uses get_collisionobjects */
+#ifdef WITH_LEGACY_DEPSGRAPH
                dag_add_collision_relations(forest, scene, ob, obNode, clmd->coll_parms->group, ob->lay|scene->lay, eModifierType_Collision, NULL, true, "Cloth Collision");
-
                dag_add_forcefield_relations(forest, scene, ob, obNode, clmd->sim_parms->effector_weights, true, 0, "Cloth Field");
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }
 
index bde20e56748e3ee3f93dc403743bda5a4362cec6..b49a407da780346530d491fb233eebcdec3f1476 100644 (file)
@@ -129,6 +129,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 
        /* add relation from canvases to all brush objects */
        if (pmd && pmd->canvas) {
+#ifdef WITH_LEGACY_DEPSGRAPH
                for (DynamicPaintSurface *surface = pmd->canvas->surfaces.first; surface; surface = surface->next) {
                        if (surface->effect & MOD_DPAINT_EFFECT_DO_DRIP) {
                                dag_add_forcefield_relations(forest, scene, ob, obNode, surface->effector_weights, true, 0, "Dynamic Paint Field");
@@ -137,6 +138,12 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
                        /* Actual code uses custom loop over group/scene without layer checks in dynamicPaint_doStep */
                        dag_add_collision_relations(forest, scene, ob, obNode, surface->brush_group, -1, eModifierType_DynamicPaint, is_brush_cb, false, "Dynamic Paint Brush");
                }
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }
 
index f04d7432a8f44da9a33995fa0e6e5007c23e16d1..a7b23ae24036701888c767c26158fd614919633b 100644 (file)
@@ -138,10 +138,16 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
 
        if (smd && (smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) {
                /* Actual code uses get_collisionobjects */
+#ifdef WITH_LEGACY_DEPSGRAPH
                dag_add_collision_relations(forest, scene, ob, obNode, smd->domain->fluid_group, ob->lay|scene->lay, eModifierType_Smoke, is_flow_cb, true, "Smoke Flow");
                dag_add_collision_relations(forest, scene, ob, obNode, smd->domain->coll_group, ob->lay|scene->lay, eModifierType_Smoke, is_coll_cb, true, "Smoke Coll");
-
                dag_add_forcefield_relations(forest, scene, ob, obNode, smd->domain->effector_weights, true, PFIELD_SMOKEFLOW, "Smoke Force Field");
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }
 
index 17adc7f1520a5cd5cb54a1a660f0733c05519b02..a0bbe5da04ae8f672e6d31e7fe1f203345b9a83e 100644 (file)
@@ -67,10 +67,17 @@ static void updateDepgraph(ModifierData *UNUSED(md), DagForest *forest,
                            Scene *scene, Object *ob, DagNode *obNode)
 {
        if (ob->soft) {
+#ifdef WITH_LEGACY_DEPSGRAPH
                /* Actual code uses ccd_build_deflector_hash */
                dag_add_collision_relations(forest, scene, ob, obNode, ob->soft->collision_group, ob->lay, eModifierType_Collision, NULL, false, "Softbody Collision");
 
                dag_add_forcefield_relations(forest, scene, ob, obNode, ob->soft->effector_weights, true, 0, "Softbody Field");
+#else
+       (void)forest;
+       (void)scene;
+       (void)ob;
+       (void)obNode;
+#endif
        }
 }