Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2007-12-11 18:03:45 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2007-12-11 18:03:45 +0300
commit65758a9a20807b3ee6ae470f76b4fe3d0cb382f6 (patch)
tree7022ec918c5b62a31fbbe88143525515395272b7 /source/blender/src
parentd5edeb526cd980b9bccce5d174593c5306dada63 (diff)
Bugfixes for:
- Disabled particle modifiers in particle mode. - Particle col option without material.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/buttons_editing.c7
-rw-r--r--source/blender/src/buttons_object.c19
-rw-r--r--source/blender/src/editparticle.c20
3 files changed, 36 insertions, 10 deletions
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index ba648d3f4ad..2a14609dc40 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -1643,10 +1643,13 @@ static void modifiers_psysEnable(void *ob_v, void *md_v)
{
ParticleSystemModifierData *psmd = (ParticleSystemModifierData*) md_v;
- if(psmd->modifier.mode & eModifierMode_Realtime)
+ if(psmd->modifier.mode & eModifierMode_Realtime) {
psmd->psys->flag |= PSYS_ENABLED;
- else
+ }
+ else {
psmd->psys->flag &= ~PSYS_ENABLED;
+ PE_free_particle_edit(psmd->psys);
+ }
}
static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco, int *yco, int index, int cageIndex, int lastCageIndex)
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index e0190ab474f..8d29e044142 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -2853,6 +2853,23 @@ void do_effects_panels(unsigned short event)
allqueue(REDRAWOOPS, 0);
}
break;
+ case B_PART_ENABLE:
+ if(psys) {
+ ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys);
+ if(psys->flag & PSYS_ENABLED) {
+ psmd->modifier.mode |= eModifierMode_Realtime;
+ }
+ else {
+ psmd->modifier.mode &= ~eModifierMode_Realtime;
+ PE_free_particle_edit(psys);
+ }
+
+ DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWBUTSOBJECT, 0);
+ allqueue(REDRAWBUTSEDIT, 0);
+ }
+ break;
case B_PART_RECALC:
case B_PART_RECALC_CHILD:
if(psys){
@@ -4200,7 +4217,7 @@ static void object_panel_particle_system(Object *ob)
butx=0;
buty-=5;
- uiDefButBitI(block, TOG, PSYS_ENABLED, B_PART_REDRAW, "Enabled", 0,(buty-=buth),100,buth, &psys->flag, 0, 0, 0, 0, "Sets particle system to be calculated and shown");
+ uiDefButBitI(block, TOG, PSYS_ENABLED, B_PART_ENABLE, "Enabled", 0,(buty-=buth),100,buth, &psys->flag, 0, 0, 0, 0, "Sets particle system to be calculated and shown");
if(part->type == PART_HAIR){
if(psys->flag & PSYS_EDITED)
diff --git a/source/blender/src/editparticle.c b/source/blender/src/editparticle.c
index bb88e9624bf..3611efed995 100644
--- a/source/blender/src/editparticle.c
+++ b/source/blender/src/editparticle.c
@@ -155,9 +155,12 @@ void PE_change_act(void *ob_v, void *act_v)
if(act>=0){
if((psys=BLI_findlink(&ob->particlesystem,act))) {
psys->flag |= PSYS_CURRENT;
- if(G.f & G_PARTICLEEDIT && !psys->edit)
- PE_create_particle_edit(ob, psys);
- PE_recalc_world_cos(ob, psys);
+
+ if(psys->flag & PSYS_ENABLED) {
+ if(G.f & G_PARTICLEEDIT && !psys->edit)
+ PE_create_particle_edit(ob, psys);
+ PE_recalc_world_cos(ob, psys);
+ }
}
}
}
@@ -182,7 +185,7 @@ ParticleSystem *PE_get_current(Object *ob)
psys->flag |= PSYS_CURRENT;
}
- if(psys && ob == OBACT && (G.f & G_PARTICLEEDIT))
+ if(psys && (psys->flag & PSYS_ENABLED) && ob == OBACT && (G.f & G_PARTICLEEDIT))
if(psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED)
if(psys->edit == NULL)
PE_create_particle_edit(ob, psys);
@@ -1098,9 +1101,11 @@ void PE_set_particle_edit(void)
if((G.f & G_PARTICLEEDIT)==0){
if(psys && psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED) {
- if(psys->edit==0)
- PE_create_particle_edit(ob, psys);
- PE_recalc_world_cos(ob, psys);
+ if(psys->flag & PSYS_ENABLED) {
+ if(psys->edit==0)
+ PE_create_particle_edit(ob, psys);
+ PE_recalc_world_cos(ob, psys);
+ }
}
G.f |= G_PARTICLEEDIT;
@@ -2582,6 +2587,7 @@ int PE_brush_particles(void)
if(pset->brushtype == PE_BRUSH_ADD && (pset->flag & PE_X_MIRROR))
PE_mirror_x(1);
PE_recalc_world_cos(ob,psys);
+ psys_free_path_cache(psys);
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
}
else