diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-02-07 14:43:33 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-02-07 14:43:33 +0300 |
commit | 44fb6bd1fa9f34b1f648f57aa3543512d3af4c48 (patch) | |
tree | b75cbb2d6fd3b9195f0f437ad4f89a0d3971bd45 /source/blender | |
parent | a17d81cabfe0f83c944e779201eaf6310cc96bbe (diff) |
Hair ui simplification:
* There were a lot of settings in the particle panels that made no sense for simple hair and only cluttered up the ui.
* Now these settings are hidden by default unless "advanced" hair options are shown.
* Without advanced options the particle velocity controls are replaced by a simple "hair length" value, which actually corresponds to the grown hair length in blender units.
* Some hair effector options that are actually very useful were not shown in ui. These are now found in the "field weights" panel.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_particle_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 27 |
3 files changed, 28 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 7421c43dc10..5f45e06cfc4 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_EDISTR|PART_TRAND; + part->flag=PART_EDISTR|PART_TRAND|PART_HIDE_ADVANCED_HAIR; part->sta= 1.0; part->end= 200.0; diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index a3a44976fcd..e26414a0d72 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -304,7 +304,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_ROT_DYN (1<<14) /* dynamic rotation */ #define PART_SIZEMASS (1<<16) -//#define PART_HAIR_GRAVITY (1<<15) +#define PART_HIDE_ADVANCED_HAIR (1<<15) //#define PART_ABS_TIME (1<<17) //#define PART_GLOB_TIME (1<<18) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 82e2eb96002..14afbf93373 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -387,6 +387,18 @@ static void rna_PartSettings_end_set(struct PointerRNA *ptr, float value) settings->end = value; } +static void rna_PartSetting_hairlength_set(struct PointerRNA *ptr, float value) +{ + ParticleSettings *settings = (ParticleSettings*)ptr->data; + settings->normfac = value / 4.f; +} + +static float rna_PartSetting_hairlength_get(struct PointerRNA *ptr) +{ + ParticleSettings *settings = (ParticleSettings*)ptr->data; + return settings->normfac * 4.f; +} + static void rna_PartSetting_linelentail_set(struct PointerRNA *ptr, float value) { ParticleSettings *settings = (ParticleSettings*)ptr->data; @@ -1277,6 +1289,12 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass by particle size"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); + prop= RNA_def_property(srna, "use_advanced_hair", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PART_HIDE_ADVANCED_HAIR); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Advanced", "Use full physics calculations for growing hair"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); + prop= RNA_def_property(srna, "lock_boids_to_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D); RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface"); @@ -1294,7 +1312,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "apply_effector_to_children", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT); - RNA_def_property_ui_text(prop, "Children", "Apply effectors to children"); + RNA_def_property_ui_text(prop, "Effect Children", "Apply effectors to children"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "create_long_hair_children", PROP_BOOLEAN, PROP_NONE); @@ -1776,6 +1794,13 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); + prop= RNA_def_property(srna, "hair_length", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_funcs(prop, "rna_PartSetting_hairlength_get", "rna_PartSetting_hairlength_set", NULL); + RNA_def_property_range(prop, 0.0f, 1000.0f); + RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); + RNA_def_property_ui_text(prop, "Hair Length", "Length of the hair"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); + /* physical properties */ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001f, 100000.0f); |