[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29669] branches/particles-2010: Initial merge of particle system improvements

Lukas Tönne lukas.toenne at hotmail.com
Thu Jun 24 15:52:28 CEST 2010


Revision: 29669
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29669
Author:   lukastoenne
Date:     2010-06-24 15:52:27 +0200 (Thu, 24 Jun 2010)

Log Message:
-----------
Initial merge of particle system improvements

Detailed information about current and planned features can be found here:
http://wiki.blender.org/index.php/User:Phonybone/Modular_particle_system

Actual changes made so far:
=== Changes to file layout ===
+ Current particle code mostly goes to BKE_particle_system.h/particle_system.c
+ Newly created BKE_particle_settings.h/particle_settings.c to contain future particle configuration code (modifiers/nodes), currently only emitters and link slots
+ Emitter code moved to BKE_particle_emitter.h/particle_emitter.c (see "Modular emitters" below)

=== Paged particle buffer ===
+ Particles have a buffer using a dynamic paging system
+ No contiguous memory block any more, instead a lightweight array of pages holds pointers to actual particle data
+ ParticleData buffers don't necessarily exist in memory when no particles on that page are alive (drastically reduces memory usage)
+ Access functions and iterators to be used from outside particle system code
+ New particles can be created any time, the buffer is automatically extended
+ Particles can be killed any time, dead pages are removed when cleaning up

=== Modular emitters ===
+ Emission not bound to the system's owning object any more
+ Emitters become a feature of the particle settings, better fits future node-based configuration design
+ Generic object links define emission source mesh, includes vertex group names
+ Multiple emitters can be used per particle system

*** Broken/unfinished things ***
- Child particles disabled, paged buffer not implemented yet
- Some emitter distributions (grid, jittered) don't work well with randomized emission, could still be reworked for "Interval" emission mode (fixed amount over frame interval)
- Hair not displayed, emission needs to be redone to account for flexible timing
- Caching disabled, will probably use streaming instead of fixed amounts
- BKE_particle_link.h/particle_link.c can probably be removed, code belongs to system/settings

