mesh_snap_utilitie_line: Don't always pass the active object mesh as the main mesh.
This commit is contained in:
parent
a5aec7f5a5
commit
f0e2d0e6a2
|
@ -22,7 +22,7 @@
|
|||
bl_info = {
|
||||
"name": "Snap_Utilities_Line",
|
||||
"author": "Germano Cavalcante",
|
||||
"version": (5, 9, 3),
|
||||
"version": (5, 9, 4),
|
||||
"blender": (2, 80, 0),
|
||||
"location": "View3D > TOOLS > Line Tool",
|
||||
"description": "Extends Blender Snap controls",
|
||||
|
|
|
@ -311,7 +311,7 @@ class SnapUtilities:
|
|||
if SnapUtilities.snapwidgets:
|
||||
widget = SnapUtilities.snapwidgets[-1]
|
||||
|
||||
self.snap_obj = widget.snap_obj
|
||||
self.obj = widget.snap_obj.data[0] if widget.snap_obj else context.active_object
|
||||
self.bm = widget.bm
|
||||
self.geom = widget.geom
|
||||
self.type = widget.type
|
||||
|
@ -325,7 +325,7 @@ class SnapUtilities:
|
|||
|
||||
else:
|
||||
#init these variables to avoid errors
|
||||
self.snap_obj = None
|
||||
self.obj = context.active_object
|
||||
self.bm = None
|
||||
self.geom = None
|
||||
self.type = 'OUT'
|
||||
|
|
|
@ -233,11 +233,11 @@ class SnapUtilitiesLine(SnapUtilities, bpy.types.Operator):
|
|||
self.vector_constrain = ()
|
||||
self.len = 0
|
||||
|
||||
active_object = context.active_object
|
||||
mesh = active_object.data
|
||||
self.main_snap_obj = self.snap_obj = self.sctx._get_snap_obj_by_obj(self.obj)
|
||||
if self.bm == None:
|
||||
self.bm = bmesh.from_edit_mesh(self.obj.data)
|
||||
|
||||
self.main_snap_obj = self.snap_obj = self.sctx._get_snap_obj_by_obj(active_object)
|
||||
self.main_bm = self.bm = bmesh.from_edit_mesh(mesh)
|
||||
self.main_bm = self.bm
|
||||
|
||||
def modal(self, context, event):
|
||||
if self.navigation_ops.run(context, event, self.prevloc if self.vector_constrain else self.location):
|
||||
|
@ -435,7 +435,7 @@ class SnapUtilitiesLine(SnapUtilities, bpy.types.Operator):
|
|||
context.window_manager.modal_handler_add(self)
|
||||
|
||||
if not self.wait_for_input:
|
||||
mat_inv = context.object.matrix_world.inverted_safe()
|
||||
mat_inv = self.obj.matrix_world.inverted_safe()
|
||||
point = mat_inv @ self.location
|
||||
self.list_verts_co = make_line(self, self.geom, point)
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ class SnapWidgetCommon(SnapUtilities):
|
|||
else:
|
||||
self.bm = None
|
||||
self.geom = None
|
||||
self.sctx.update_all()
|
||||
|
||||
self.draw_cache.draw(self.type, self.location, None, None, None)
|
||||
|
||||
|
|
Loading…
Reference in New Issue