mesh_snap_utilities_line: Fix ghost objects

This commit is contained in:
Germano Cavalcante 2019-02-11 15:24:33 -02:00
parent f0e2d0e6a2
commit 00e74bb22d
3 changed files with 6 additions and 5 deletions

View File

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

View File

@ -262,7 +262,7 @@ class SnapUtilities:
moving_objects.difference_update(children)
self.sctx.clear_snap_objects()
self.sctx.clear_snap_objects(True)
for obj in context.visible_objects:
is_moving = obj in moving_objects or obj in children
@ -295,7 +295,8 @@ class SnapUtilities:
for obj in context.objects_in_mode_unique_data:
yield (obj, obj.matrix_world)
self.sctx.clear_snap_objects()
self.sctx.clear_snap_objects(True)
for obj, matrix in visible_objects_and_duplis():
self.sctx.add_obj(obj, matrix)

View File

@ -371,13 +371,13 @@ class SnapContext():
self.winsize = winsize
self._offscreen.resize(*self.winsize)
def clear_snap_objects(self):
def clear_snap_objects(self, clear_offscreen = False):
for snap_obj in self.snap_objects:
if len(snap_obj.data) == 2:
snap_obj.data[1].free()
del snap_obj.data[1:]
self.update_drawing(False)
self.update_drawing(clear_offscreen)
self.snap_objects.clear()
_Internal.gpu_Indices_mesh_cache_clear()