Fix for [#22128] particle sizes and physics
authorJanne Karhu <jhkarh@gmail.com>
Sun, 25 Jul 2010 14:40:18 +0000 (14:40 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Sun, 25 Jul 2010 14:40:18 +0000 (14:40 +0000)
* size wasn't updated at all for particles with keyed or no physics

release/scripts/ui/properties_particle.py
source/blender/blenkernel/intern/particle_system.c

index 58e602dd1e2c0f8624b161d6d5fca301bd01b8fe..f858c9b8511a919f46081c4080be9344209e2bc3 100644 (file)
@@ -401,11 +401,12 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
         else:
             row.prop(part, "physics_type", text="")
 
+        row = layout.row()
+        col = row.column(align=True)
+        col.prop(part, "particle_size")
+        col.prop(part, "random_size", slider=True)
+
         if part.physics_type != 'NO':
-            row = layout.row()
-            col = row.column(align=True)
-            col.prop(part, "particle_size")
-            col.prop(part, "random_size", slider=True)
             col = row.column(align=True)
             col.prop(part, "mass")
             col.prop(part, "sizemass", text="Multiply mass with size")
index 181d8fee4ba718a946cd012309cc84a9d185986a..a38fc921beaddf4546d093eb2f0a929f0bf2540d 100644 (file)
@@ -4038,12 +4038,21 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
                                case PART_PHYS_NO:
                                case PART_PHYS_KEYED:
                                {
+                                       PARTICLE_P;
+
                                        if(emit_particles(&sim, NULL, cfra)) {
                                                free_keyed_keys(psys);
                                                distribute_particles(&sim, part->from);
                                                initialize_all_particles(&sim);
                                        }
-                                       reset_all_particles(&sim, 0.0, cfra, 0);
+
+                                       LOOP_EXISTING_PARTICLES {
+                                               pa->size = part->size;
+                                               if(part->randsize > 0.0)
+                                                       pa->size *= 1.0f - part->randsize * PSYS_FRAND(p + 1);
+
+                                               reset_particle(&sim, pa, 0.0, cfra);
+                                       }
 
                                        if(part->phystype == PART_PHYS_KEYED) {
                                                psys_count_keyed_targets(&sim);