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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-11-23 13:48:44 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-01-17 18:38:44 +0300
commit50733e1479943d2652cbb3a60d92877674250b60 (patch)
tree7241e03bf322a454a0ed8dce596d57d493c7ffde
parent944a705215f48de70001bf106cda8c2932ea0b60 (diff)
Fix T93322: Freestyle Sinus Displacement Division by Zero Crash
This happens if the Wavelength is set to 0.0f. Not sure if we really need a do_version patch for old files, as an alternative we could also force a slight offset in the SinusDisplacementShader. This patch does not do either, just force a positive range from now on. Maniphest Tasks: T93322 Differential Revision: https://developer.blender.org/D13329
-rw-r--r--source/blender/makesrna/intern/rna_linestyle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index 788246f5edd..945f13fa90b 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -1306,8 +1306,9 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
srna, "Sinus Displacement", "Add sinus displacement to stroke backbone geometry");
rna_def_geometry_modifier(srna);
- prop = RNA_def_property(srna, "wavelength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "wavelength", PROP_FLOAT, PROP_UNSIGNED);
RNA_def_property_float_sdna(prop, NULL, "wavelength");
+ RNA_def_property_range(prop, 0.0001f, FLT_MAX);
RNA_def_property_ui_text(prop, "Wavelength", "Wavelength of the sinus displacement");
RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");