diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-10 03:19:46 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-12-10 03:19:46 +0400 |
commit | 5083e0737f6413c63ab49b82735333534181d9b4 (patch) | |
tree | b21a7977e79ff5db7bc2c7f53471cc2f5ccf76bd /release/scripts/freestyle | |
parent | 3c4987f98378d44eda133311c65aa19412e4cd38 (diff) |
All angle properties were switched from degrees to radians (using PROP_ANGLE
RNA subtype), since Freestyle internally use angles in radians.
A patch set by Bastien Montagne (many thanks!)
NOTICE FOR BRANCH USERS:
This commit may break line drawing settings of already saved Freestyle files.
All angles are now treated as radians instead of degrees, so collections of
angle values might be necessary in order to recover previous visual results.
Affected properties are:
- Crease Angle in the edge detection options
- Min 2D Angle in the 'Splitting' section of a line style
- Max 2D Angle in the 'Splitting' section of a line style
- 'orientation' parameter of the Calligraphy thickness modifier
- 'angle' parameter of the PerlinNoise1D geometry modifier
- 'angle' parameter of the PerlinNoise2D geometry modifier
- 'angle' parameter of the 2DTransform geometry modifier
Diffstat (limited to 'release/scripts/freestyle')
-rw-r--r-- | release/scripts/freestyle/style_modules/parameter_editor.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py index 71d55e9a541..b2086eb1782 100644 --- a/release/scripts/freestyle/style_modules/parameter_editor.py +++ b/release/scripts/freestyle/style_modules/parameter_editor.py @@ -480,8 +480,7 @@ class CalligraphicThicknessShader(ThicknessBlenderMixIn, ScalarBlendModifier): blend, influence, orientation, min_thickness, max_thickness): ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio) ScalarBlendModifier.__init__(self, blend, influence) - rad = orientation / 180.0 * math.pi - self.__orientation = mathutils.Vector((math.cos(rad), math.sin(rad))) + self.__orientation = mathutils.Vector((math.cos(orientation), math.sin(orientation))) self.__min_thickness = min_thickness self.__max_thickness = max_thickness def shade(self, stroke): @@ -533,14 +532,13 @@ class SinusDisplacementShader(StrokeShader): stroke.UpdateLength() class PerlinNoise1DShader(StrokeShader): - def __init__(self, freq = 10, amp = 10, oct = 4, angle = 45, seed = -1): + def __init__(self, freq = 10, amp = 10, oct = 4, angle = math.radians(45), seed = -1): StrokeShader.__init__(self) self.__noise = Noise(seed) self.__freq = freq self.__amp = amp self.__oct = oct - theta = pi * angle / 180.0 - self.__dir = Vector([cos(theta), sin(theta)]) + self.__dir = Vector([cos(angle), sin(angle)]) def getName(self): return "PerlinNoise1DShader" def shade(self, stroke): @@ -554,14 +552,13 @@ class PerlinNoise1DShader(StrokeShader): stroke.UpdateLength() class PerlinNoise2DShader(StrokeShader): - def __init__(self, freq = 10, amp = 10, oct = 4, angle = 45, seed = -1): + def __init__(self, freq = 10, amp = 10, oct = 4, angle = math.radians(45), seed = -1): StrokeShader.__init__(self) self.__noise = Noise(seed) self.__freq = freq self.__amp = amp self.__oct = oct - theta = pi * angle / 180.0 - self.__dir = Vector([cos(theta), sin(theta)]) + self.__dir = Vector([cos(angle), sin(angle)]) def getName(self): return "PerlinNoise2DShader" def shade(self, stroke): @@ -647,8 +644,8 @@ class Transform2DShader(StrokeShader): elif self.__pivot == "ABSOLUTE": pivot = Vector([self.__pivot_x, self.__pivot_y]) # apply scaling and rotation operations - cos_theta = math.cos(math.pi * self.__angle / 180.0) - sin_theta = math.sin(math.pi * self.__angle / 180.0) + cos_theta = math.cos(self.__angle) + sin_theta = math.sin(self.__angle) it = stroke.strokeVerticesBegin() while not it.isEnd(): v = it.getObject() @@ -883,7 +880,7 @@ class DashedLineShader(StrokeShader): class AngleLargerThanBP1D(BinaryPredicate1D): def __init__(self, angle): BinaryPredicate1D.__init__(self) - self._angle = math.pi * angle / 180.0 + self._angle = angle def getName(self): return "AngleLargerThanBP1D" def __call__(self, i1, i2): |