add foreachIDLink function for cloth, remove cloth specific newlibadr calls in readfile.
[blender-staging.git] / source / blender / modifiers / intern / MOD_cloth.c
index 30ddb3f7b9c3ab5d873e0a0d604db6d4e5078ac7..1d2a6b2f7882c6bcf14da3238a3fc9ec840baf94 100644 (file)
@@ -190,6 +190,19 @@ static void freeData(ModifierData *md)
        }
 }
 
+static void foreachIDLink(ModifierData *md, Object *ob,
+                                          IDWalkFunc walk, void *userData)
+{
+       ClothModifierData *clmd = (ClothModifierData*) md;
+
+       if(clmd->coll_parms) {
+               walk(userData, ob, (ID **)&clmd->coll_parms->group);
+       }
+
+       if(clmd->sim_parms && clmd->sim_parms->effector_weights) {
+               walk(userData, ob, (ID **)&clmd->sim_parms->effector_weights->group);
+       }
+}
 
 ModifierTypeInfo modifierType_Cloth = {
        /* name */              "Cloth",
@@ -215,5 +228,5 @@ ModifierTypeInfo modifierType_Cloth = {
        /* dependsOnTime */     dependsOnTime,
        /* dependsOnNormals */  NULL,
        /* foreachObjectLink */ NULL,
-       /* foreachIDLink */     NULL,
+       /* foreachIDLink */     foreachIDLink,
 };