Revision: 16796
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16796
Author:   jhk
Date:     2008-09-28 21:53:37 +0200 (Sun, 28 Sep 2008)

Log Message:
-----------
A previous commit by me (16701) broke keyed- and none-physics particles or at 
least made them do funny things.

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

Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c   2008-09-28 
18:58:40 UTC (rev 16795)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c   2008-09-28 
19:53:37 UTC (rev 16796)
@@ -3392,19 +3392,19 @@
                size=part->size;
 
                if((part->flag&PART_ABS_TIME)==0 && part->ipo){
-                       IpoCurve *icu;
-
+                       IpoCurve *icu;
+
                        if(pa_time)
                                time=*pa_time;
                        else
-                               time=psys_get_child_time(psys,cpa,cfra);
-
-                       /* correction for lifetime */
-                       calc_ipo(part->ipo, 100*time);
-
-                       for(icu = part->ipo->curve.first; icu; icu=icu->next) {
-                               if(icu->adrcode == PART_SIZE)
-                                       size = icu->curval;
+                               time=psys_get_child_time(psys,cpa,cfra);
+
+                       /* correction for lifetime */
+                       calc_ipo(part->ipo, 100*time);
+
+                       for(icu = part->ipo->curve.first; icu; icu=icu->next) {
+                               if(icu->adrcode == PART_SIZE)
+                                       size = icu->curval;
                        }
                }
        }
@@ -3796,7 +3796,7 @@
                }
                else{
                        if (pa) { /* TODO PARTICLE - should this ever be NULL? 
- Campbell */
-                               if(pa->state.time==state->time)
+                               if(pa->state.time==state->time || 
ELEM(part->phystype,PART_PHYS_NO,PART_PHYS_KEYED))
                                        copy_particle_key(state, &pa->state, 1);
                                else if(pa->prev_state.time==state->time)
                                        copy_particle_key(state, 
&pa->prev_state, 1);
@@ -3828,6 +3828,9 @@
                                                        
                                                        /* convert back to real 
velocity */
                                                        VecMulf(state->vel, 
frs_sec / dfra);
+
+                                                       VecLerpf(state->ave, 
keys[1].ave, keys[2].ave, keytime);
+                                                       
QuatInterpol(state->rot, keys[1].rot, keys[2].rot, keytime);
                                                }
                                        }
                                        else {
@@ -3938,13 +3941,13 @@
                                nor[2] = 0.0f;
                        }
                }
-               Crossf(side, nor, vec);
-               Normalize(side);
-               Crossf(nor, vec, side);
-
-               Mat4One(mat);
-               VECCOPY(mat[0], vec);
-               VECCOPY(mat[1], side);
+               Crossf(side, nor, vec);
+               Normalize(side);
+               Crossf(nor, vec, side);
+
+               Mat4One(mat);
+               VECCOPY(mat[0], vec);
+               VECCOPY(mat[1], side);
                VECCOPY(mat[2], nor);
        }
 

Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c    
2008-09-28 18:58:40 UTC (rev 16795)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c    
2008-09-28 19:53:37 UTC (rev 16796)
@@ -4154,7 +4154,7 @@
        }
 
        if((part->type==PART_HAIR || psys->flag&PSYS_KEYED) && 
(psys_in_edit_mode(psys)
-               || (part->type==PART_HAIR || part->draw_as==PART_DRAW_PATH) || 
part->draw&PART_DRAW_KEYS)){
+               || (part->type==PART_HAIR || part->draw_as==PART_DRAW_PATH))){
                psys_cache_paths(ob, psys, cfra, 0);
 
                /* for render, child particle paths are computed on the fly */
@@ -4464,11 +4464,9 @@
                return;
        }
 
-       /* cache shouldn't be used for hair or "none" or "first keyed" physics 
*/
-       if(part->type == PART_HAIR || part->phystype == PART_PHYS_NO)
+       /* cache shouldn't be used for hair or "none" or "keyed" physics */
+       if(part->type == PART_HAIR || ELEM(part->phystype, PART_PHYS_NO, 
PART_PHYS_KEYED))
                usecache= 0;
-       else if(part->type == PART_PHYS_KEYED && (psys->flag & 
PSYS_FIRST_KEYED))
-               usecache= 0;
        else if(BKE_ptcache_get_continue_physics())
                usecache= 0;
        else


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

Reply via email to