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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-09 07:56:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-09 07:56:32 +0400
commit912db4cdb571d6421cb8c018a0db4fa93984549c (patch)
treeb75063ff1f4bb6e1a84c4f830973fcf66cb85f0a /source
parente7e1bc4ca1bb1194f26d965270b76734d2cc91bd (diff)
[#27615] Box select of mesh object disabled or translated due to curve object
ED_view3d_init_mats_rv3d was calling glMultMatrixf() which was mostly harmless but could also lead to confusing bugs (2 reported previously). Looked into this and every call to ED_view3d_init_mats_rv3d except for object drawing, doesn't need this so made a second version of ED_view3d_init_mats_rv3d - ED_view3d_init_mats_rv3d_gl which does the matrix multiplication, remove confusing checks in selection code.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/include/ED_view3d.h1
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c11
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c29
4 files changed, 19 insertions, 24 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 0adf6633b05..dfe0a304748 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -265,6 +265,7 @@ struct ARegion *ED_view3d_context_region_unlock(struct bContext *C);
int ED_operator_rv3d_unlock_poll(struct bContext *C);
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d);
+void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d);
int ED_view3d_scene_layer_set(int lay, const int *values, int *active);
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 391eecbbbae..35edd961b1e 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5812,7 +5812,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
/* multiply view with object matrix.
* local viewmat and persmat, to calculate projections */
- ED_view3d_init_mats_rv3d(ob, rv3d);
+ ED_view3d_init_mats_rv3d_gl(ob, rv3d);
/* which wire color */
if((flag & DRAW_CONSTCOLOR) == 0) {
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index fb67e38cbf7..6833dec2e43 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -208,13 +208,18 @@ void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
mul_m4_m4m4(rv3d->viewmatob, ob->obmat, rv3d->viewmat);
mul_m4_m4m4(rv3d->persmatob, ob->obmat, rv3d->persmat);
+ /* initializes object space clipping, speeds up clip tests */
+ ED_view3d_local_clipping(rv3d, ob->obmat);
+}
+
+void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d)
+{
+ ED_view3d_init_mats_rv3d(ob, rv3d);
+
/* we have to multiply instead of loading viewmatob to make
it work with duplis using displists, otherwise it will
override the dupli-matrix */
glMultMatrixf(ob->obmat);
-
- /* initializes object space clipping, speeds up clip tests */
- ED_view3d_local_clipping(rv3d, ob->obmat);
}
/* ******************** default callbacks for view3d space ***************** */
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 6391db7ae5e..9290e1fc631 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -485,11 +485,8 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
if (extend == 0 && select)
EM_deselect_all(vc->em);
- /* workaround: init mats first, EM_mask_init_backbuf_border can change
- view matrix to pixel space, breaking edge select with backbuf. fixes bug [#20936] */
-
- /* [#21018] breaks zbuf select. run below. only if bbsel fails */
- /* ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d) */
+ /* for non zbuf projections, dont change the GL state */
+ ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
glLoadMatrixf(vc->rv3d->viewmat);
bbsel= EM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
@@ -497,15 +494,13 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
if(ts->selectmode & SCE_SELECT_VERTEX) {
if (bbsel) {
EM_backbuf_checkAndSelectVerts(vc->em, select);
- } else {
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
+ }
+ else {
mesh_foreachScreenVert(vc, do_lasso_select_mesh__doSelectVert, &data, 1);
}
}
if(ts->selectmode & SCE_SELECT_EDGE) {
- /* Does both bbsel and non-bbsel versions (need screen cos for both) */
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
-
+ /* Does both bbsel and non-bbsel versions (need screen cos for both) */
data.pass = 0;
mesh_foreachScreenEdge(vc, do_lasso_select_mesh__doSelectEdge, &data, 0);
@@ -518,8 +513,8 @@ static void do_lasso_select_mesh(ViewContext *vc, int mcords[][2], short moves,
if(ts->selectmode & SCE_SELECT_FACE) {
if (bbsel) {
EM_backbuf_checkAndSelectFaces(vc->em, select);
- } else {
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
+ }
+ else {
mesh_foreachScreenFace(vc, do_lasso_select_mesh__doSelectFace, &data);
}
}
@@ -1491,12 +1486,8 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
if (extend == 0 && select)
EM_deselect_all(vc->em);
- /* workaround: init mats first, EM_mask_init_backbuf_border can change
- view matrix to pixel space, breaking edge select with backbuf. fixes bug #20936 */
- /*ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);*/ /* for foreach's screen/vert projection */
-
- /* [#21018] breaks zbuf select. run below. only if bbsel fails */
- /* ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d) */
+ /* for non zbuf projections, dont change the GL state */
+ ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
glLoadMatrixf(vc->rv3d->viewmat);
bbsel= EM_init_backbuf_border(vc, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
@@ -1505,7 +1496,6 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
if (bbsel) {
EM_backbuf_checkAndSelectVerts(vc->em, select);
} else {
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
mesh_foreachScreenVert(vc, do_mesh_box_select__doSelectVert, &data, 1);
}
}
@@ -1525,7 +1515,6 @@ static int do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exten
if(bbsel) {
EM_backbuf_checkAndSelectFaces(vc->em, select);
} else {
- ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d);
mesh_foreachScreenFace(vc, do_mesh_box_select__doSelectFace, &data);
}
}