Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2017-08-25 22:22:50 +10:00
commit 8e6c18a98f
2 changed files with 17 additions and 0 deletions

View File

@ -1291,9 +1291,15 @@ void ED_view3d_draw_select_loop(
const struct EvaluationContext *eval_ctx, ViewContext *vc, Scene *scene, SceneLayer *sl,
View3D *v3d, ARegion *ar, bool use_obedit_skip, bool use_nearest)
{
struct bThemeState theme_state;
short code = 1;
const short dflag = DRAW_PICKING | DRAW_CONSTCOLOR;
/* Tools may request depth outside of regular drawing code. */
UI_Theme_Store(&theme_state);
UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW);
if (vc->obedit && vc->obedit->type == OB_MBALL) {
draw_object(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
}
@ -1336,6 +1342,8 @@ void ED_view3d_draw_select_loop(
}
}
}
UI_Theme_Restore(&theme_state);
}
typedef struct View3DShadow {

View File

@ -54,6 +54,8 @@
#include "BIF_glutil.h"
#include "UI_resources.h"
#include "GPU_glew.h"
#include "GPU_select.h"
#include "GPU_matrix.h"
@ -1199,6 +1201,7 @@ int view3d_opengl_select(
const EvaluationContext *eval_ctx, ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const rcti *input,
eV3DSelectMode select_mode)
{
struct bThemeState theme_state;
Depsgraph *graph = vc->depsgraph;
Scene *scene = vc->scene;
View3D *v3d = vc->v3d;
@ -1244,6 +1247,10 @@ int view3d_opengl_select(
}
}
/* Tools may request depth outside of regular drawing code. */
UI_Theme_Store(&theme_state);
UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW);
/* Re-use cache (rect must be smaller then the cached)
* other context is assumed to be unchanged */
if (GPU_select_is_cached()) {
@ -1314,6 +1321,8 @@ int view3d_opengl_select(
finally:
if (hits < 0) printf("Too many objects in select buffer\n"); /* XXX make error message */
UI_Theme_Restore(&theme_state);
return hits;
}