Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-09 06:47:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-09 06:47:22 +0400
commite7e1bc4ca1bb1194f26d965270b76734d2cc91bd (patch)
treed3b838570038a07e91a3d7e810cab119b238f0df
parent43ec34f05483a57fd9d2c1488501f8936e5f2b56 (diff)
add foreachIDLink function for cloth, remove cloth specific newlibadr calls in readfile.
-rw-r--r--source/blender/blenloader/intern/readfile.c10
-rw-r--r--source/blender/modifiers/intern/MOD_cloth.c15
2 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 3987b082aeb..49579432de2 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3847,16 +3847,6 @@ static void lib_link_object(FileData *fd, Main *main)
}
}
- {
- ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth);
-
- if(clmd)
- {
- clmd->sim_parms->effector_weights->group = newlibadr(fd, ob->id.lib, clmd->sim_parms->effector_weights->group);
- clmd->coll_parms->group= newlibadr(fd, ob->id.lib, clmd->coll_parms->group);
- }
- }
-
/* texture field */
if(ob->pd)
lib_link_partdeflect(fd, &ob->id, ob->pd);
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 30ddb3f7b9c..1d2a6b2f788 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -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,
};