diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-18 12:33:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-18 12:33:16 +0300 |
commit | 787660e15a628dab27ea5e509d3b1b72edd9ce52 (patch) | |
tree | 46fe5b809e2f5f5ab80b8b6c7e9a89aa6e8aa96e /source/blender | |
parent | b4d625c88e498914712561694726f45d4173422f (diff) |
Gizmo: exclude overlays from origin-set depth
Setting the light orientation would read depth from the light wireframe.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/object/object_transform.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 7e800a128a1..76453171a54 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1288,6 +1288,7 @@ void OBJECT_OT_origin_set(wmOperatorType *ot) /* When using multiple objects, apply their relative rotational offset to the active object. */ #define USE_RELATIVE_ROTATION +#define USE_RENDER_OVERRIDE struct XFormAxisItem { Object *ob; @@ -1338,6 +1339,13 @@ static void object_transform_axis_target_free_data(wmOperator *op) { struct XFormAxisData *xfd = op->customdata; struct XFormAxisItem *item = xfd->object_data; + +#ifdef USE_RENDER_OVERRIDE + if (xfd->vc.rv3d->depths) { + xfd->vc.rv3d->depths->damaged = true; + } +#endif + for (int i = 0; i < xfd->object_data_len; i++, item++) { MEM_freeN(item->obtfm); } @@ -1417,6 +1425,12 @@ static int object_transform_axis_target_invoke(bContext *C, wmOperator *op, cons return OPERATOR_PASS_THROUGH; } + +#ifdef USE_RENDER_OVERRIDE + int flag2_prev = vc.v3d->flag2; + vc.v3d->flag2 |= V3D_RENDER_OVERRIDE; +#endif + ED_view3d_autodist_init(vc.depsgraph, vc.ar, vc.v3d, 0); if (vc.rv3d->depths != NULL) { @@ -1424,6 +1438,10 @@ static int object_transform_axis_target_invoke(bContext *C, wmOperator *op, cons } ED_view3d_depth_update(vc.ar); +#ifdef USE_RENDER_OVERRIDE + vc.v3d->flag2 = flag2_prev; +#endif + if (vc.rv3d->depths == NULL) { BKE_report(op->reports, RPT_WARNING, "Unable to access depth buffer, using view plane"); return OPERATOR_CANCELLED; |