diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-12-13 13:45:24 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-12-13 13:45:24 +0300 |
commit | 7bf5d9449c615120169eb290a3a8f46e53157340 (patch) | |
tree | f22fd585496ad7bc1ea7e617863a744441ed0614 /source | |
parent | c85adcc2e439b7ecfede6e01a6e21f2f6258406b (diff) |
"Fix" for [#25184] Forces for growing hair - update inconsistency - as discussed with Jahka on Saturday on IRC
* New option to "Regrow hair" for each frame.
* This was perhaps more a feature request, but there was a similar useful feature called "animated hair" in particles at some point.
* The previous behavior for hair growing was inconsistent to say the least, so this is a nice option to have.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_particle_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 5 |
5 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index a81406f0af1..2ec90eb29db 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3473,7 +3473,7 @@ static void default_particle_settings(ParticleSettings *part) part->bb_uv_split=1; part->bb_align=PART_BB_VIEW; part->bb_split_offset=PART_BB_OFF_LINEAR; - part->flag=PART_REACT_MULTIPLE|PART_HAIR_GEOMETRY|PART_EDISTR|PART_TRAND; + part->flag=PART_EDISTR|PART_TRAND; part->sta= 1.0; part->end= 200.0; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 60f54cfebf2..c7a65b8a5ee 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4006,7 +4006,7 @@ static void psys_prepare_physics(ParticleSimulationData *sim) static int hair_needs_recalc(ParticleSystem *psys) { if(!(psys->flag & PSYS_EDITED) && (!psys->edit || !psys->edit->edited) && - ((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET)) { + ((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET || (psys->part->flag & PART_HAIR_REGROW && !psys->edit))) { return 1; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 44fbf9ef317..2661f046178 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -11173,6 +11173,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for(part = main->particle.first; part; part = part->id.next) { if(part->boids) part->boids->pitch = 1.0f; + + part->flag &= ~PART_HAIR_REGROW; /* this was a deprecated flag before */ } for (sc= main->screen.first; sc; sc= sc->id.next) { diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 105fa6d5289..e336d3056ea 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -273,7 +273,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in /* for dopesheet */ #define PART_DS_EXPAND 8 -#define PART_HAIR_GEOMETRY 16 +#define PART_HAIR_REGROW 16 /* regrow hair for each frame */ #define PART_UNBORN 32 /*show unborn particles*/ #define PART_DIED 64 /*show died particles*/ diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 649ba0f3a1d..90aeba65118 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1183,6 +1183,11 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Multi React", "React multiple times"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); + prop= RNA_def_property(srna, "regrow_hair", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_REGROW); + RNA_def_property_ui_text(prop, "Regrow", "Regrow hair for each frame"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); + prop= RNA_def_property(srna, "show_unborn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN); RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted"); |