From 6ca186fc5ac422001559a0c86d3d436163acc849 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Tue, 5 Oct 2010 09:32:35 +0000 Subject: [PATCH] Fix for [#24107] Hair/General particle glitch- Presets --- release/scripts/ui/properties_particle.py | 6 ++---- source/blender/makesrna/intern/rna_particle.c | 8 +++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/release/scripts/ui/properties_particle.py b/release/scripts/ui/properties_particle.py index 7f630d6e5ff..ff49b0e4e9f 100644 --- a/release/scripts/ui/properties_particle.py +++ b/release/scripts/ui/properties_particle.py @@ -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): diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 1151215f5f7..7a8165e9aa5 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -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)