[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39407] branches/soc-2011-avocado/blender/ source/blender/editors/mesh/autoseam_tools.c: Removed the problem of live unwrap option by adding a custom UV layer for stretch calculation at the beginning of the autoseam operator and removing it before calling the actual unwrap function .

shuvro sarker shuvro05 at gmail.com
Mon Aug 15 07:32:34 CEST 2011


Revision: 39407
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39407
Author:   shuvro
Date:     2011-08-15 05:32:34 +0000 (Mon, 15 Aug 2011)
Log Message:
-----------
Removed the problem of live unwrap option by adding a custom UV layer for stretch calculation at the beginning of the autoseam operator and removing it before calling the actual unwrap function.

Modified Paths:
--------------
    branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c

Modified: branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c
===================================================================
--- branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c	2011-08-15 04:58:19 UTC (rev 39406)
+++ branches/soc-2011-avocado/blender/source/blender/editors/mesh/autoseam_tools.c	2011-08-15 05:32:34 UTC (rev 39407)
@@ -61,10 +61,10 @@
 #include "MEM_guardedalloc.h"
 #include "WM_api.h"
 #include "autoseam_C_API.h"
+#include "ED_mesh.h"
 
 
 
-
 #define INF 999999
 
 static float min_value = INF;
@@ -641,6 +641,9 @@
 	BMEditMesh *em= ((Mesh *)obedit->data)->edit_btmesh;
 	BMesh *bm = em->bm;
 	
+	//Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
+	//Mesh *me= ob->data;
+	
 	if(!(bm->totfacesel)) {
 		BKE_report(op->reports, RPT_WARNING, "No selected face found.");
 		return OPERATOR_CANCELLED;
@@ -663,10 +666,12 @@
 	autoseam_clear_seam(bm);
 	autoseam_set_map_default(adj);
 	
+	ED_mesh_uv_texture_add(C, me, "stretch_layer", TRUE);
 	/* This function will call the recusive function for each of the components of bmesh*/
 	//handle_separate_components(adj, num_faces, bm, maxdepth, C);
 	do_all_components(bm, maxdepth, C, stretch_algo);
 	
+	ED_mesh_uv_texture_remove(C, obedit, me);
 	
 	
 	/* If live unwrapping enable, unwrap the seams after marking */
@@ -741,11 +746,11 @@
 	RNA_def_enum(ot->srna, "method", method_items, 0, "Unwrap Method", "Unwrapping method. Angle Based usually gives better results than Conformal, while being somewhat slower.");
 	RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry.");
 	RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect", "Map UV's taking image aspect ratio into account.");
+	
+	RNA_def_boolean(ot->srna, "live_unwrap", 0, "Live Unwrap", "Unwrap the seams in the UV editor automatically after marking seams.");
 	RNA_def_float_factor(ot->srna, "margin", 0.1f, 0.0f, 1.0f, "Island Margin", "Space between islands", 0.0f, 1.0f);
-	RNA_def_boolean(ot->srna, "live_unwrap", 0, "Live Unwrap", "Unwrap the seams in the UV editor automatically after marking seams.");
 	
 
-	
 }
 
 




More information about the Bf-blender-cvs mailing list