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:
authorCampbell Barton <ideasman42@gmail.com>2012-09-07 04:58:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-07 04:58:00 +0400
commit704c5f09b5b9eb79b591bb7996944c22085f0b15 (patch)
tree32342d6c9eb7faa65cc0405f7c485dc278bbdf7b /source/blender/editors/mesh
parent04418fe8ddb41fe489da1cda93510cff66fe0cf8 (diff)
remove makeDerivedMesh from ED_mesh_pick_face(), this was added 44256 (bmesh merge), but is pretty bad (rebuilding entire derived mesh to pick a face), tested with subsurf modifier, sintel mesh - it works ok without it.
Also - other select modes like border-select dont do this, so looks safe to disable.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editface.c4
-rw-r--r--source/blender/editors/mesh/meshtools.c29
2 files changed, 14 insertions, 19 deletions
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 36fbfeedcb6..4e30cff5fde 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -294,7 +294,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
if (mode == 0 || mode == 1) {
/* XXX - Causes glitches, not sure why */
#if 0
- if (!ED_mesh_pick_face(C, me, mval, &index, 1))
+ if (!ED_mesh_pick_face(C, me, mval, &index, ED_MESH_PICK_DEFAULT_FACE_SIZE))
return;
#endif
}
@@ -481,7 +481,7 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
/* Get the face under the cursor */
me = BKE_mesh_from_object(ob);
- if (!ED_mesh_pick_face(C, me, ob, mval, &index, 1))
+ if (!ED_mesh_pick_face(C, me, mval, &index, ED_MESH_PICK_DEFAULT_FACE_SIZE))
return 0;
if (index >= me->totpoly)
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index e11d79a6e99..3d6face167b 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -42,6 +42,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
+#include "DNA_view3d_types.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
@@ -1156,28 +1157,21 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em)
*
* \return boolean TRUE == Found
*/
-int ED_mesh_pick_face(bContext *C, Mesh *me, Object *ob, const int mval[2], unsigned int *index, short rect)
+int ED_mesh_pick_face(bContext *C, Mesh *me, const int mval[2], unsigned int *index, int size)
{
- Scene *scene = CTX_data_scene(C);
ViewContext vc;
- view3d_set_viewcontext(C, &vc);
if (!me || me->totpoly == 0)
return 0;
- makeDerivedMesh(scene, ob, NULL, CD_MASK_BAREMESH, 0);
-
- // XXX if (v3d->flag & V3D_INVALID_BACKBUF) {
-// XXX drawview.c! check_backbuf();
-// XXX persp(PERSP_VIEW);
-// XXX }
+ view3d_set_viewcontext(C, &vc);
- if (rect) {
- /* sample rect to increase changes of selecting, so that when clicking
+ if (size) {
+ /* sample rect to increase chances of selecting, so that when clicking
* on an edge in the backbuf, we can still select a face */
- int dist;
- *index = view3d_sample_backbuf_rect(&vc, mval, 3, 1, me->totpoly + 1, &dist, 0, NULL, NULL);
+ int dummy_dist;
+ *index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totpoly + 1, &dummy_dist, 0, NULL, NULL);
}
else {
/* sample only on the exact position */
@@ -1201,17 +1195,18 @@ int ED_mesh_pick_face(bContext *C, Mesh *me, Object *ob, const int mval[2], unsi
int ED_mesh_pick_vert(bContext *C, Mesh *me, const int mval[2], unsigned int *index, int size)
{
ViewContext vc;
- view3d_set_viewcontext(C, &vc);
if (!me || me->totvert == 0)
return 0;
+ view3d_set_viewcontext(C, &vc);
+
if (size > 0) {
- /* sample rect to increase changes of selecting, so that when clicking
+ /* sample rect to increase chances of selecting, so that when clicking
* on an face in the backbuf, we can still select a vert */
- int dist;
- *index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totvert + 1, &dist, 0, NULL, NULL);
+ int dummy_dist;
+ *index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totvert + 1, &dummy_dist, 0, NULL, NULL);
}
else {
/* sample only on the exact position */