diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-07-03 11:48:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-07-03 11:48:19 +0400 |
commit | 4c3140004aa61169061ddd2628a4f2c8d88f46a1 (patch) | |
tree | 6a708215cd30929f209e595e2c6fee263e717085 /release/scripts/freestyle | |
parent | 5a516098fcddf8d7a59fb06ddb43c1863d4233eb (diff) |
Fixed a bug introduced in the last commit to address the issue
of cap shaders.
Diffstat (limited to 'release/scripts/freestyle')
-rw-r--r-- | release/scripts/freestyle/style_modules/parameter_editor.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py index 3a52329ca74..d5f9fc4a251 100644 --- a/release/scripts/freestyle/style_modules/parameter_editor.py +++ b/release/scripts/freestyle/style_modules/parameter_editor.py @@ -351,7 +351,8 @@ class RoundCapShader(StrokeShader): buffer = [] for sv in iter_stroke_vertices(stroke): buffer.append((sv.getPoint(), sv.attribute())) - if len(buffer) < 2: + nverts = len(buffer) + if nverts < 2: return # calculate the number of additional vertices to form caps R, L = stroke[0].attribute().getThicknessRL() @@ -360,8 +361,7 @@ class RoundCapShader(StrokeShader): R, L = stroke[-1].attribute().getThicknessRL() caplen_end = (R + L) / 2.0 nverts_end = max(5, int(R + L)) - # increase the total number of stroke vertices - nverts = stroke.strokeVerticesSize() + # adjust the total number of stroke vertices stroke.Resample(nverts + nverts_beg + nverts_end) # restore the location and attribute of the original vertices for i in range(nverts): @@ -401,7 +401,8 @@ class SquareCapShader(StrokeShader): buffer = [] for sv in iter_stroke_vertices(stroke): buffer.append((sv.getPoint(), sv.attribute())) - if len(buffer) < 2: + nverts = len(buffer) + if nverts < 2: return # calculate the number of additional vertices to form caps R, L = stroke[0].attribute().getThicknessRL() @@ -410,8 +411,7 @@ class SquareCapShader(StrokeShader): R, L = stroke[-1].attribute().getThicknessRL() caplen_end = (R + L) / 2.0 nverts_end = 1 - # increase the total number of stroke vertices - nverts = stroke.strokeVerticesSize() + # adjust the total number of stroke vertices stroke.Resample(nverts + nverts_beg + nverts_end) # restore the location and attribute of the original vertices for i in range(nverts): |