Revision: 27668
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27668
Author:   jhk
Date:     2010-03-22 20:38:40 +0100 (Mon, 22 Mar 2010)

Log Message:
-----------
Fix for child drawing bug reported in the comments of [#21103] Updating bugs in 
Particle Mode

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_view3d_toolbar.py
    trunk/blender/source/blender/blenkernel/intern/particle.c
    trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c

Modified: trunk/blender/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d_toolbar.py    2010-03-22 
17:46:49 UTC (rev 27667)
+++ trunk/blender/release/scripts/ui/space_view3d_toolbar.py    2010-03-22 
19:38:40 UTC (rev 27668)
@@ -1018,12 +1018,15 @@
         col.active = pe.editable
         col.label(text="Draw:")
         col.prop(pe, "draw_step", text="Path Steps")
-        if pe.type == 'PARTICLES':
-            col.prop(pe, "draw_particles", text="Particles")
-        col.prop(pe, "fade_time")
-        sub = col.row()
-        sub.active = pe.fade_time
-        sub.prop(pe, "fade_frames", slider=True)
+        if pe.hair:
+            col.prop(pe, "draw_particles", text="Children")
+        else:
+            if pe.type == 'PARTICLES':
+                col.prop(pe, "draw_particles", text="Particles")
+            col.prop(pe, "fade_time")
+            sub = col.row()
+            sub.active = pe.fade_time
+            sub.prop(pe, "fade_frames", slider=True)
 
 
 classes = [

Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c   2010-03-22 
17:46:49 UTC (rev 27667)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c   2010-03-22 
19:38:40 UTC (rev 27668)
@@ -2926,7 +2926,7 @@
        ParticleCacheKey *ca, **cache= edit->pathcache;
        ParticleEditSettings *pset = &scene->toolsettings->particle;
        
-       PTCacheEditPoint *point = edit->points;
+       PTCacheEditPoint *point = NULL;
        PTCacheEditKey *ekey = NULL;
 
        ParticleSystem *psys = edit->psys;
@@ -2941,7 +2941,7 @@
        float hairmat[4][4], rotmat[3][3], prev_tangent[3];
        int k,i;
        int steps = (int)pow(2.0, (double)pset->draw_step);
-       int totpart = edit->totpoint;
+       int totpart = edit->totpoint, recalc_set=0;
        float sel_col[3];
        float nosel_col[3];
 
@@ -2951,6 +2951,11 @@
                /* clear out old and create new empty path cache */
                psys_free_path_cache(edit->psys, edit);
                cache= edit->pathcache= 
psys_alloc_path_cache_buffers(&edit->pathcachebufs, totpart, steps+1);
+
+               /* set flag for update (child particles check this too) */
+               for(i=0, point=edit->points; i<totpart; i++, point++)
+                       point->flag |= PEP_EDIT_RECALC;
+               recalc_set = 1;
        }
 
        frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f;
@@ -2972,7 +2977,7 @@
        }
 
        /*---first main loop: create all actual particles' paths---*/
-       for(i=0; i<totpart; i++, pa+=pa?1:0, point++){
+       for(i=0, point=edit->points; i<totpart; i++, pa+=pa?1:0, point++){
                if(edit->totcached && !(point->flag & PEP_EDIT_RECALC))
                        continue;
 
@@ -3124,6 +3129,12 @@
                ParticleSimulationData sim = {scene, ob, psys, 
psys_get_modifier(ob, psys), NULL};
                psys_cache_child_paths(&sim, cfra, 1);
        }
+
+       /* clear recalc flag if set here */
+       if(recalc_set) {
+               for(i=0, point=edit->points; i<totpart; i++, point++)
+                       point->flag &= ~PEP_EDIT_RECALC;
+       }
 }
 /************************************************/
 /*                     Particle Key handling                           */

Modified: trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c     
2010-03-22 17:46:49 UTC (rev 27667)
+++ trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c     
2010-03-22 19:38:40 UTC (rev 27668)
@@ -460,7 +460,7 @@
        prop= RNA_def_property(srna, "draw_particles", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART);
        RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual 
particles");
-       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
+       RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, 
"rna_ParticleEdit_redo");
 
        prop= RNA_def_property(srna, "add_interpolate", PROP_BOOLEAN, 
PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED);


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

Reply via email to