[Bf-blender-cvs] [aae656f] alembic_pointcache: Removed ListBase code for multiple point caches from blenkernel and RNA.
Lukas Tönne
noreply at git.blender.org
Thu Oct 16 16:53:23 CEST 2014
Commit: aae656f9a375de6e4fc46c17c277a940c9f950e4
Author: Lukas Tönne
Date: Tue Nov 26 16:31:36 2013 +0100
Branches: alembic_pointcache
https://developer.blender.org/rBaae656f9a375de6e4fc46c17c277a940c9f950e4
Removed ListBase code for multiple point caches from blenkernel and RNA.
===================================================================
M release/scripts/startup/bl_ui/properties_particle.py
M release/scripts/startup/bl_ui/properties_physics_common.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/blenkernel/BKE_object.h
M source/blender/blenkernel/BKE_pointcache.h
M source/blender/blenkernel/intern/dynamicpaint.c
M source/blender/blenkernel/intern/object.c
M source/blender/blenkernel/intern/particle.c
M source/blender/blenkernel/intern/pointcache.c
M source/blender/blenkernel/intern/rigidbody.c
M source/blender/blenkernel/intern/smoke.c
M source/blender/blenkernel/intern/softbody.c
M source/blender/blenloader/intern/versioning_legacy.c
M source/blender/blenloader/intern/writefile.c
M source/blender/editors/physics/physics_intern.h
M source/blender/editors/physics/physics_ops.c
M source/blender/editors/physics/physics_pointcache.c
M source/blender/makesrna/intern/rna_fluidsim.c
M source/blender/makesrna/intern/rna_particle.c
M source/blender/makesrna/intern/rna_pointcache.c
M source/blender/modifiers/intern/MOD_cloth.c
M source/tests/bl_run_operators.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 206a208..743a58a 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -197,7 +197,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, Panel):
psys = context.particle_system
part = particle_get_settings(context)
- layout.enabled = particle_panel_enabled(context, psys) and (psys is None or not psys.has_multiple_caches)
+ layout.enabled = particle_panel_enabled(context, psys)
row = layout.row()
row.active = part.distribution != 'GRID'
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 2c102a9..a276218 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -104,14 +104,6 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
layout.context_pointer_set("point_cache", cache)
- if not cachetype == 'RIGID_BODY':
- row = layout.row()
- row.template_list("UI_UL_list", "point_caches", cache, "point_caches",
- cache.point_caches, "active_index", rows=1)
- col = row.column(align=True)
- col.operator("ptcache.add", icon='ZOOMIN', text="")
- col.operator("ptcache.remove", icon='ZOOMOUT', text="")
-
row = layout.row()
if cachetype in {'PSYS', 'HAIR', 'SMOKE'}:
row.prop(cache, "use_external")
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 22285b2..1cef74b 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1322,10 +1322,6 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
if md.type == pe.type:
ptcache = md.point_cache
- if ptcache and len(ptcache.point_caches) > 1:
- layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
- ptcache.point_caches, "active_index", rows=2, maxrows=3)
-
if not pe.is_editable:
layout.label(text="Point cache must be baked")
layout.label(text="in memory to enable editing!")
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 4341756..66e922b 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -54,7 +54,7 @@ void BKE_object_workob_clear(struct Object *workob);
void BKE_object_workob_calc_parent(struct Scene *scene, struct Object *ob, struct Object *workob);
void BKE_object_transform_copy(struct Object *ob_tar, const struct Object *ob_src);
-struct SoftBody *copy_softbody(struct SoftBody *sb, int copy_caches);
+struct SoftBody *copy_softbody(struct SoftBody *sb, int copy_cache);
struct BulletSoftBody *copy_bulletsoftbody(struct BulletSoftBody *sb);
void BKE_object_copy_particlesystems(struct Object *obn, struct Object *ob);
void BKE_object_copy_softbody(struct Object *obn, struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index a7bb976..6d98dee 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -172,9 +172,6 @@ typedef struct PTCacheID {
struct PTCReader *(*reader_create)(struct Scene *scene, struct Object *ob, void *calldata);
struct PointCache *cache;
- /* used for setting the current cache from ptcaches list */
- struct PointCache **cache_ptr;
- struct ListBase *ptcaches;
} PTCacheID;
typedef struct PTCacheBaker {
@@ -307,11 +304,10 @@ int BKE_ptcache_read(PTCacheID *pid, float cfra);
int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra);
/******************* Allocate & free ***************/
-struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches);
+struct PointCache *BKE_ptcache_new(void);
void BKE_ptcache_free_mem(struct ListBase *mem_cache);
void BKE_ptcache_free(struct PointCache *cache);
-void BKE_ptcache_free_list(struct ListBase *ptcaches);
-struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old, int copy_data);
+struct PointCache *BKE_ptcache_copy(struct PointCache *cache, int copy_data);
/********************** Baking *********************/
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 835b822..99a21fe 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -974,7 +974,7 @@ void dynamicPaint_freeSurfaceData(DynamicPaintSurface *surface)
void dynamicPaint_freeSurface(DynamicPaintSurface *surface)
{
/* point cache */
- BKE_ptcache_free_list(&(surface->ptcaches));
+ BKE_ptcache_free(surface->pointcache);
surface->pointcache = NULL;
if (surface->effector_weights)
@@ -1038,7 +1038,7 @@ DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *c
surface->type = MOD_DPAINT_SURFACE_T_PAINT;
/* cache */
- surface->pointcache = BKE_ptcache_add(&(surface->ptcaches));
+ surface->pointcache = BKE_ptcache_new();
surface->pointcache->flag |= PTCACHE_DISK_CACHE;
surface->pointcache->step = 1;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index d6587ac..415d712 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1011,7 +1011,7 @@ Object *BKE_object_add(Main *bmain, Scene *scene, int type)
return ob;
}
-SoftBody *copy_softbody(SoftBody *sb, int copy_caches)
+SoftBody *copy_softbody(SoftBody *sb, int copy_cache)
{
SoftBody *sbn;
@@ -1019,7 +1019,7 @@ SoftBody *copy_softbody(SoftBody *sb, int copy_caches)
sbn = MEM_dupallocN(sb);
- if (copy_caches == FALSE) {
+ if (copy_cache == FALSE) {
sbn->totspring = sbn->totpoint = 0;
sbn->bpoint = NULL;
sbn->bspring = NULL;
@@ -1048,7 +1048,7 @@ SoftBody *copy_softbody(SoftBody *sb, int copy_caches)
sbn->scratch = NULL;
- sbn->pointcache = BKE_ptcache_copy_list(&sbn->ptcaches, &sb->ptcaches, copy_caches);
+ sbn->pointcache = BKE_ptcache_copy(sb->pointcache, copy_cache);
if (sb->effector_weights)
sbn->effector_weights = MEM_dupallocN(sb->effector_weights);
@@ -1121,7 +1121,7 @@ static ParticleSystem *copy_particlesystem(ParticleSystem *psys)
psysn->childcachebufs.first = psysn->childcachebufs.last = NULL;
psysn->renderdata = NULL;
- psysn->pointcache = BKE_ptcache_copy_list(&psysn->ptcaches, &psys->ptcaches, FALSE);
+ psysn->pointcache = BKE_ptcache_copy(psys->pointcache, FALSE);
/* XXX - from reading existing code this seems correct but intended usage of
* pointcache should /w cloth should be added in 'ParticleSystem' - campbell */
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 6177f4a..251d7b1 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -411,14 +411,12 @@ void free_hair(Object *UNUSED(ob), ParticleSystem *psys, int dynamics)
if (psys->clmd) {
if (dynamics) {
- BKE_ptcache_free_list(&psys->ptcaches);
- psys->clmd->point_cache = psys->pointcache = NULL;
- psys->clmd->ptcaches.first = psys->clmd->ptcaches.last = NULL;
+ BKE_ptcache_free(psys->pointcache);
modifier_free((ModifierData *)psys->clmd);
psys->clmd = NULL;
- psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
+ psys->pointcache = BKE_ptcache_new();
}
else {
cloth_free_modifier(psys->clmd);
@@ -568,7 +566,7 @@ void psys_free(Object *ob, ParticleSystem *psys)
psys->part = NULL;
}
- BKE_ptcache_free_list(&psys->ptcaches);
+ BKE_ptcache_free(psys->pointcache);
psys->pointcache = NULL;
BLI_freelistN(&psys->targets);
@@ -3504,7 +3502,7 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n
psys->flag &= ~PSYS_CURRENT;
psys = MEM_callocN(sizeof(ParticleSystem), "particle_system");
- psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
+ psys->pointcache = BKE_ptcache_new();
BLI_addtail(&ob->particlesystem, psys);
psys->part = psys_new_settings(DATA_("ParticleSettings"), NULL);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index dd02fd7..7ece54d 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1102,8 +1102,6 @@ void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb)
pid->calldata= sb;
pid->type= PTCACHE_TYPE_SOFTBODY;
pid->cache= sb->pointcache;
- pid->cache_ptr= &sb->pointcache;
- pid->ptcaches= &sb->ptcaches;
pid->totpoint= pid->totwrite= ptcache_softbody_totpoint;
pid->error = ptcache_softbody_error;
@@ -1138,8 +1136,6 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p
pid->type= PTCACHE_TYPE_PARTICLES;
pid->stack_index= psys->pointcache->index;
pid->cache= psys->pointcache;
- pid->cache_ptr= &psys->pointcache;
- pid->ptcaches= &psys->ptcaches;
if (psys->part->type != PART_HAIR)
pid->flag |= PTCACHE_VEL_PER_SEC;
@@ -1196,8 +1192,6 @@ void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *cl
pid->type= PTCACHE_TYPE_CLOTH;
pid->stack_index= clmd->point_cache->index;
pid->cache= clmd->point_cache;
- pid->cache_ptr= &clmd->point_cache;
- pid->ptcaches= &clmd->ptcaches;
pid->totpoint= pid->totwrite= ptcache_cloth_totpoint;
pid->error = ptcache_cloth_error;
@@ -1234,8 +1228,6 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo
pid->stack_index= sds->point_cache[0]->index;
pid->cache= sds->point_cache[0];
- pid->cache_ptr= &(sds->point_cache[0]);
- pid->ptcaches= &(sds->ptcaches[0]);
pid->totpoint= pid->totwrite= ptcache_smoke_totpoint;
pid->error = ptcache
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list