Modified Paths:
--------------
    branches/particles-2010/release/scripts/ui/properties_data_modifier.py
    branches/particles-2010/release/scripts/ui/properties_particle.py
    branches/particles-2010/source/blender/blenkernel/BKE_boids.h
    branches/particles-2010/source/blender/blenkernel/BKE_effect.h
    branches/particles-2010/source/blender/blenkernel/BKE_pointcache.h
    branches/particles-2010/source/blender/blenkernel/intern/anim.c
    branches/particles-2010/source/blender/blenkernel/intern/boids.c
    branches/particles-2010/source/blender/blenkernel/intern/depsgraph.c
    branches/particles-2010/source/blender/blenkernel/intern/effect.c
    branches/particles-2010/source/blender/blenkernel/intern/library.c
    branches/particles-2010/source/blender/blenkernel/intern/object.c
    branches/particles-2010/source/blender/blenkernel/intern/particle_system.c
    branches/particles-2010/source/blender/blenkernel/intern/pointcache.c
    branches/particles-2010/source/blender/blenkernel/intern/smoke.c
    branches/particles-2010/source/blender/blenloader/intern/readfile.c
    branches/particles-2010/source/blender/blenloader/intern/writefile.c
    branches/particles-2010/source/blender/editors/interface/interface_templates.c
    branches/particles-2010/source/blender/editors/object/object_add.c
    branches/particles-2010/source/blender/editors/object/object_edit.c
    branches/particles-2010/source/blender/editors/object/object_modifier.c
    branches/particles-2010/source/blender/editors/object/object_select.c
    branches/particles-2010/source/blender/editors/object/object_vgroup.c
    branches/particles-2010/source/blender/editors/physics/particle_boids.c
    branches/particles-2010/source/blender/editors/physics/particle_edit.c
    branches/particles-2010/source/blender/editors/physics/particle_object.c
    branches/particles-2010/source/blender/editors/physics/physics_intern.h
    branches/particles-2010/source/blender/editors/physics/physics_ops.c
    branches/particles-2010/source/blender/editors/physics/physics_pointcache.c
    branches/particles-2010/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/particles-2010/source/blender/editors/space_buttons/buttons_context.c
    branches/particles-2010/source/blender/editors/space_info/info_stats.c
    branches/particles-2010/source/blender/editors/space_view3d/drawobject.c
    branches/particles-2010/source/blender/editors/space_view3d/drawvolume.c
    branches/particles-2010/source/blender/editors/space_view3d/view3d_header.c
    branches/particles-2010/source/blender/editors/transform/transform.c
    branches/particles-2010/source/blender/editors/transform/transform_conversions.c
    branches/particles-2010/source/blender/editors/transform/transform_manipulator.c
    branches/particles-2010/source/blender/makesdna/DNA_modifier_types.h
    branches/particles-2010/source/blender/makesdna/DNA_particle_types.h
    branches/particles-2010/source/blender/makesdna/intern/makesdna.c
    branches/particles-2010/source/blender/makesrna/intern/makesrna.c
    branches/particles-2010/source/blender/makesrna/intern/rna_boid.c
    branches/particles-2010/source/blender/makesrna/intern/rna_fluidsim.c
    branches/particles-2010/source/blender/makesrna/intern/rna_internal.h
    branches/particles-2010/source/blender/makesrna/intern/rna_main_api.c
    branches/particles-2010/source/blender/makesrna/intern/rna_modifier.c
    branches/particles-2010/source/blender/makesrna/intern/rna_object.c
    branches/particles-2010/source/blender/makesrna/intern/rna_particle.c
    branches/particles-2010/source/blender/makesrna/intern/rna_sculpt_paint.c
    branches/particles-2010/source/blender/makesrna/intern/rna_smoke.c
    branches/particles-2010/source/blender/modifiers/MOD_modifiertypes.h
    branches/particles-2010/source/blender/modifiers/intern/MOD_bevel.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_build.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_decimate.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_edgesplit.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_explode.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_multires.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_particleinstance.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_particlesystem.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_shapekey.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_smooth.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_softbody.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_solidify.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_util.c
    branches/particles-2010/source/blender/render/intern/source/convertblender.c
    branches/particles-2010/source/blender/render/intern/source/pointdensity.c

Added Paths:
-----------
    branches/particles-2010/source/blender/blenkernel/BKE_particle_emitter.h
    branches/particles-2010/source/blender/blenkernel/BKE_particle_link.h
    branches/particles-2010/source/blender/blenkernel/BKE_particle_settings.h
    branches/particles-2010/source/blender/blenkernel/BKE_particle_system.h
    branches/particles-2010/source/blender/blenkernel/intern/particle_emitter.c
    branches/particles-2010/source/blender/blenkernel/intern/particle_link.c
    branches/particles-2010/source/blender/blenkernel/intern/particle_settings.c
    branches/particles-2010/source/blender/makesdna/DNA_particle_link_types.h
    branches/particles-2010/source/blender/makesrna/intern/rna_particle_link.c
    branches/particles-2010/source/blender/modifiers/intern/MOD_particleemitter.c

Removed Paths:
-------------
    branches/particles-2010/source/blender/blenkernel/BKE_particle.h
    branches/particles-2010/source/blender/blenkernel/intern/particle.c

Modified: branches/particles-2010/release/scripts/ui/properties_data_modifier.py
===================================================================
--- branches/particles-2010/release/scripts/ui/properties_data_modifier.py	2010-06-24 12:15:34 UTC (rev 29668)
+++ branches/particles-2010/release/scripts/ui/properties_data_modifier.py	2010-06-24 13:52:27 UTC (rev 29669)
@@ -460,6 +460,9 @@
             row.operator("object.multires_external_save", text="Save External...")
             row.label()
 
