Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-15 13:20:42 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-04-15 13:20:42 +0400
commit637387b8ac81d74167aeae0a47b9ac1264c2ea05 (patch)
tree233a487da01d9fe407a8e4edeae9b66373933a99
parentac07f8983865d3bddd583210f40538f116403b92 (diff)
Fix #30949: live unwrap when marking seams did not work with bmesh.
-rw-r--r--source/blender/editors/include/ED_uvedit.h2
-rw-r--r--source/blender/editors/mesh/editmesh_select.c2
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c7
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c12
4 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h
index f122987b4e1..dfdbb1969cf 100644
--- a/source/blender/editors/include/ED_uvedit.h
+++ b/source/blender/editors/include/ED_uvedit.h
@@ -78,6 +78,8 @@ void ED_uvedit_live_unwrap_begin(struct Scene *scene, struct Object *obedit);
void ED_uvedit_live_unwrap_re_solve(void);
void ED_uvedit_live_unwrap_end(short cancel);
+void ED_uvedit_live_unwrap(struct Scene *scene, struct Object *obedit);
+
/* single call up unwrap using scene settings, used for edge tag unwrapping */
void ED_unwrap_lscm(struct Scene *scene, struct Object *obedit, const short sel);
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 355d64a9fe1..e40f068ee59 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -56,6 +56,7 @@
#include "ED_mesh.h"
#include "ED_screen.h"
+#include "ED_uvedit.h"
#include "ED_view3d.h"
#include "BIF_gl.h"
@@ -1399,6 +1400,7 @@ static void mouse_mesh_shortest_path(bContext *C, int mval[2])
case EDGE_MODE_TAG_SEAM:
me->drawflag |= ME_DRAWSEAMS;
+ ED_uvedit_live_unwrap(vc.scene, vc.obedit);
break;
case EDGE_MODE_TAG_SHARP:
me->drawflag |= ME_DRAWSHARP;
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 2c7d43f948e..73027c8fa7e 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -58,10 +58,11 @@
#include "WM_types.h"
#include "ED_mesh.h"
-#include "ED_view3d.h"
+#include "ED_object.h"
#include "ED_screen.h"
#include "ED_transform.h"
-#include "ED_object.h"
+#include "ED_uvedit.h"
+#include "ED_view3d.h"
#include "RE_render_ext.h"
@@ -1056,6 +1057,7 @@ void MESH_OT_edge_face_add(wmOperatorType *ot)
static int edbm_mark_seam(bContext *C, wmOperator *op)
{
+ Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
Mesh *me = ((Mesh *)obedit->data);
BMEditMesh *em = BMEdit_FromObject(obedit);
@@ -1085,6 +1087,7 @@ static int edbm_mark_seam(bContext *C, wmOperator *op)
}
}
+ ED_uvedit_live_unwrap(scene, obedit);
EDBM_update_generic(C, em, TRUE);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index a3cbcc57a9c..136134a95b0 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -268,7 +268,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
BLI_addfilledge(firstv, v);
- /*mode 2 enables faster handling of tri/quads*/
+ /* mode 2 enables faster handling of tri/quads */
BLI_edgefill(2);
for (sefa = fillfacebase.first; sefa; sefa = sefa->next) {
ls[0] = sefa->v1->tmp.p;
@@ -829,6 +829,16 @@ void ED_uvedit_live_unwrap_end(short cancel)
}
}
+void ED_uvedit_live_unwrap(Scene *scene, Object *obedit)
+{
+ BMEditMesh *em = BMEdit_FromObject(obedit);
+
+ if (scene->toolsettings->edge_mode_live_unwrap &&
+ CustomData_has_layer(&em->bm->ldata, CD_MLOOPUV)) {
+ ED_unwrap_lscm(scene, obedit, FALSE); /* unwrap all not just sel */
+ }
+}
+
/*************** UV Map Common Transforms *****************/
#define VIEW_ON_EQUATOR 0