Fix #20983: cloth and smoke point cache step was not enforced to 1.

This commit is contained in:
Brecht Van Lommel 2010-07-21 15:58:15 +00:00
parent 6a8ce04e54
commit b72af8c09a
2 changed files with 27 additions and 1 deletions

@ -144,6 +144,9 @@ void cloth_init ( ClothModifierData *clmd )
if(!clmd->sim_parms->effector_weights)
clmd->sim_parms->effector_weights = BKE_add_effector_weights(NULL);
if(clmd->point_cache)
clmd->point_cache->step = 1;
}
static BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float epsilon)

@ -294,6 +294,29 @@ static void rna_Cache_active_point_cache_index_set(struct PointerRNA *ptr, int v
BLI_freelistN(&pidlist);
}
static void rna_PointCache_step_range(PointerRNA *ptr, int *min, int *max)
{
Object *ob = ptr->id.data;
PointCache *cache= ptr->data;
PTCacheID *pid;
ListBase pidlist;
*min= 1;
*max= 20;
BKE_ptcache_ids_from_object(&pidlist, ob, NULL, 0);
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;
break;
}
}
BLI_freelistN(&pidlist);
}
static char *rna_CollisionSettings_path(PointerRNA *ptr)
{
Object *ob= (Object*)ptr->id.data;
@ -670,7 +693,6 @@ static EnumPropertyItem *rna_Effector_shape_itemf(bContext *C, PointerRNA *ptr,
}
}
#else
static void rna_def_pointcache(BlenderRNA *brna)
@ -694,6 +716,7 @@ static void rna_def_pointcache(BlenderRNA *brna)
prop= RNA_def_property(srna, "step", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 1, 20);
RNA_def_property_int_funcs(prop, NULL, NULL, "rna_PointCache_step_range");
RNA_def_property_ui_text(prop, "Cache Step", "Number of frames between cached frames");
RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change");