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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-11-12 13:02:24 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-11-12 13:02:24 +0400
commit2910427277f5fc0c201d19d72cd8347e89164e45 (patch)
tree78d7c6172154613fba28c866aad655e446adec63 /release/scripts/freestyle/style_modules
parente7a4d454350beb1ce20f3d7d2d091451a885eefe (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/style_modules')
-rw-r--r--release/scripts/freestyle/style_modules/parameter_editor.py3
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()