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>2010-07-21 19:58:15 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-21 19:58:15 +0400
commitb72af8c09a37854fa71f26b3d929cda41e003e44 (patch)
tree4c96857fd1e5fa5821d1508532f35b170045f111
parent6a8ce04e543dd04678504db960bf19be1b487429 (diff)
Fix #20983: cloth and smoke point cache step was not enforced to 1.
-rw-r--r--source/blender/blenkernel/intern/cloth.c3
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c25
2 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index ce5bca1da56..b9b1c16c0c4 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -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)
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 97c429209de..d253201fbc1 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -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");