[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40375] branches/soc-2008-mxcurioni: Rearranged the organization of chaining options in line styles.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Tue Sep 20 01:24:14 CEST 2011


Revision: 40375
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40375
Author:   kjym3
Date:     2011-09-19 23:24:14 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
Rearranged the organization of chaining options in line styles.

New there are only two chaining types: plain and sketchy.  Both chaining types
have the "same object" option.  With this option enabled, only feature edges of
the same object are chained.  The sketchy chaining also has the "rounds" option
to specify the number of rounds in a sketchy multiple touch.

Also removed a temporary workaround (implemented by means of a custom chaining
rule) for infinite straight lines, which has resulted in much cleaner strokes.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/parameter_editor.py
    branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c
    branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
    branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_linestyle_types.h
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_linestyle.c

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-09-19 22:49:01 UTC (rev 40374)
+++ branches/soc-2008-mxcurioni/release/scripts/freestyle/style_modules/parameter_editor.py	2011-09-19 23:24:14 UTC (rev 40375)
@@ -881,15 +881,16 @@
         upred = TrueUP1D()
     Operators.select(upred)
     # join feature edges to form chains
-    if linestyle.chaining == "NATURAL":
-        bpred = AngleLargerThanBP1D(1.0) # XXX temporary fix for occasional unexpected long lines
+    if linestyle.chaining == "PLAIN":
         if linestyle.same_object:
-            bpred = AndBP1D(bpred, SameShapeIdBP1D())
-        Operators.bidirectionalChain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
-    elif linestyle.chaining == "SKETCHY_TOPOLOGY_PRESERVED":
-        Operators.bidirectionalChain(pySketchyChainSilhouetteIterator(linestyle.rounds))
-    elif linestyle.chaining == "SKETCHY_TOPOLOGY_BROKEN":
-        Operators.bidirectionalChain(pySketchyChainingIterator(linestyle.rounds))
+            Operators.bidirectionalChain(ChainSilhouetteIterator(), NotUP1D(upred))
+        else:
+            Operators.bidirectionalChain(ChainPredicateIterator(upred, TrueBP1D()), NotUP1D(upred))
+    elif linestyle.chaining == "SKETCHY":
+        if linestyle.same_object:
+            Operators.bidirectionalChain(pySketchyChainSilhouetteIterator(linestyle.rounds))
+        else:
+            Operators.bidirectionalChain(pySketchyChainingIterator(linestyle.rounds))
     # split chains
     if linestyle.material_boundary:
         Operators.sequentialSplit(MaterialBoundaryUP0D())

Modified: branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py	2011-09-19 22:49:01 UTC (rev 40374)
+++ branches/soc-2008-mxcurioni/release/scripts/startup/bl_ui/properties_render.py	2011-09-19 23:24:14 UTC (rev 40375)
@@ -515,12 +515,12 @@
             col = layout.column()
             col.label(text="Chaining:")
             col.prop(linestyle, "chaining", text="")
-            if linestyle.chaining == "NATURAL":
+            if linestyle.chaining == "PLAIN":
                 col.prop(linestyle, "same_object")
-            elif linestyle.chaining == "SKETCHY_TOPOLOGY_PRESERVED":
-                col.prop(linestyle, "rounds")
-            elif linestyle.chaining == "SKETCHY_TOPOLOGY_BROKEN":
-                col.prop(linestyle, "rounds")
+            elif linestyle.chaining == "SKETCHY":
+                sub = col.row()
+                sub.prop(linestyle, "same_object")
+                sub.prop(linestyle, "rounds")
             # Splitting
             col = layout.column()
             col.label(text="Splitting:")

Modified: branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c	2011-09-19 22:49:01 UTC (rev 40374)
+++ branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c	2011-09-19 23:24:14 UTC (rev 40375)
@@ -69,7 +69,7 @@
 	linestyle->r = linestyle->g = linestyle->b = 0.0;
 	linestyle->alpha = 1.0;
 	linestyle->thickness = 1.0;
-	linestyle->chaining = LS_CHAINING_NATURAL;
+	linestyle->chaining = LS_CHAINING_PLAIN;
 	linestyle->rounds = 3;
 	linestyle->min_length = 0.0f;
 	linestyle->max_length = 10000.0f;

Modified: branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2011-09-19 22:49:01 UTC (rev 40374)
+++ branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2011-09-19 23:24:14 UTC (rev 40375)
@@ -12281,7 +12281,7 @@
 		}
 		for(linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
 			if (linestyle->chaining == 0)
-				linestyle->chaining= LS_CHAINING_NATURAL;
+				linestyle->chaining= LS_CHAINING_PLAIN;
 			if (linestyle->rounds == 0)
 				linestyle->rounds= 3;
 		}

Modified: branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_linestyle_types.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_linestyle_types.h	2011-09-19 22:49:01 UTC (rev 40374)
+++ branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_linestyle_types.h	2011-09-19 23:24:14 UTC (rev 40375)
@@ -323,9 +323,8 @@
 #define LS_MAX_2D_LENGTH      32
 
 /* FreestyleLineStyle::chaining */
-#define LS_CHAINING_NATURAL                     1
-#define LS_CHAINING_SKETCHY_TOPOLOGY_PRESERVED  2
-#define LS_CHAINING_SKETCHY_TOPOLOGY_BROKEN     3
+#define LS_CHAINING_PLAIN    1
+#define LS_CHAINING_SKETCHY  2
 
 /* FreestyleLineStyle::caps */
 #define LS_CAPS_BUTT    1

Modified: branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_linestyle.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_linestyle.c	2011-09-19 22:49:01 UTC (rev 40374)
+++ branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_linestyle.c	2011-09-19 23:24:14 UTC (rev 40375)
@@ -675,9 +675,8 @@
 		{LS_PANEL_MISC, "MISC", 0, "Misc", "Show the panel for miscellaneous options."},
 		{0, NULL, 0, NULL, NULL}};
 	static EnumPropertyItem chaining_items[] = {
-		{LS_CHAINING_NATURAL, "NATURAL", 0, "Natural", "Natural chaining."},
-		{LS_CHAINING_SKETCHY_TOPOLOGY_PRESERVED, "SKETCHY_TOPOLOGY_PRESERVED", 0, "Sketchy: Topology Preserved", "Natural chaining with a sketchy multiple touch."},
-		{LS_CHAINING_SKETCHY_TOPOLOGY_BROKEN, "SKETCHY_TOPOLOGY_BROKEN", 0, "Sketchy: Topology Broken", "Sketchy chaining with a broken topology of objects."},
+		{LS_CHAINING_PLAIN, "PLAIN", 0, "Plain", "Plain chaining."},
+		{LS_CHAINING_SKETCHY, "SKETCHY", 0, "Sketchy", "Sketchy chaining with a multiple touch."},
 		{0, NULL, 0, NULL, NULL}};
 	static EnumPropertyItem cap_items[] = {
 		{LS_CAPS_BUTT, "BUTT", 0, "Butt", "Butt cap (flat)."},
@@ -737,7 +736,7 @@
 	prop= RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_int_sdna(prop, NULL, "rounds");
 	RNA_def_property_range(prop, 1, 1000);
-	RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in a sketch multiple touch.");
+	RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in a sketchy multiple touch.");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 
 	prop= RNA_def_property(srna, "geometry_modifiers", PROP_COLLECTION, PROP_NONE);




More information about the Bf-blender-cvs mailing list