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-10-30 20:00:35 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-10-30 20:00:35 +0400
commitf0acdcf13526046236ce561736521100cba58ff1 (patch)
tree519edbd9f908e2f5c8fea76db1b5e5b12df13ea9 /release/scripts/freestyle/style_modules/parameter_editor.py
parent1f252288574f03205f329689693a0f483a894f89 (diff)
Fix for stroke rendering instability with stroke geometry shaders.
* Stroke::Resample(int nPoints) was not properly working when a wrong value was returned from Stroke::getLength2D(), resulting in repeated warning messages "Warning: incorrect points number" during stroke rendering. The main cause was that stroke geometry shaders did not update the two-dimensional (2D) length (also referred to as curvilinear abscissa) after they modified the 2D points of stroke vertices. Now all stroke geometry shaders make explicit calls for Stroke::UpdateLength() that has been introduced for recomputing the 2D length. Many thanks to Josef who reported the problem together with sample .blend files for reproducing the issue. * Missing Python wrapper of Stroke::getLength2D() was added.
Diffstat (limited to 'release/scripts/freestyle/style_modules/parameter_editor.py')
-rw-r--r--release/scripts/freestyle/style_modules/parameter_editor.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py
index dc98b968acf..97df74c8a0c 100644
--- a/release/scripts/freestyle/style_modules/parameter_editor.py
+++ b/release/scripts/freestyle/style_modules/parameter_editor.py
@@ -449,6 +449,7 @@ class SinusDisplacementShader(StrokeShader):
u = v.u()
n = n * self._amplitude * math.cos(distance / self._wavelength * 2 * math.pi + self._phase)
v.setPoint(p + n)
+ stroke.UpdateLength()
class PerlinNoise1DShader(StrokeShader):
def __init__(self, freq = 10, amp = 10, oct = 4, angle = 45, seed = -1):
@@ -468,6 +469,7 @@ class PerlinNoise1DShader(StrokeShader):
nres = self.__noise.turbulence1(v.u(), self.__freq, self.__amp, self.__oct)
v.setPoint(v.getPoint() + nres * self.__dir)
it.increment()
+ stroke.UpdateLength()
class PerlinNoise2DShader(StrokeShader):
def __init__(self, freq = 10, amp = 10, oct = 4, angle = 45, seed = -1):
@@ -488,6 +490,7 @@ class PerlinNoise2DShader(StrokeShader):
nres = self.__noise.turbulence2(vec, self.__freq, self.__amp, self.__oct)
v.setPoint(v.getPoint() + nres * self.__dir)
it.increment()
+ stroke.UpdateLength()
# Predicates and helper functions