From 1e1ab453bf031672a12e04dc83cc7e48b27fdb6e Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 29 Jul 2023 23:46:45 +1000 Subject: [PATCH] Fix #3501. Annotation tool now creates annotations at the 3D cursor. --- .../blenderbim/bim/module/drawing/annotation.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/drawing/annotation.py b/src/blenderbim/blenderbim/bim/module/drawing/annotation.py index 1556461d38..c49dbd8c9d 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/annotation.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/annotation.py @@ -152,6 +152,7 @@ class Annotator: def get_placeholder_coords(camera=None): if not camera: camera = bpy.context.scene.camera + z_offset = camera.matrix_world.to_quaternion() @ Vector((0, 0, -1)) y = camera.data.ortho_scale / 4 @@ -162,9 +163,13 @@ class Annotator: y_offset = camera.matrix_world.to_quaternion() @ Vector((0, y, 0)) x_offset = camera.matrix_world.to_quaternion() @ Vector((y / 2, 0, 0)) + + center = camera.matrix_world.inverted() @ bpy.context.scene.cursor.location + center.z = 0 + return ( - camera.location + z_offset, - camera.location + z_offset + y_offset, - camera.location + z_offset + x_offset, - camera.location + z_offset + x_offset + y_offset, + center + z_offset, + center + z_offset + y_offset, + center + z_offset + x_offset, + center + z_offset + x_offset + y_offset, )