Particles
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 27 Nov 2007 09:59:18 +0000 (09:59 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 27 Nov 2007 09:59:18 +0000 (09:59 +0000)
=========

- Fix for bug #7832: boids physics crashed.
- Bugfix for child particles not getting orco texture coords.
- Allow smaller strand sizes in blender units.
- Fix for a common but harmless uninitialized value warning in
  valgrind, in the event queue.

source/blender/blenkernel/intern/particle_system.c
source/blender/render/intern/source/convertblender.c
source/blender/src/buttons_shading.c
source/blender/src/editscreen.c

index 0bcf6be0a4a4568a794017a365e044b45303c356..b0c75ea6ab06e24e6f61d0bc45d3679a23544e56 100644 (file)
@@ -3832,7 +3832,7 @@ static void dynamics_step(Object *ob, ParticleSystem *psys, ParticleSystemModifi
 
                if(part->phystype==PART_PHYS_BOIDS){
                        /* create particle tree for fast inter-particle comparisons */
-                       KDTree *tree=BLI_kdtree_new(totpart);
+                       tree=BLI_kdtree_new(totpart);
                        for(p=0, pa=psys->particles; p<totpart; p++,pa++){
                                if(pa->flag & (PARS_NO_DISP+PARS_UNEXIST) || pa->alive!=PARS_ALIVE)
                                        continue;
index 87853be623488409013142b69ab6e094dc1de59c..d97d8293c947b00bbd62be6e25ef66e6771dfddb 100644 (file)
@@ -1950,6 +1950,11 @@ static int render_new_particle_system(Render *re, Object *ob, ParticleSystem *ps
 
                        r_tilt=2.0f*cpa->rand[2];
 
+                       /* get orco */
+                       psys_particle_on_emitter(ob, psmd,
+                               (part->childtype == PART_CHILD_FACES)? PART_FROM_FACE: PART_FROM_PARTICLE,
+                               cpa->num,DMCACHE_ISCHILD,cpa->fuv,cpa->foffset,orco,0,0,0);
+
                        if(uvco){
                                layer=psmd->dm->faceData.layers + CustomData_get_layer_index(&psmd->dm->faceData,CD_MFACE);
 
index c2dae17ef3e70d1994d9efa403193480cf3d2b30..1a071813d8a17a6f3ba7894f4509fcd4228a5d75 100644 (file)
@@ -3859,8 +3859,8 @@ static uiBlock *strand_menu(void *mat_v)
        uiDefButBitI(block, TOG, MA_TANGENT_STR, 0,     "Use Tangent Shading",  10,90,115,20, &(ma->mode), 0, 0, 0, 0, "Uses direction of strands as normal for tangent-shading");
        uiDefButBitI(block, TOG, MA_STR_B_UNITS, 0,     "Use Blender Units",    125,90,115,20, &(ma->mode), 0, 0, 0, 0, "Use actual Blender units for widths instead of pixels");
        if(ma->mode & MA_STR_B_UNITS){
-               uiDefButF(block, NUMSLI, 0, "Start ",   10, 70, 230,20,   &ma->strand_sta, 0.01, 20.0, 2, 0, "Start size of strands in Blender units");
-               uiDefButF(block, NUMSLI, 0, "End ",             10, 50, 230,20,  &ma->strand_end, 0.01, 10.0, 2, 0, "End size of strands in Blender units");
+               uiDefButF(block, NUMSLI, 0, "Start ",   10, 70, 230,20,   &ma->strand_sta, 0.0001, 2.0, 2, 0, "Start size of strands in Blender units");
+               uiDefButF(block, NUMSLI, 0, "End ",             10, 50, 230,20,  &ma->strand_end, 0.0001, 1.0, 2, 0, "End size of strands in Blender units");
        }
        else{
                uiDefButF(block, NUMSLI, 0, "Start ",   10, 70, 230,20,   &ma->strand_sta, 0.25, 20.0, 2, 0, "Start size of strands in pixels");
index 57d4bde9b8a977b0f98ad0956e154ebc7107afdd..da6884d4394b6128dc3f488c55dea19c39c1c030 100644 (file)
@@ -491,6 +491,8 @@ static void addqueue_ext(short win, unsigned short event, short val, char ascii)
        } 
        else {
                BWinEvent evt;
+
+               memset(&evt, 0, sizeof(evt));
                evt.event= event;
                evt.val= val;
                evt.ascii= ascii;