* Bugfix for non-working high res display
* Bugfix for smoke disappearing on 2nd frame
This commit is contained in:
Daniel Genrich
2009-09-09 23:52:48 +00:00
parent aec894939f
commit e8b3f86bcb
3 changed files with 9 additions and 6 deletions

View File

@@ -90,7 +90,10 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN')
if md:
return (md.smoke_type == 'TYPE_DOMAIN')
return False
def draw(self, context):
layout = self.layout
@@ -145,7 +148,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
md = context.smoke.domain_settings
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(md, "amplify", text="Divisions")
@@ -154,7 +157,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
col.itemL(text="Noise Method:")
col.row().itemR(md, "noise_type", text="")
col.itemR(md, "strength")
sub.itemR(md, "viewhighres")
col.itemR(md, "viewhighres")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
__label__ = "Smoke High Resolution Cache"

View File

@@ -1847,7 +1847,7 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
else if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN)
smokeModifier_reset(pid->calldata);
else if(pid->type == PTCACHE_TYPE_SMOKE_HIGHRES)
smokeModifier_reset(pid->calldata);
smokeModifier_reset_turbulence(pid->calldata);
}
if(clear)
BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0);

View File

@@ -1157,14 +1157,13 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
{
BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED);
}
if(!(cache_wt->flag & PTCACHE_SIMULATION_VALID))
if(sds->wt && !(cache_wt->flag & PTCACHE_SIMULATION_VALID))
{
BKE_ptcache_id_reset(scene, &pid_wt, PTCACHE_RESET_OUTDATED);
}
if(smd->time == -1 && framenr!= startframe)
return;
if(!smokeModifier_init(smd, ob, scene, dm))
return;
@@ -1287,6 +1286,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM
if(get_lamp(scene, light))
smoke_calc_transparency(sds->shadow, smoke_get_density(sds->fluid), sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp, -7.0*sds->dx);
// printf("smd->time: %f\n", smd->time);
return;
}