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-12-10 11:20:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-10 11:20:52 +0400
commitb0a361584a75f91dfbaa99220913349d4b05cccc (patch)
tree089e68f3c84f9273656f4e31e4ac459712b2deb7
parentbc94b8300e86fe1af9b2d8c90329a12f4443725d (diff)
knife tool was incorrectly moving points into worldspace, then checking clipping against the object space bounds.
more fixes needed here but at least correct whats there. also ensure clipping is initialized from the object before handling modal operator events.
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 014eec744ac..6cc6c511070 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1523,12 +1523,7 @@ static int knife_sample_screen_density(KnifeTool_OpData *kcd, float radius)
dis = len_v2v2(kfv->sco, sco);
if (dis < radius) {
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
- float vec[3];
-
- copy_v3_v3(vec, kfv->cageco);
- mul_m4_v3(kcd->vc.obedit->obmat, vec);
-
- if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
+ if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
c++;
}
}
@@ -1599,7 +1594,6 @@ static KnifeEdge *knife_find_closest_edge(KnifeTool_OpData *kcd, float p[3], flo
float vec[3];
interp_v3_v3v3(vec, kfe->v1->cageco, kfe->v2->cageco, labda);
- mul_m4_v3(kcd->vc.obedit->obmat, vec);
if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
cure = kfe;
@@ -1691,12 +1685,7 @@ static KnifeVert *knife_find_closest_vert(KnifeTool_OpData *kcd, float p[3], flo
dis = len_v2v2(kfv->sco, sco);
if (dis < curdis && dis < maxdist) {
if (kcd->vc.rv3d->rflag & RV3D_CLIPPING) {
- float vec[3];
-
- copy_v3_v3(vec, kfv->cageco);
- mul_m4_v3(kcd->vc.obedit->obmat, vec);
-
- if (ED_view3d_clipping_test(kcd->vc.rv3d, vec, TRUE) == 0) {
+ if (ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, TRUE) == 0) {
curv = kfv;
curdis = dis;
}
@@ -3121,6 +3110,7 @@ static int knifetool_modal(bContext *C, wmOperator *op, wmEvent *event)
}
view3d_operator_needs_opengl(C);
+ ED_view3d_init_mats_rv3d(obedit, kcd->vc.rv3d); /* needed to initialize clipping */
if (kcd->mode == MODE_PANNING)
kcd->mode = kcd->prevmode;