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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-25 00:46:00 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-25 00:46:00 +0400
commit8651e6fba7706beba750ab5d2c3ee2817283e4f6 (patch)
tree7f05ca11cd647daa82973ef4b25940c931103439
parented6aaace52564ab686f4bfdd682bf85c4eb78c66 (diff)
Fix part of #29310: secondary point caches for cloth did not get steps
set to correct default, was 10 when supposed to be 1.
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h3
-rw-r--r--source/blender/blenkernel/intern/pointcache.c15
-rw-r--r--source/blender/editors/physics/physics_pointcache.c4
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c20
4 files changed, 28 insertions, 14 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index 9f4fae7dc2e..d1b0acf7142 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -127,6 +127,9 @@ typedef struct PTCacheID {
unsigned int stack_index;
unsigned int flag;
+ unsigned int default_step;
+ unsigned int max_step;
+
/* flags defined in DNA_object_force.h */
unsigned int data_types, info_types;
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index dbfda18942a..2cf890349b4 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -770,6 +770,9 @@ void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb)
pid->info_types= 0;
pid->stack_index = pid->cache->index;
+
+ pid->default_step = 10;
+ pid->max_step = 20;
}
void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *psys)
{
@@ -820,6 +823,9 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p
pid->data_types|= (1<<BPHYS_DATA_ROTATION);
pid->info_types= (1<<BPHYS_DATA_TIMES);
+
+ pid->default_step = 10;
+ pid->max_step = 20;
}
void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *clmd)
{
@@ -850,6 +856,9 @@ void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *cl
pid->data_types= (1<<BPHYS_DATA_LOCATION) | (1<<BPHYS_DATA_VELOCITY) | (1<<BPHYS_DATA_XCONST);
pid->info_types= 0;
+
+ pid->default_step = 1;
+ pid->max_step = 1;
}
void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd)
{
@@ -890,6 +899,9 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo
pid->data_types |= (1<<BPHYS_DATA_SMOKE_LOW);
if(sds->wt)
pid->data_types |= (1<<BPHYS_DATA_SMOKE_HIGH);
+
+ pid->default_step = 1;
+ pid->max_step = 1;
}
void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, Object *ob, DynamicPaintSurface *surface)
@@ -923,6 +935,9 @@ void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, Object *ob, DynamicPaintSu
pid->info_types= 0;
pid->stack_index = pid->cache->index;
+
+ pid->default_step = 1;
+ pid->max_step = 1;
}
void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int duplis)
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index f826d0ec41a..0cecfa05b49 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -321,7 +321,9 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
for(pid=pidlist.first; pid; pid=pid->next) {
if(pid->cache == cache) {
- *(pid->cache_ptr) = BKE_ptcache_add(pid->ptcaches);
+ PointCache *cache = BKE_ptcache_add(pid->ptcaches);
+ cache->step = pid->default_step;
+ *(pid->cache_ptr) = cache;
break;
}
}
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 592c3baec46..2997acd2267 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -214,21 +214,16 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P
static void rna_Cache_list_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Object *ob = ptr->id.data;
PointCache *cache= ptr->data;
- PTCacheID *pid;
- ListBase pidlist;
+ ListBase lb;
- BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
+ while(cache->prev)
+ cache= cache->prev;
- for(pid=pidlist.first; pid; pid=pid->next) {
- if(pid->cache == cache) {
- rna_iterator_listbase_begin(iter, pid->ptcaches, NULL);
- break;
- }
- }
+ lb.first= cache;
+ lb.last= NULL; /* not used by listbase_begin */
- BLI_freelistN(&pidlist);
+ rna_iterator_listbase_begin(iter, &lb, NULL);
}
static void rna_Cache_active_point_cache_index_range(PointerRNA *ptr, int *min, int *max)
{
@@ -308,8 +303,7 @@ static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max)
for(pid=pidlist.first; pid; pid=pid->next) {
if(pid->cache == cache) {
- if(ELEM3(pid->type, PTCACHE_TYPE_CLOTH, PTCACHE_TYPE_SMOKE_DOMAIN, PTCACHE_TYPE_SMOKE_HIGHRES))
- *max= 1;
+ *max= pid->max_step;
break;
}
}