[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41766] branches/soc-2008-mxcurioni/ release/scripts/freestyle/style_modules/parameter_editor.py: Fix for the Perlin Noise 1D geometry modifier having a noise frequency

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sat Nov 12 10:02:25 CET 2011


Revision: 41766
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41766
Author:   kjym3
Date:     2011-11-12 09:02:24 +0000 (Sat, 12 Nov 2011)
Log Message:
-----------
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!

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/parameter_editor.py

Modified: branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/parameter_editor.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/parameter_editor.py	2011-11-12 05:00:24 UTC (rev 41765)
+++ branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/parameter_editor.py	2011-11-12 09:02:24 UTC (rev 41766)
@@ -463,10 +463,11 @@
     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()




More information about the Bf-blender-cvs mailing list