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-11-25 16:17:31 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-11-25 16:18:57 +0300
commitbc4c20d414e90c8e25e12cfee860e86adb06e961 (patch)
treeadd30daf5016f85991ab8999e0c393c4eb463d83 /source/blender/editors/space_view3d/view3d_utils.c
parent447378753d320ea04d7c1ce00723fc02f35966f0 (diff)
Fix T93360: 'Iteractive Light Track' do not work over empty background
Bug introduced in {rBaa0ac0035a0d}. The invalid depth fallback was changed to `FLT_MAX` in order to match the annotation and gpencil operations. This broke the `Interactive Light Track` operator which invalidates the operation if the depth value is `1.0f`. The chosen solution was to change the value tested in the annotation and gpencil operations.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_utils.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index d6a1cd930fc..f01955a6468 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -1127,7 +1127,7 @@ bool ED_view3d_depth_read_cached_seg(
data.vd = vd;
data.margin = margin;
- data.depth = FLT_MAX;
+ data.depth = 1.0f;
copy_v2_v2_int(p1, mval_sta);
copy_v2_v2_int(p2, mval_end);
@@ -1136,7 +1136,7 @@ bool ED_view3d_depth_read_cached_seg(
*depth = data.depth;
- return (*depth != FLT_MAX);
+ return (*depth != 1.0f);
}
/** \} */
@@ -1647,6 +1647,9 @@ bool ED_view3d_depth_read_cached(const ViewDepths *vd,
int margin,
float *r_depth)
{
+ BLI_assert(1.0 <= vd->depth_range[1]);
+ *r_depth = 1.0f;
+
if (!vd || !vd->depths) {
return false;
}
@@ -1676,15 +1679,11 @@ bool ED_view3d_depth_read_cached(const ViewDepths *vd,
depth = vd->depths[y * vd->w + x];
}
- BLI_assert(1.0 <= vd->depth_range[1]);
if (depth != 1.0f) {
*r_depth = depth;
return true;
}
- /* Grease-pencil and annotations also need the returned depth value to be high
- * so the caller can detect it's invalid. */
- *r_depth = FLT_MAX;
return false;
}