[Bf-blender-cvs] [2cbb9d7a768] blender-v3.0-release: Fix T93322: Freestyle Sinus Displacement Division by Zero Crash
Philipp Oeser
noreply at git.blender.org
Tue Nov 23 16:31:29 CET 2021
Commit: 2cbb9d7a76815b4b99be597e011fcf55d85c6c79
Author: Philipp Oeser
Date: Tue Nov 23 11:48:44 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB2cbb9d7a76815b4b99be597e011fcf55d85c6c79
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
===================================================================
M source/blender/makesrna/intern/rna_linestyle.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index 8cd1ac0d963..c47b2ce9042 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");
More information about the Bf-blender-cvs
mailing list