Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2015-01-09 17:58:18 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:09 +0300
commitd1246969ed59ac36ffa332c283fb9d89f365a2b4 (patch)
treec7db4bed9809b33dd2211f66aced9667ec0aa889 /source/blender/makesrna/intern/rna_particle.c
parentc86d55d5e77674982a5d1760d8b895bb87af44f5 (diff)
Curve-based control for "roughness" (noise displacement) of child hair.
Diffstat (limited to 'source/blender/makesrna/intern/rna_particle.c')
-rw-r--r--source/blender/makesrna/intern/rna_particle.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 6540604199d..8a9be88b3b1 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -898,6 +898,29 @@ void rna_ParticleSettings_use_clump_curve_set(PointerRNA *ptr, int value)
}
}
+int rna_ParticleSettings_use_roughness_curve_get(PointerRNA *ptr)
+{
+ ParticleSettings *part = ptr->data;
+ return part->roughcurve != NULL;
+}
+
+void rna_ParticleSettings_use_roughness_curve_set(PointerRNA *ptr, int value)
+{
+ ParticleSettings *part = ptr->data;
+
+ if (!value) {
+ if (part->roughcurve) {
+ curvemapping_free(part->roughcurve);
+ part->roughcurve = NULL;
+ }
+ }
+ else {
+ if (!part->roughcurve) {
+ BKE_particlesettings_rough_curve_init(part);
+ }
+ }
+}
+
static void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
{
Object *ob = ptr->id.data;
@@ -2912,6 +2935,18 @@ static void rna_def_particle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
+ prop = RNA_def_property(srna, "use_roughness_curve", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_ParticleSettings_use_roughness_curve_get", "rna_ParticleSettings_use_roughness_curve_set");
+ RNA_def_property_ui_text(prop, "Use Roughness Curve", "Use a curve to define roughness");
+ RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
+
+ prop = RNA_def_property(srna, "roughness_curve", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "roughcurve");
+ RNA_def_property_struct_type(prop, "CurveMapping");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Roughness Curve", "Curve defining roughness");
+ RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
+
prop = RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "clength");
RNA_def_property_range(prop, 0.0f, 1.0f);