[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36114] trunk/blender/source/blender/ editors/uvedit/uvedit_ops.c: Fix #26860: uv snap/weld/ stitch did not take live unwrap setting into account.

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Apr 12 16:22:53 CEST 2011


Revision: 36114
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36114
Author:   blendix
Date:     2011-04-12 14:22:52 +0000 (Tue, 12 Apr 2011)
Log Message:
-----------
Fix #26860: uv snap/weld/stitch did not take live unwrap setting into account.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/uvedit/uvedit_ops.c

Modified: trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
===================================================================
--- trunk/blender/source/blender/editors/uvedit/uvedit_ops.c	2011-04-12 12:59:37 UTC (rev 36113)
+++ trunk/blender/source/blender/editors/uvedit/uvedit_ops.c	2011-04-12 14:22:52 UTC (rev 36114)
@@ -347,6 +347,17 @@
 		tf->flag &= ~TF_SEL_MASK(i);
 }
 
+/*********************** live unwrap utilities ***********************/
+
+static void uvedit_live_unwrap_update(SpaceImage *sima, Scene *scene, Object *obedit)
+{
+	if(sima && (sima->flag & SI_LIVE_UNWRAP)) {
+		ED_uvedit_live_unwrap_begin(scene, obedit);
+		ED_uvedit_live_unwrap_re_solve();
+		ED_uvedit_live_unwrap_end(0);
+	}
+}
+
 /*********************** geometric utilities ***********************/
 
 void uv_center(float uv[][2], float cent[2], int quad)
@@ -976,6 +987,7 @@
 
 static void weld_align_uv(bContext *C, int tool)
 {
+	SpaceImage *sima;
 	Scene *scene;
 	Object *obedit;
 	Image *ima;
@@ -988,6 +1000,7 @@
 	obedit= CTX_data_edit_object(C);
 	em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
 	ima= CTX_data_edit_image(C);
+	sima= CTX_wm_space_image(C);
 
 	INIT_MINMAX2(min, max);
 
@@ -1044,6 +1057,7 @@
 		}
 	}
 
+	uvedit_live_unwrap_update(sima, scene, obedit);
 	DAG_id_tag_update(obedit->data, 0);
 	WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 
@@ -1111,6 +1125,7 @@
 
 static int stitch_exec(bContext *C, wmOperator *op)
 {
+	SpaceImage *sima;
 	Scene *scene;
 	Object *obedit;
 	EditMesh *em;
@@ -1123,6 +1138,7 @@
 	obedit= CTX_data_edit_object(C);
 	em= BKE_mesh_get_editmesh((Mesh*)obedit->data);
 	ima= CTX_data_edit_image(C);
+	sima= CTX_wm_space_image(C);
 	
 	if(RNA_boolean_get(op->ptr, "use_limit")) {
 		UvVertMap *vmap;
@@ -1265,6 +1281,7 @@
 		MEM_freeN(uv_average);
 	}
 
+	uvedit_live_unwrap_update(sima, scene, obedit);
 	DAG_id_tag_update(obedit->data, 0);
 	WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 
@@ -2653,7 +2670,8 @@
 
 	if(!change)
 		return OPERATOR_CANCELLED;
-	
+
+	uvedit_live_unwrap_update(sima, scene, obedit);
 	DAG_id_tag_update(obedit->data, 0);
 	WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
 




More information about the Bf-blender-cvs mailing list