Commit: 787660e15a628dab27ea5e509d3b1b72edd9ce52
Author: Campbell Barton
Date:   Tue Dec 18 20:33:16 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB787660e15a628dab27ea5e509d3b1b72edd9ce52

Gizmo: exclude overlays from origin-set depth

Setting the light orientation would read depth from the light wireframe.

===================================================================

M       source/blender/editors/object/object_transform.c

===================================================================

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;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to