From dc0b73f46f6c2d5de0dbb9208f8b47b388f1e528 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sat, 15 Nov 2025 08:06:06 -0600 Subject: [PATCH] Ensure annotation is in front of a RCP camera. --- src/bonsai/bonsai/tool/drawing.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bonsai/bonsai/tool/drawing.py b/src/bonsai/bonsai/tool/drawing.py index 73c1c2c442..bb0b9a374c 100644 --- a/src/bonsai/bonsai/tool/drawing.py +++ b/src/bonsai/bonsai/tool/drawing.py @@ -2009,8 +2009,16 @@ class Drawing(bonsai.core.tool.Drawing): if matrix_world is None: # Use normalized camera matrix (without scale) for RCP compatibility matrix_world = cls.get_camera_matrix(camera) - annotation_offset = Vector((0, 0, -camera.data.clip_start - 0.05)) - annotation_offset = camera.matrix_world.to_quaternion() @ annotation_offset + + # Check if this is an RCP (reflected ceiling plan) by checking for negative scale + camera_scale = camera.matrix_world.to_scale() + is_rcp = camera_scale.x < 0 or camera_scale.y < 0 or camera_scale.z < 0 + + # For RCP, the offset needs to be positive instead of negative + # because the Z axis is flipped 180° in get_camera_matrix + offset_direction = 1 if is_rcp else -1 + annotation_offset = Vector((0, 0, offset_direction * (camera.data.clip_start + 0.05))) + annotation_offset = matrix_world.to_quaternion() @ annotation_offset matrix_world.translation += annotation_offset return matrix_world