diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-11-12 13:02:24 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-11-12 13:02:24 +0400 |
commit | 2910427277f5fc0c201d19d72cd8347e89164e45 (patch) | |
tree | 78d7c6172154613fba28c866aad655e446adec63 /release/scripts/freestyle | |
parent | e7a4d454350beb1ce20f3d7d2d091451a885eefe (diff) |
Fix for the Perlin Noise 1D geometry modifier having a noise frequency
relative to the stroke length (i.e., the number of noise displacement
values was the same for strokes of different lengths). This resulted
in very noisy short strokes and much less noisy long strokes. Now the
noise frequency is relative to the distance from the starting point of
a stroke. That is, two strokes of the same length will be distorted
by the same number of noise displacement values, whereas longer strokes
will have more noise displacement values along stroke.
Problem report by JO5EF through the BA Freestyle thread, thank you!
Diffstat (limited to 'release/scripts/freestyle')
-rw-r--r-- | release/scripts/freestyle/style_modules/parameter_editor.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py index 5531082e68b..6da3e509e86 100644 --- a/release/scripts/freestyle/style_modules/parameter_editor.py +++ b/release/scripts/freestyle/style_modules/parameter_editor.py @@ -463,10 +463,11 @@ class PerlinNoise1DShader(StrokeShader): def getName(self): return "PerlinNoise1DShader" def shade(self, stroke): + length = stroke.getLength2D() it = stroke.strokeVerticesBegin() while not it.isEnd(): v = it.getObject() - nres = self.__noise.turbulence1(v.u(), self.__freq, self.__amp, self.__oct) + nres = self.__noise.turbulence1(length * v.u(), self.__freq, self.__amp, self.__oct) v.setPoint(v.getPoint() + nres * self.__dir) it.increment() stroke.UpdateLength() |