[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28729] trunk/blender: merge of last commit to trunk

Joseph Eagar joeedh at gmail.com
Tue May 11 22:06:20 CEST 2010


Revision: 28729
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28729
Author:   joeedh
Date:     2010-05-11 22:06:20 +0200 (Tue, 11 May 2010)

Log Message:
-----------
merge of last commit to trunk

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_particle.py
    trunk/blender/release/scripts/ui/properties_physics_cloth.py
    trunk/blender/release/scripts/ui/properties_physics_common.py
    trunk/blender/release/scripts/ui/properties_physics_smoke.py
    trunk/blender/release/scripts/ui/properties_physics_softbody.py
    trunk/blender/source/blender/blenkernel/intern/pointcache.c

Modified: trunk/blender/release/scripts/ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_particle.py	2010-05-11 20:05:21 UTC (rev 28728)
+++ trunk/blender/release/scripts/ui/properties_particle.py	2010-05-11 20:06:20 UTC (rev 28729)
@@ -269,10 +269,9 @@
         return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
 
     def draw(self, context):
-
         psys = context.particle_system
 
-        point_cache_ui(self, context, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
+        point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if psys.hair_dynamics else 'PSYS')
 
 
 class PARTICLE_PT_velocity(ParticleButtonsPanel):

Modified: trunk/blender/release/scripts/ui/properties_physics_cloth.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_cloth.py	2010-05-11 20:05:21 UTC (rev 28728)
+++ trunk/blender/release/scripts/ui/properties_physics_cloth.py	2010-05-11 20:06:20 UTC (rev 28729)
@@ -142,7 +142,7 @@
 
     def draw(self, context):
         md = context.cloth
-        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 0, 0)
+        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
 
 
 class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):

Modified: trunk/blender/release/scripts/ui/properties_physics_common.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_common.py	2010-05-11 20:05:21 UTC (rev 28728)
+++ trunk/blender/release/scripts/ui/properties_physics_common.py	2010-05-11 20:06:20 UTC (rev 28729)
@@ -22,7 +22,8 @@
 
 import bpy
 
-def point_cache_ui(self, context, cache, enabled, particles, smoke):
+#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
+def point_cache_ui(self, context, cache, enabled, cachetype):
     layout = self.layout
 
     wide_ui = context.region.width > narrowui
@@ -35,7 +36,7 @@
     col.operator("ptcache.remove", icon='ZOOMOUT', text="")
 
     row = layout.row()
-    if particles:
+    if cachetype in {'PSYS', 'HAIR'}:
         row.prop(cache, "external")
 
     if cache.external:
@@ -53,17 +54,17 @@
         split = layout.split()
         col = split.column(align=True)
 
-        if not particles:
+        if cachetype != 'PSYS':
             col.enabled = enabled
             col.prop(cache, "frame_start")
             col.prop(cache, "frame_end")
-        if not smoke:
+        if cachetype != 'SMOKE':
             col.prop(cache, "step")
 
         if wide_ui:
             col = split.column()
 
-        if not smoke:
+        if cachetype != 'SMOKE':
             sub = col.column()
             sub.enabled = enabled
             sub.prop(cache, "quick_cache")
@@ -102,7 +103,6 @@
         col.operator("ptcache.free_bake_all", text="Free All Bakes")
         col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
 
-
 def effector_weights_ui(self, context, weights):
     layout = self.layout
 

Modified: trunk/blender/release/scripts/ui/properties_physics_smoke.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_smoke.py	2010-05-11 20:05:21 UTC (rev 28728)
+++ trunk/blender/release/scripts/ui/properties_physics_smoke.py	2010-05-11 20:06:20 UTC (rev 28729)
@@ -166,7 +166,7 @@
         md = context.smoke.domain_settings
         cache = md.point_cache_low
 
-        point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
+        point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
 
 
 class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
@@ -222,7 +222,7 @@
         md = context.smoke.domain_settings
         cache = md.point_cache_high
 
-        point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
+        point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
 
 
 class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):

Modified: trunk/blender/release/scripts/ui/properties_physics_softbody.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_softbody.py	2010-05-11 20:05:21 UTC (rev 28728)
+++ trunk/blender/release/scripts/ui/properties_physics_softbody.py	2010-05-11 20:06:20 UTC (rev 28729)
@@ -97,7 +97,7 @@
 
     def draw(self, context):
         md = context.soft_body
-        point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 0, 0)
+        point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
 
 
 class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):

Modified: trunk/blender/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pointcache.c	2010-05-11 20:05:21 UTC (rev 28728)
+++ trunk/blender/source/blender/blenkernel/intern/pointcache.c	2010-05-11 20:06:20 UTC (rev 28729)
@@ -1712,14 +1712,13 @@
 	int totpoint = pid->totpoint(pid->calldata, cfra);
 	int add = 0, overwrite = 0;
 
-	if(totpoint == 0 || cfra < 0
-		|| (cfra ? pid->data_types == 0 : pid->info_types == 0))
+	if(totpoint == 0 || (cfra ? pid->data_types == 0 : pid->info_types == 0))
 		return 0;
 
 	if(cache->flag & PTCACHE_DISK_CACHE) {
 		int ofra=0, efra = cache->endframe;
 
-		if(cfra==0)
+		if(cfra==0 && cache->startframe > 0)
 			add = 1;
 		/* allways start from scratch on the first frame */
 		else if(cfra == cache->startframe) {
@@ -1931,7 +1930,7 @@
 				if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
 					if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */
 						if (mode == PTCACHE_CLEAR_ALL) {
-							pid->cache->last_exact = 0;
+							pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
 							BLI_join_dirfile(path_full, path, de->d_name);
 							BLI_delete(path_full, 0, 0);
 						} else {
@@ -1963,7 +1962,8 @@
 			pm= pid->cache->mem_cache.first;
 
 			if(mode == PTCACHE_CLEAR_ALL) {
-				pid->cache->last_exact = 0;
+				/*we want startframe if the cache starts before zero*/
+				pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
 				for(; pm; pm=pm->next)
 					ptcache_free_data(pm);
 				BLI_freelistN(&pid->cache->mem_cache);
@@ -2880,6 +2880,6 @@
 {
 	cache->flag &= ~PTCACHE_SIMULATION_VALID;
 	cache->simframe = 0;
-	cache->last_exact = 0;
+	cache->last_exact = MIN2(cache->startframe, 0);
 }
 





More information about the Bf-blender-cvs mailing list