Revision: 15460
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15460
Author:   jhk
Date:     2008-07-07 00:52:55 +0200 (Mon, 07 Jul 2008)

Log Message:
-----------
Fix for bug: [#14570] particle system: grid distribution + vertex emitting bug
- grid distribution didn't check for emission from vertices

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/particle.c
    trunk/blender/source/blender/blenkernel/intern/particle_system.c
    trunk/blender/source/blender/src/buttons_object.c

Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c   2008-07-06 
21:55:03 UTC (rev 15459)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c   2008-07-06 
22:52:55 UTC (rev 15460)
@@ -1371,7 +1371,7 @@
 /************************************************/
 void psys_particle_on_emitter(Object *ob, ParticleSystemModifierData *psmd, 
int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, 
float *nor, float *utan, float *vtan, float *orco, float *ornor){
        if(psmd){
-               if(psmd->psys->part->distr==PART_DISTR_GRID){
+               if(psmd->psys->part->distr==PART_DISTR_GRID && 
psmd->psys->part->from != PART_FROM_VERT){
                        if(vec){
                                VECCOPY(vec,fuv);
                        }

Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c    
2008-07-06 21:55:03 UTC (rev 15459)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c    
2008-07-06 22:52:55 UTC (rev 15460)
@@ -168,7 +168,7 @@
        int i, totpart, totsaved = 0;
 
        if(new_totpart<0) {
-               if(psys->part->distr==PART_DISTR_GRID) {
+               if(psys->part->distr==PART_DISTR_GRID  && psys->part->from != 
PART_FROM_VERT) {
                        totpart= psys->part->grid_res;
                        totpart*=totpart*totpart;
                }
@@ -1056,7 +1056,7 @@
                dm= CDDM_from_mesh((Mesh*)ob->data, ob);
 
                /* special handling of grid distribution */
-               if(part->distr==PART_DISTR_GRID){
+               if(part->distr==PART_DISTR_GRID && from != PART_FROM_VERT){
                        distribute_particles_in_grid(dm,psys);
                        dm->release(dm);
                        return 0;
@@ -1600,7 +1600,7 @@
 
        NormalQuat(pa->r_rot);
 
-       if(part->distr!=PART_DISTR_GRID){
+       if(part->distr!=PART_DISTR_GRID && part->from != PART_FROM_VERT){
                /* any unique random number will do (r_ave[0]) */
                if(ptex.exist < 0.5*(1.0+pa->r_ave[0]))
                        pa->flag |= PARS_UNEXIST;
@@ -4515,7 +4515,7 @@
        if(part->from == PART_FROM_PARTICLE) {
                if(part->type != PART_REACTOR)
                        part->from = PART_FROM_FACE;
-               if(part->distr == PART_DISTR_GRID)
+               if(part->distr == PART_DISTR_GRID && part->from != 
PART_FROM_VERT)
                        part->distr = PART_DISTR_JIT;
        }
 
@@ -4710,7 +4710,7 @@
        oldtotpart = psys->totpart;
        oldtotchild = psys->totchild;
 
-       if(part->distr == PART_DISTR_GRID)
+       if(part->distr == PART_DISTR_GRID && part->from != PART_FROM_VERT)
                totpart = part->grid_res*part->grid_res*part->grid_res;
        else
                totpart = psys->part->totpart;

Modified: trunk/blender/source/blender/src/buttons_object.c
===================================================================
--- trunk/blender/source/blender/src/buttons_object.c   2008-07-06 21:55:03 UTC 
(rev 15459)
+++ trunk/blender/source/blender/src/buttons_object.c   2008-07-06 22:52:55 UTC 
(rev 15460)
@@ -4812,7 +4812,7 @@
        uiDefBut(block, LABEL, 0, "Basic:",                                     
butx,(buty-=buth),butw,buth, NULL, 0.0, 0, 0, 0, "");
        uiBlockBeginAlign(block);
 
-       if(part->distr==PART_DISTR_GRID)
+       if(part->distr==PART_DISTR_GRID && part->from != PART_FROM_VERT)
                uiDefButI(block, NUM, B_PART_ALLOC, "Resol:",           
butx,(buty-=buth),butw,buth, &part->grid_res, 1.0, 100.0, 0, 0, "The resolution 
of the particle grid");
        else
                uiDefButI(block, NUM, B_PART_ALLOC, "Amount:",          
butx,(buty-=buth),butw,buth, &part->totpart, 0.0, 100000.0, 0, 0, "The total 
number of particles");


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to