Fix T89810: Vertex snapping at world origin when using 'Snap_Utilities_Line'

The operator depended on the gizmo to get the initial location.
This commit is contained in:
Germano Cavalcante 2021-07-14 13:59:07 -03:00
parent 855d51830b
commit 8ee9bd5d63
Notes: blender-bot 2023-02-14 18:34:42 +01:00
Referenced by issue #89810, Vertex snapping at world origin when using 'Snap_Utilities_Line' add-on
2 changed files with 7 additions and 4 deletions

View File

@ -21,7 +21,7 @@
bl_info = {
"name": "Snap_Utilities_Line",
"author": "Germano Cavalcante",
"version": (6, 9, 20),
"version": (6, 9, 22),
"blender": (2, 93, 0),
"location": "View3D > TOOLS > Line Tool",
"description": "Extends Blender Snap controls",

View File

@ -414,9 +414,12 @@ class SnapUtilitiesLine(SnapUtilities, bpy.types.Operator):
context.window_manager.modal_handler_add(self)
if not self.wait_for_input:
mat_inv = self.obj.matrix_world.inverted_safe()
point = mat_inv @ self.location
self.list_verts_co = make_line(self, self.geom, point)
if not self.snapwidgets:
self.modal(context, event)
else:
mat_inv = self.obj.matrix_world.inverted_safe()
point = mat_inv @ self.location
self.list_verts_co = make_line(self, self.geom, point)
self._handle = bpy.types.SpaceView3D.draw_handler_add(self.draw_callback_px, (), 'WINDOW', 'POST_VIEW')