[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38800] branches/soc-2011-onion/source/ blender/editors/uvedit/uvedit_ops.c: some code reorganization
Antony Riakiotakis
kalast at gmail.com
Thu Jul 28 23:28:08 CEST 2011
Revision: 38800
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38800
Author: psy-fi
Date: 2011-07-28 21:28:07 +0000 (Thu, 28 Jul 2011)
Log Message:
-----------
some code reorganization
Modified Paths:
--------------
branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c
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-28 20:52:36 UTC (rev 38799)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c 2011-07-28 21:28:07 UTC (rev 38800)
@@ -4353,8 +4353,7 @@
}
-static int mark_seam_uv_exec(bContext *C, wmOperator *op)
-{
+static int mark_seam_uv_intern(bContext *C, wmOperator *op, wmEvent *event){
Object *ob = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
SpaceImage *sima = CTX_wm_space_image(C);
@@ -4384,14 +4383,28 @@
NearestHit hit;
Image *ima= CTX_data_edit_image(C);
- RNA_float_get_array(op->ptr, "location", co);
+ if(event){
+ ARegion *ar= CTX_wm_region(C);
+ UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
+ RNA_float_set_array(op->ptr, "location", co);
+ }else{
+ RNA_float_get_array(op->ptr, "location", co);
+ }
find_nearest_uv_edge(scene, ima, em, co, &hit);
if(hit.efa){
(*(&hit.efa->e1 + hit.edge))->seam = 1;
}
}
-
+ /*
+ * May be needed for synch selection
+ if( (vc.scene->toolsettings->edge_mode_live_unwrap) &&
+ (vc.scene->toolsettings->edge_mode == EDGE_MODE_TAG_SEAM) &&
+ (CustomData_has_layer(&em->fdata, CD_MTFACE))
+ ) {
+ ED_unwrap_lscm(vc.scene, vc.obedit, FALSE);
+ }
+ */
BKE_mesh_end_editmesh((Mesh*)ob->data, em);
uvedit_live_unwrap_update(sima, scene, ob);
@@ -4401,15 +4414,14 @@
return OPERATOR_FINISHED;
}
+static int mark_seam_uv_exec(bContext *C, wmOperator *op)
+{
+ return mark_seam_uv_intern(C, op, NULL);
+}
+
static int mark_seam_uv_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
- float co[2];
-
- UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
- RNA_float_set_array(op->ptr, "location", co);
-
- return mark_seam_uv_exec(C, op);
+ return mark_seam_uv_intern(C, op, event);
}
More information about the Bf-blender-cvs
mailing list