+    def PARTICLE_EMITTER(self, layout, ob, md, wide_ui):
+        layout.label(text="Internal.")
+
     def PARTICLE_INSTANCE(self, layout, ob, md, wide_ui):
         layout.prop(md, "object")
         layout.prop(md, "particle_system_number", text="Particle System")

Modified: branches/particles-2010/release/scripts/ui/properties_particle.py
===================================================================
--- branches/particles-2010/release/scripts/ui/properties_particle.py	2010-06-24 12:15:34 UTC (rev 29668)
+++ branches/particles-2010/release/scripts/ui/properties_particle.py	2010-06-24 13:52:27 UTC (rev 29669)
@@ -111,6 +111,10 @@
                 row.prop(part, "type", text="")
                 row.prop(psys, "seed")
 
+                row = layout.row()
+                row.prop(part, "page_size")
+                row.prop(part, "child_page_size")
+
                 split = layout.split(percentage=0.65)
                 if part.type == 'HAIR':
                     if psys.edited:
@@ -149,6 +153,7 @@
     def draw(self, context):
         layout = self.layout
 
+        ob = context.object
         psys = context.particle_system
         part = psys.settings
         wide_ui = context.region.width > narrowui
@@ -156,8 +161,77 @@
         layout.enabled = particle_panel_enabled(context, psys) and not psys.multiple_caches
 
         row = layout.row()
