[Bf-blender-cvs] [8cc7969] alembic_pointcache: In preparation for removing the point cache memory frame storage, set all point caches to 'unbaked' to enfore rebaking.
Lukas Tönne
noreply at git.blender.org
Thu Oct 16 16:53:27 CEST 2014
Commit: 8cc7969925e977d5741a0d62e6b4b4f77066cd33
Author: Lukas Tönne
Date: Wed Nov 27 11:34:02 2013 +0100
Branches: alembic_pointcache
https://developer.blender.org/rB8cc7969925e977d5741a0d62e6b4b4f77066cd33
In preparation for removing the point cache memory frame storage, set
all point caches to 'unbaked' to enfore rebaking.
===================================================================
M source/blender/blenkernel/BKE_blender.h
M source/blender/blenloader/intern/readfile.c
M source/blender/blenloader/intern/versioning_legacy.c
M source/blender/makesdna/DNA_pointcache_types.h
===================================================================
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index aa6932a..d1e9509 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 269
-#define BLENDER_SUBVERSION 5
+#define BLENDER_SUBVERSION 6
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
#define BLENDER_MINVERSION 262
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 67060c7..0b5f3f2 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7426,6 +7426,54 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
blo_do_versions_250(fd, lib, main);
blo_do_versions_260(fd, lib, main);
+ /* memcache has been removed, clear BAKED flags to enforce rebaking */
+ if (!PTCACHE_VERSION_REMOVE_MEMCACHE(main)) {
+ Object *ob;
+ Scene *sce;
+ for (ob = main->object.first; ob; ob = ob->id.next) {
+ ModifierData *md;
+ ParticleSystem *psys;
+ for (md = ob->modifiers.first; md; md = md->next) {
+ if (md->type == eModifierType_Fluidsim) {
+ FluidsimModifierData *fluidmd = (FluidsimModifierData *)md;
+ fluidmd->point_cache->flag &= ~PTCACHE_BAKED;
+ }
+ else if (md->type == eModifierType_Smoke) {
+ SmokeModifierData *smd = (SmokeModifierData *)md;
+ if (smd->type & MOD_SMOKE_TYPE_DOMAIN) {
+ smd->domain->point_cache[0]->flag &= ~PTCACHE_BAKED;
+ }
+ }
+ else if (md->type == eModifierType_Cloth) {
+ ClothModifierData *clmd = (ClothModifierData *) md;
+ clmd->point_cache->flag &= ~PTCACHE_BAKED;
+ }
+ else if (md->type == eModifierType_DynamicPaint) {
+ DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
+
+ if (pmd->canvas) {
+ DynamicPaintSurface *surface;
+ for (surface=pmd->canvas->surfaces.first; surface; surface=surface->next)
+ surface->pointcache->flag &= ~PTCACHE_BAKED;
+ }
+ }
+ }
+
+ if (ob->soft) {
+ ob->soft->pointcache->flag &= ~PTCACHE_BAKED;
+ }
+
+ for (psys = ob->particlesystem.first; psys; psys = psys->next) {
+ psys->pointcache->flag &= ~PTCACHE_BAKED;
+ }
+ }
+ for (sce = main->scene.first; sce; sce = sce->id.next) {
+ RigidBodyWorld *rbw = sce->rigidbody_world;
+ if (rbw)
+ rbw->pointcache->flag &= ~PTCACHE_BAKED;
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init see do_versions_userdef() above! */
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index 75123bd..0801825 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -2770,13 +2770,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ob->soft->pointcache = BKE_ptcache_new();
for (psys = ob->particlesystem.first; psys; psys = psys->next) {
- if (psys->pointcache) {
- if (psys->pointcache->flag & PTCACHE_BAKED && (psys->pointcache->flag & PTCACHE_DISK_CACHE) == 0) {
- printf("Old memory cache isn't supported for particles, so re-bake the simulation!\n");
- psys->pointcache->flag &= ~PTCACHE_BAKED;
- }
- }
- else
+ if (!psys->pointcache)
psys->pointcache = BKE_ptcache_new();
}
diff --git a/source/blender/makesdna/DNA_pointcache_types.h b/source/blender/makesdna/DNA_pointcache_types.h
index 16a87af..a6f5bb0 100644
--- a/source/blender/makesdna/DNA_pointcache_types.h
+++ b/source/blender/makesdna/DNA_pointcache_types.h
@@ -34,6 +34,11 @@
#include "DNA_defs.h"
+/* XXX TODO point cache do_versions
+ * This needs to be updated until officially included in master
+ */
+#define PTCACHE_VERSION_REMOVE_MEMCACHE(main) MAIN_VERSION_ATLEAST(main, 269, 6)
+
/* Point cache file data types:
* - used as (1<<flag) so poke jahka if you reach the limit of 15
* - to add new data types update:
More information about the Bf-blender-cvs
mailing list