[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38578] branches/soc-2011-onion/source/ blender/editors/uvedit: smart stitch

Antony Riakiotakis kalast at gmail.com
Thu Jul 21 20:01:18 CEST 2011


Revision: 38578
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38578
Author:   psy-fi
Date:     2011-07-21 18:01:16 +0000 (Thu, 21 Jul 2011)
Log Message:
-----------
smart stitch
============================
-smart stitch: add missing rna properties for operator.

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_intern.h
    branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c

Modified: branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_intern.h
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_intern.h	2011-07-21 17:44:00 UTC (rev 38577)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_intern.h	2011-07-21 18:01:16 UTC (rev 38578)
@@ -45,8 +45,8 @@
 /*
  * defines for operator stitch modes, usable both for operator and prevewer below
  */
-#define VERT_STITCH 1
-#define EDGE_STITCH 2
+#define VERT_STITCH 0
+#define EDGE_STITCH 1
 
 /* Object that stores display data for previewing before accepting stitching */
 typedef struct StitchPreviewer {

Modified: branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c	2011-07-21 17:44:00 UTC (rev 38577)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c	2011-07-21 18:01:16 UTC (rev 38578)
@@ -1996,6 +1996,9 @@
 
 	RNA_float_set(op->ptr, "limit", stitch_state->limitDist);
 	RNA_boolean_set(op->ptr, "use_limit", stitch_state->use_limit);
+	RNA_boolean_set(op->ptr, "snap_islands", stitch_state->snapIslands);
+	RNA_enum_set(op->ptr, "mode", stitch_state->mode);
+
 	/* remember to set vertices used for redo operator in an RNA array or something */
 
 	EM_free_uv_vert_map2(stitch_state->vmap);
@@ -2237,6 +2240,11 @@
 
 static void UV_OT_stitch(wmOperatorType *ot)
 {
+	static EnumPropertyItem mode[] = {
+		{VERT_STITCH, "VERT_STITCH", 0, "Vertex Stitch", ""},
+		{EDGE_STITCH, "EDGE_STITCH", 0, "Edge Stitch", ""},
+		{0, NULL, 0, NULL, NULL}};
+
 	/* identifiers */
 	ot->name= "Stitch";
 	ot->description= "Stitch selected UV vertices by proximity";
@@ -2252,6 +2260,8 @@
 
 	/* properties */
 	RNA_def_boolean(ot->srna, "use_limit", 0, "Use Limit", "Stitch UVs within a specified limit distance.");
+	RNA_def_boolean(ot->srna, "snap_islands", 0, "Snap Islands", "Snap islands together. On edge stitch mode, rotates the islands too");
+	RNA_def_enum(ot->srna, "mode", mode, 0, "Mode", "Vertex or edge stitching mode. In Edge stitching, both uv's must be stitchable to stitch");
 	RNA_def_float(ot->srna, "limit", 0.01f, 0.0f, FLT_MAX, "Limit", "Limit distance in normalized coordinates.", -FLT_MAX, FLT_MAX);
 }
 




More information about the Bf-blender-cvs mailing list