Skip to content

Commit

Permalink
Fix T89810: Vertex snapping at world origin when using 'Snap_Utilitie…
Browse files Browse the repository at this point in the history
…s_Line'

The operator depended on the gizmo to get the initial location.
  • Loading branch information
Germano Cavalcante committed Jul 14, 2021
1 parent 855d518 commit 8ee9bd5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mesh_snap_utilities_line/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 6 additions & 3 deletions mesh_snap_utilities_line/op_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,12 @@ def invoke(self, context, event):
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')

Expand Down

0 comments on commit 8ee9bd5

Please sign in to comment.