+        row.template_list(psys, "emitters", part, "active_emitter_index", rows=2)
+        col = row.column(align=True)
+        col.operator("object.particle_emitter_add", icon='ZOOMIN', text="")
+        col.operator("object.particle_emitter_remove", icon='ZOOMOUT', text="")
+        if part.active_emitter_index >= 0:
+            row = layout.row()
+            sub = row.row()
+            sub.label(text="Emitter Object:")
+            sub.prop(psys, "active_emitter_object", text="")
+            
+            emitter = part.emitters[part.active_emitter_index]
+            olas = psys.find_link_assignment(emitter.object_slot_id)
+            if olas:
+                row = layout.row()
+                row.label(text="Vertex Group")
+                row.label(text="Negate")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_density", ob, "vertex_groups", text="Density")
+                row.prop(olas, "vertex_group_density_negate", text="")
+        
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
+                row.prop(olas, "vertex_group_velocity_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_length", ob, "vertex_groups", text="Length")
+                row.prop(olas, "vertex_group_length_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_clump", ob, "vertex_groups", text="Clump")
+                row.prop(olas, "vertex_group_clump_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_kink", ob, "vertex_groups", text="Kink")
+                row.prop(olas, "vertex_group_kink_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_roughness1", ob, "vertex_groups", text="Roughness 1")
+                row.prop(olas, "vertex_group_roughness1_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_roughness2", ob, "vertex_groups", text="Roughness 2")
+                row.prop(olas, "vertex_group_roughness2_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
+                row.prop(olas, "vertex_group_roughness_end_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_size", ob, "vertex_groups", text="Size")
+                row.prop(olas, "vertex_group_size_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_tangent", ob, "vertex_groups", text="Tangent")
+                row.prop(olas, "vertex_group_tangent_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_rotation", ob, "vertex_groups", text="Rotation")
+                row.prop(olas, "vertex_group_rotation_negate", text="")
+
+                row = layout.row()
+                row.prop_object(olas, "vertex_group_field", ob, "vertex_groups", text="Field")
+                row.prop(olas, "vertex_group_field_negate", text="")
+
+        row = layout.row()
         row.active = part.distribution != 'GRID'
         row.prop(part, "amount")
+        
+        row = layout.row()
+        row.prop(part, "emission_rate")
 
         if part.type != 'HAIR':
             split = layout.split()
@@ -1006,6 +1080,7 @@
         basic_force_field_falloff_ui(self, context, part.force_field_2)
 
 
+"""
 class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
     bl_label = "Vertexgroups"
     bl_default_closed = True
@@ -1071,6 +1146,7 @@
         row = layout.row()
         row.prop_object(psys, "vertex_group_field", ob, "vertex_groups", text="Field")
         row.prop(psys, "vertex_group_field_negate", text="")
+"""
 
 
 classes = [
@@ -1087,7 +1163,7 @@
     PARTICLE_PT_children,
     PARTICLE_PT_field_weights,
     PARTICLE_PT_force_fields,
-    PARTICLE_PT_vertexgroups,
+    #PARTICLE_PT_vertexgroups,
 
     PARTICLE_PT_custom_props]
 

Modified: branches/particles-2010/source/blender/blenkernel/BKE_boids.h
===================================================================
--- branches/particles-2010/source/blender/blenkernel/BKE_boids.h	2010-06-24 12:15:34 UTC (rev 29668)
+++ branches/particles-2010/source/blender/blenkernel/BKE_boids.h	2010-06-24 13:52:27 UTC (rev 29669)
@@ -1,4 +1,4 @@
-/* BKE_particle.h
+/* BKE_particle_system.h
  *
  *
  * $Id$
@@ -49,7 +49,7 @@
 
 void boids_precalc_rules(struct ParticleSettings *part, float cfra);
 void boid_brain(BoidBrainData *bbd, int p, struct ParticleData *pa);
-void boid_body(BoidBrainData *bbd, struct ParticleData *pa);
+void boid_body(BoidBrainData *bbd, int p, struct ParticleData *pa);
 void boid_default_settings(BoidSettings *boids);
 BoidRule *boid_new_rule(int type);
 BoidState *boid_new_state(BoidSettings *boids);

Modified: branches/particles-2010/source/blender/blenkernel/BKE_effect.h
===================================================================
--- branches/particles-2010/source/blender/blenkernel/BKE_effect.h	2010-06-24 12:15:34 UTC (rev 29668)
+++ branches/particles-2010/source/blender/blenkernel/BKE_effect.h	2010-06-24 13:52:27 UTC (rev 29669)
@@ -122,7 +122,7 @@
 void			pdEndEffectors(struct ListBase **effectors);
 void			pdDoEffectors(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *impulse);
 
-void pd_point_from_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, struct EffectedPoint *point);
+void pd_point_from_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, int pa_bufpos, struct ParticleKey *state, struct EffectedPoint *point);
 void pd_point_from_loc(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point);
 void pd_point_from_soft(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point);
 

Deleted: branches/particles-2010/source/blender/blenkernel/BKE_particle.h
===================================================================
--- branches/particles-2010/source/blender/blenkernel/BKE_particle.h	2010-06-24 12:15:34 UTC (rev 29668)
+++ branches/particles-2010/source/blender/blenkernel/BKE_particle.h	2010-06-24 13:52:27 UTC (rev 29669)
@@ -1,318 +0,0 @@
-/* BKE_particle.h
- *
- *
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2007 by Janne Karhu.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BKE_PARTICLE_H
-#define BKE_PARTICLE_H
-
-#include "DNA_particle_types.h"
-#include "DNA_object_types.h"
-
-struct ParticleSystemModifierData;
-struct ParticleSystem;
-struct ParticleKey;
-struct ParticleSettings;
-struct HairKey;
-
-struct Main;
-struct Group;
-struct Object;
-struct Scene;
-struct DerivedMesh;
-struct ModifierData;
-struct MTFace;
-struct MCol;
-struct MFace;
-struct MVert;
-struct IpoCurve;
-struct LinkNode;
-struct KDTree;
-struct RNG;
-struct SurfaceModifierData;
-struct BVHTreeRay;
-struct BVHTreeRayHit; 
-
-#define PARTICLE_P				ParticleData *pa; int p
-#define LOOP_PARTICLES	for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++)
-#define LOOP_EXISTING_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & PARS_UNEXIST))
-#define LOOP_SHOWN_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & (PARS_UNEXIST|PARS_NO_DISP)))
-
-#define PSYS_FRAND_COUNT	1024

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list