[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45476] branches/soc-2008-mxcurioni/ release/scripts/freestyle/style_modules/parameter_editor.py: Added restrictions so as to apply thickness position options ( revision 45463)

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Mon Apr 9 00:21:49 CEST 2012


Revision: 45476
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45476
Author:   kjym3
Date:     2012-04-08 22:21:48 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Added restrictions so as to apply thickness position options (revision 45463)
only when chaining is disable or the Plain chaining is used with the Same Object
option enabled.  The default "center" positioning is used otherwise.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45463

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	2012-04-08 19:50:00 UTC (rev 45475)
+++ branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/parameter_editor.py	2012-04-08 22:21:48 UTC (rev 45476)
@@ -1213,9 +1213,14 @@
             shaders_list.append(Transform2DShader(
                 m.pivot, m.scale_x, m.scale_y, m.angle, m.pivot_u, m.pivot_x, m.pivot_y))
     color = linestyle.color
+    if (not linestyle.use_chaining) or (linestyle.chaining == "PLAIN" and linestyle.same_object):
+        thickness_position = linestyle.thickness_position
+    else:
+        thickness_position = "CENTER"
+        print("Warning: Thickness poisition options are applied when chaining is disabled")
+        print("    or the Plain chaining is used with the Same Object option enabled.")
     shaders_list.append(BaseColorShader(color.r, color.g, color.b, linestyle.alpha))
-    shaders_list.append(BaseThicknessShader(linestyle.thickness,
-                                            linestyle.thickness_position,
+    shaders_list.append(BaseThicknessShader(linestyle.thickness, thickness_position,
                                             linestyle.thickness_ratio))
     for m in linestyle.color_modifiers:
         if not m.use:
@@ -1258,27 +1263,27 @@
             continue
         if m.type == "ALONG_STROKE":
             shaders_list.append(ThicknessAlongStrokeShader(
-                linestyle.thickness_position, linestyle.thickness_ratio,
+                thickness_position, linestyle.thickness_ratio,
                 m.blend, m.influence, m.mapping, m.invert, m.curve,
                 m.value_min, m.value_max))
         elif m.type == "DISTANCE_FROM_CAMERA":
             shaders_list.append(ThicknessDistanceFromCameraShader(
-                linestyle.thickness_position, linestyle.thickness_ratio,
+                thickness_position, linestyle.thickness_ratio,
                 m.blend, m.influence, m.mapping, m.invert, m.curve,
                 m.range_min, m.range_max, m.value_min, m.value_max))
         elif m.type == "DISTANCE_FROM_OBJECT":
             shaders_list.append(ThicknessDistanceFromObjectShader(
-                linestyle.thickness_position, linestyle.thickness_ratio,
+                thickness_position, linestyle.thickness_ratio,
                 m.blend, m.influence, m.mapping, m.invert, m.curve, m.target,
                 m.range_min, m.range_max, m.value_min, m.value_max))
         elif m.type == "MATERIAL":
             shaders_list.append(ThicknessMaterialShader(
-                linestyle.thickness_position, linestyle.thickness_ratio,
+                thickness_position, linestyle.thickness_ratio,
                 m.blend, m.influence, m.mapping, m.invert, m.curve,
                 m.material_attr, m.value_min, m.value_max))
         elif m.type == "CALLIGRAPHY":
             shaders_list.append(CalligraphicThicknessShader(
-                linestyle.thickness_position, linestyle.thickness_ratio,
+                thickness_position, linestyle.thickness_ratio,
                 m.blend, m.influence,
                 m.orientation, m.min_thickness, m.max_thickness))
     if linestyle.caps == "ROUND":




More information about the Bf-blender-cvs mailing list