[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28728] branches/render25: allow negative start frames for point caches
Joseph Eagar
joeedh at gmail.com
Tue May 11 22:05:21 CEST 2010
Revision: 28728
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28728
Author: joeedh
Date: 2010-05-11 22:05:21 +0200 (Tue, 11 May 2010)
Log Message:
-----------
allow negative start frames for point caches
Modified Paths:
--------------
branches/render25/release/scripts/ui/properties_particle.py
branches/render25/release/scripts/ui/properties_physics_cloth.py
branches/render25/release/scripts/ui/properties_physics_common.py
branches/render25/release/scripts/ui/properties_physics_smoke.py
branches/render25/release/scripts/ui/properties_physics_softbody.py
branches/render25/source/blender/blenkernel/intern/pointcache.c
Modified: branches/render25/release/scripts/ui/properties_particle.py
===================================================================
--- branches/render25/release/scripts/ui/properties_particle.py 2010-05-11 19:57:20 UTC (rev 28727)
+++ branches/render25/release/scripts/ui/properties_particle.py 2010-05-11 20:05:21 UTC (rev 28728)
@@ -286,10 +286,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: branches/render25/release/scripts/ui/properties_physics_cloth.py
===================================================================
--- branches/render25/release/scripts/ui/properties_physics_cloth.py 2010-05-11 19:57:20 UTC (rev 28727)
+++ branches/render25/release/scripts/ui/properties_physics_cloth.py 2010-05-11 20:05:21 UTC (rev 28728)
@@ -143,7 +143,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: branches/render25/release/scripts/ui/properties_physics_common.py
===================================================================
--- branches/render25/release/scripts/ui/properties_physics_common.py 2010-05-11 19:57:20 UTC (rev 28727)
+++ branches/render25/release/scripts/ui/properties_physics_common.py 2010-05-11 20:05:21 UTC (rev 28728)
@@ -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: branches/render25/release/scripts/ui/properties_physics_smoke.py
===================================================================
--- branches/render25/release/scripts/ui/properties_physics_smoke.py 2010-05-11 19:57:20 UTC (rev 28727)
+++ branches/render25/release/scripts/ui/properties_physics_smoke.py 2010-05-11 20:05:21 UTC (rev 28728)
@@ -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: branches/render25/release/scripts/ui/properties_physics_softbody.py
===================================================================
--- branches/render25/release/scripts/ui/properties_physics_softbody.py 2010-05-11 19:57:20 UTC (rev 28727)
+++ branches/render25/release/scripts/ui/properties_physics_softbody.py 2010-05-11 20:05:21 UTC (rev 28728)
@@ -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: branches/render25/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/pointcache.c 2010-05-11 19:57:20 UTC (rev 28727)
+++ branches/render25/source/blender/blenkernel/intern/pointcache.c 2010-05-11 20:05:21 UTC (rev 28728)
@@ -1722,14 +1722,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) {
@@ -1941,7 +1940,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 {
@@ -1973,7 +1972,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);
@@ -2890,6 +2890,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