[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56290] trunk/blender/source/blender/ editors/space_view3d/view3d_ruler.c: ruler tweak: don't, snap to edit-object, because it didnt work well when modifiers are applied in editmode.
Campbell Barton
ideasman42 at gmail.com
Thu Apr 25 13:46:08 CEST 2013
Revision: 56290
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56290
Author: campbellbarton
Date: 2013-04-25 11:46:07 +0000 (Thu, 25 Apr 2013)
Log Message:
-----------
ruler tweak: don't, snap to edit-object, because it didnt work well when modifiers are applied in editmode.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_view3d/view3d_ruler.c
Modified: trunk/blender/source/blender/editors/space_view3d/view3d_ruler.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_ruler.c 2013-04-25 10:14:19 UTC (rev 56289)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_ruler.c 2013-04-25 11:46:07 UTC (rev 56290)
@@ -71,12 +71,14 @@
* \param r_no hit normal (optional).
* \param co_ss Screenspace coordinate.
* \param use_depth Snap to the closest element, use when using more then one snap type.
+ * \param use_obedit Use editmode cage.
* \param use_vert Snap to verts.
* \param use_edge Snap to edges.
* \param use_face Snap to faces.
* \return Snap success
*/
-static bool ED_view3d_snap_co(bContext *C, float r_co[3], float r_no[3], const float co_ss[2], bool use_depth,
+static bool ED_view3d_snap_co(bContext *C, float r_co[3], float r_no[3], const float co_ss[2],
+ bool use_depth, bool use_obedit,
bool use_vert, bool use_edge, bool use_face)
{
float dist_px = MVAL_MAX_PX_DIST; /* snap dist */
@@ -88,7 +90,7 @@
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
ARegion *ar = CTX_wm_region(C);
- struct Object *obedit = CTX_data_edit_object(C);
+ struct Object *obedit = use_obedit ? CTX_data_edit_object(C) : NULL;
BLI_assert(use_vert || use_edge || use_face);
@@ -733,7 +735,7 @@
co_other = ruler_item->co[ruler_item->co_index == 0 ? 2 : 0];
- if (ED_view3d_snap_co(C, co, ray_normal, mval_fl, true,
+ if (ED_view3d_snap_co(C, co, ray_normal, mval_fl, true, false,
false, false, true))
{
negate_v3(ray_normal);
@@ -747,7 +749,7 @@
const float mval_fl[2] = {UNPACK2(mval)};
View3D *v3d = CTX_wm_view3d(C);
bool use_depth = (v3d->drawtype >= OB_SOLID);
- bool is_hit = ED_view3d_snap_co(C, co, NULL, mval_fl, use_depth,
+ bool is_hit = ED_view3d_snap_co(C, co, NULL, mval_fl, use_depth, false,
true, true, use_depth);
if (is_hit) {
More information about the Bf-blender-cvs
mailing list