Fix for [#24107] Hair/General particle glitch- Presets

This commit is contained in:
Janne Karhu 2010-10-05 09:32:35 +00:00
parent a92c232c8b
commit 6ca186fc5a
2 changed files with 9 additions and 5 deletions

@ -28,12 +28,10 @@ from properties_physics_common import basic_force_field_falloff_ui
def particle_panel_enabled(context, psys):
phystype = psys.settings.physics_type
if phystype == 'NO' or phystype == 'KEYED':
if psys.settings.type in ('EMITTER', 'REACTOR') and phystype in ('NO', 'KEYED'):
return True
if psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.use_hair_dynamics):
return (psys.point_cache.is_baked is False) and (not psys.is_edited) and (not context.particle_system_editable)
else:
return True
return (psys.point_cache.is_baked is False) and (not psys.is_edited) and (not context.particle_system_editable)
def particle_panel_poll(cls, context):

@ -325,15 +325,21 @@ static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value)
{
ParticleSystem *psys= (ParticleSystem*)ptr->data;
int old_type = 0;
if(psys->part)
if(psys->part) {
old_type = psys->part->type;
psys->part->id.us--;
}
psys->part = (ParticleSettings *)value.data;
if(psys->part) {
psys->part->id.us++;
psys_check_boid_data(psys);
if(old_type != psys->part->type)
psys->recalc |= PSYS_RECALC_TYPE;
}
}
static void rna_Particle_abspathtime_update(Main *bmain, Scene *scene, PointerRNA *ptr)