[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30589] trunk/blender/source/blender: Fix #20983: cloth and smoke point cache step was not enforced to 1.
Brecht Van Lommel
brecht at blender.org
Wed Jul 21 17:58:16 CEST 2010
Revision: 30589
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30589
Author: blendix
Date: 2010-07-21 17:58:15 +0200 (Wed, 21 Jul 2010)
Log Message:
-----------
Fix #20983: cloth and smoke point cache step was not enforced to 1.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/cloth.c
trunk/blender/source/blender/makesrna/intern/rna_object_force.c
Modified: trunk/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cloth.c 2010-07-21 15:23:49 UTC (rev 30588)
+++ trunk/blender/source/blender/blenkernel/intern/cloth.c 2010-07-21 15:58:15 UTC (rev 30589)
@@ -144,6 +144,9 @@
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)
Modified: trunk/blender/source/blender/makesrna/intern/rna_object_force.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object_force.c 2010-07-21 15:23:49 UTC (rev 30588)
+++ trunk/blender/source/blender/makesrna/intern/rna_object_force.c 2010-07-21 15:58:15 UTC (rev 30589)
@@ -294,6 +294,29 @@
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 @@
}
}
-
#else
static void rna_def_pointcache(BlenderRNA *brna)
@@ -694,6 +716,7 @@
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");
More information about the Bf-blender-cvs
mailing list