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:
authorSergej Reich <sergej.reich@googlemail.com>2013-01-23 09:56:34 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-01-23 09:56:34 +0400
commit089cf12435dfbc4b934a73b73ecd617b27ac678d (patch)
treee2c8b7b187694ca7ae4640b76634ddcba5644600 /source/blender/blenloader
parentfc377c17e3d4803ef4db7a72daae629a322ffde8 (diff)
rigidbody: Add point cache support
Add read/write/interpolate functions. In order to get rigid body point cache id from object it's now required to pass the scene to BKE_ptcache_ids_from_object(). Rigid body cache is drawn in the orange color of the bullet logo.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c6
-rw-r--r--source/blender/blenloader/intern/writefile.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b0f1d3f37ed..edb033e80f8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5303,6 +5303,12 @@ static void direct_link_scene(FileData *fd, Scene *sce)
rbw->effector_weights = newdataadr(fd, rbw->effector_weights);
if (!rbw->effector_weights)
rbw->effector_weights = BKE_add_effector_weights(NULL);
+
+ /* link cache */
+ direct_link_pointcache_list(fd, &rbw->ptcaches, &rbw->pointcache, FALSE);
+ /* make sure simulation starts from the beginning after loading file */
+ if (rbw->pointcache)
+ rbw->ltime = rbw->pointcache->startframe;
}
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index da50a05a3d9..ebd752c0118 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2307,6 +2307,7 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
if (sce->rigidbody_world) {
writestruct(wd, DATA, "RigidBodyWorld", 1, sce->rigidbody_world);
writestruct(wd, DATA, "EffectorWeights", 1, sce->rigidbody_world->effector_weights);
+ write_pointcaches(wd, &(sce->rigidbody_world->ptcaches));
}
sce= sce->id.next;