diff options
author | Janne Karhu <jhkarh@gmail.com> | 2009-09-11 02:32:33 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2009-09-11 02:32:33 +0400 |
commit | e9587a89faf33aa0c1383b59f006be4cc7443a5a (patch) | |
tree | bfa5264b90b75a58912448eb3d589b188cbd0472 /source/blender/makesdna | |
parent | fcc5884c252ae10b07a6f8c5e1c5990e9aa4e7c5 (diff) |
Hair dynamics with cloth simulation
- Hair dynamics have their own panel in particle settings with the settings from cloth panel that apply to hair.
- Basic internal friction force to quickly emulate self collisions and volume preservation. (Still very early code, but gives some idea of what's possible).
- Softbody simulation is no longer used for hair.
* Old files with sb dynamics should just load the hair without dynamics so new dynamics can be applied.
* Invasion of particles exceptions in sb code is finally over.
- Collisions with other objects are disabled for now and will be worked out in the future.
Other changes/fixes:
- Particle mode editing flag wasn't saved properly.
- Some old files with edited hair didn't load correctly.
- Disabled delete & specials menu in particle mode for non-hair editing.
- Fixed yet one more cloth & softbody pointcache update issue.
- Disconnect/connect hair now uses only the deformed mesh so it works correctly also for subsurfed emitters.
- Hair editing now updates correctly with a moving emitter.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_cloth_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_force.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_particle_types.h | 15 |
3 files changed, 9 insertions, 10 deletions
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h index 33984582d7f..5cfecf7cc01 100644 --- a/source/blender/makesdna/DNA_cloth_types.h +++ b/source/blender/makesdna/DNA_cloth_types.h @@ -68,6 +68,7 @@ typedef struct ClothSimSettings float defgoal; float goalspring; float goalfrict; + float velocity_smooth; /* smoothing of velocities for hair */ int stepsPerFrame; /* Number of time steps per frame. */ int flags; /* flags, see CSIMSETT_FLAGS enum above. */ int preroll; /* How many frames of simulation to do before we start. */ @@ -78,7 +79,6 @@ typedef struct ClothSimSettings short vgroup_struct; /* vertex group for scaling structural stiffness */ short presets; /* used for presets on GUI */ short pad; - int pad2; } ClothSimSettings; diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 5696f82ab0d..986a75f1a96 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -184,8 +184,6 @@ typedef struct BulletSoftBody { typedef struct SoftBody { - struct ParticleSystem *particles; /* particlesystem softbody */ - /* dynamic data */ int totpoint, totspring; struct BodyPoint *bpoint; /* not saved in file */ diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index d4dc3df0965..6a0a0e1d912 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -105,7 +105,7 @@ typedef struct ParticleData { short flag; short alive; /* the life state of a particle */ short loop; /* how many times particle life has looped */ - short rt; + short hair_index; } ParticleData; typedef struct ParticleSettings { @@ -202,7 +202,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in struct ParticleCacheKey **childcache; /* child cache (runtime) */ ListBase pathcachebufs, childcachebufs; /* buffers for the above */ - struct SoftBody *soft; /* hair softbody */ + struct ClothModifierData *clmd; /* cloth simulation for hair */ + struct DerivedMesh *hair_in_dm, *hair_out_dm; /* input/output for cloth simulation */ struct Object *target_ob; struct Object *lattice; @@ -216,9 +217,9 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in float imat[4][4]; /* used for duplicators */ float cfra, tree_frame; - int seed; + int seed, rt; int flag, totpart, totchild, totcached, totchildcache; - short recalc, target_psys, totkeyed, softflag, bakespace, rt2; + short recalc, target_psys, totkeyed, bakespace; char bb_uvname[3][32]; /* billboard uv name */ @@ -411,16 +412,16 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in /* psys->flag */ #define PSYS_CURRENT 1 #define PSYS_GLOBAL_HAIR 2 -//#define PSYS_BAKE_UI 4 +#define PSYS_HAIR_DYNAMICS 4 #define PSYS_KEYED_TIMING 8 #define PSYS_ENABLED 16 /* deprecated */ -//#define PSYS_FIRST_KEYED 32 +#define PSYS_HAIR_UPDATED 32 /* signal for updating hair particle mode */ #define PSYS_DRAWING 64 //#define PSYS_SOFT_BAKE 128 #define PSYS_DELETE 256 /* remove particlesystem as soon as possible */ #define PSYS_HAIR_DONE 512 #define PSYS_KEYED 1024 -//#define PSYS_EDITED 2048 +#define PSYS_EDITED 2048 //#define PSYS_PROTECT_CACHE 4096 #define PSYS_DISABLED 8192 |