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:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-03-19 21:10:51 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-03-22 18:46:29 +0300
commit9baf39c8daded5b000d4eacc6c677dbfd3359478 (patch)
treed77bd422c88d234d48f79b0ab66a9b75f6a52e50 /source/blender/editors/space_view3d/view3d_select.c
parentfb1265c5cf24462985cd3debae9205ac78f5d6ab (diff)
Fix T86666: Lasso and Circle select tools selecting objects behind clip_min
Although it works well in most cases, the algorithm to detect if a point is within the limits of the camera does not work well in othographic mode. This commit also adds the option `V3D_PROJ_TEST_CLIP_FAR` (currently unused). Differential Revision: https://developer.blender.org/D10771
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 7dc4a72e510..3166b818d3c 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -2054,11 +2054,9 @@ static bool ed_object_select_pick(bContext *C,
while (base) {
if (BASE_SELECTABLE(v3d, base)) {
float screen_co[2];
- if (ED_view3d_project_float_global(region,
- base->object->obmat[3],
- screen_co,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN |
- V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK) {
+ if (ED_view3d_project_float_global(
+ region, base->object->obmat[3], screen_co, V3D_PROJ_TEST_CLIP_DEFAULT) ==
+ V3D_PROJ_RET_OK) {
float dist_temp = len_manhattan_v2v2(mval_fl, screen_co);
if (base == oldbasact) {
dist_temp += 10.0f;
@@ -4054,11 +4052,9 @@ static bool object_circle_select(ViewContext *vc,
for (base = FIRSTBASE(view_layer); base; base = base->next) {
if (BASE_SELECTABLE(v3d, base) && ((base->flag & BASE_SELECTED) != select_flag)) {
float screen_co[2];
- if (ED_view3d_project_float_global(vc->region,
- base->object->obmat[3],
- screen_co,
- V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN |
- V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK) {
+ if (ED_view3d_project_float_global(
+ vc->region, base->object->obmat[3], screen_co, V3D_PROJ_TEST_CLIP_DEFAULT) ==
+ V3D_PROJ_RET_OK) {
if (len_squared_v2v2(mval_fl, screen_co) <= radius_squared) {
ED_object_base_select(base, select ? BA_SELECT : BA_DESELECT);
changed = true;