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>2018-07-11 19:09:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-11 19:09:19 +0300
commitb90646dc0e3dcfae6fe52eab32542cebf5a60b0e (patch)
tree20053e67782eec6505b5003c3a5186c97d6d63bc /source
parent8bab591758289a5cf7bc4e5cd6b0322a5c8915e3 (diff)
Transform Manipulator: fix scale handle selection
The scale handles couldn't be accessed when rotation was enabled and they pointed away from the view.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/transform/transform_manipulator_3d.c2
-rw-r--r--source/blender/windowmanager/manipulators/WM_manipulator_types.h2
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c12
3 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_manipulator_3d.c b/source/blender/editors/transform/transform_manipulator_3d.c
index fa56e8d10be..7dc72ddff6f 100644
--- a/source/blender/editors/transform/transform_manipulator_3d.c
+++ b/source/blender/editors/transform/transform_manipulator_3d.c
@@ -1248,6 +1248,8 @@ static ManipulatorGroup *manipulatorgroup_init(wmManipulatorGroup *mgroup)
MANIPULATOR_NEW_PRIM(MAN_AXIS_TRANS_YZ, ED_MANIPULATOR_PRIMITIVE_STYLE_PLANE);
MANIPULATOR_NEW_PRIM(MAN_AXIS_TRANS_ZX, ED_MANIPULATOR_PRIMITIVE_STYLE_PLANE);
+ man->manipulators[MAN_AXIS_ROT_T]->flag |= WM_MANIPULATOR_SELECT_BACKGROUND;
+
return man;
}
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index e4482e797e3..ee2f833858a 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -84,6 +84,8 @@ typedef enum eWM_ManipulatorFlag {
* Hide the cursor and lock it's position while interacting with this manipulator.
*/
WM_MANIPULATOR_GRAB_CURSOR = (1 << 6),
+ /** Don't write into the depth buffer when selecting. */
+ WM_MANIPULATOR_SELECT_BACKGROUND = (1 << 7),
} eWM_ManipulatorFlag;
/**
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
index 76668702bd1..2a3aa5df197 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
@@ -460,6 +460,7 @@ static void manipulator_draw_select_3D_loop(const bContext *C, ListBase *visible
/* TODO(campbell): this depends on depth buffer being written to, currently broken for the 3D view. */
bool is_depth_prev = false;
+ bool is_depth_skip_prev = false;
for (LinkData *link = visible_manipulators->first; link; link = link->next) {
mpr = link->data;
@@ -477,6 +478,14 @@ static void manipulator_draw_select_3D_loop(const bContext *C, ListBase *visible
}
is_depth_prev = is_depth;
}
+ bool is_depth_skip = (mpr->flag & WM_MANIPULATOR_SELECT_BACKGROUND) != 0;
+ if (is_depth_skip == is_depth_skip_prev) {
+ /* pass */
+ }
+ else {
+ glDepthMask(!is_depth_skip);
+ is_depth_skip_prev = is_depth_skip;
+ }
/* pass the selection id shifted by 8 bits. Last 8 bits are used for selected manipulator part id */
@@ -489,6 +498,9 @@ static void manipulator_draw_select_3D_loop(const bContext *C, ListBase *visible
if (is_depth_prev) {
glDisable(GL_DEPTH_TEST);
}
+ if (is_depth_skip_prev) {
+ glDepthMask(true);
+ }
}
static int manipulator_find_intersected_3d_intern(