diff options
author | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-08-10 01:52:47 +0300 |
---|---|---|
committer | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-08-10 01:53:27 +0300 |
commit | 0d50214d72b65d7dd89a1e982b019e053d969847 (patch) | |
tree | 89c973f4c12986ba2287b7019ad3a4f80b5c5b03 /mesh_bsurfaces.py | |
parent | f102dcfd25000ee3c1de28f0be95296321043ea3 (diff) |
Addon: BSurfaces: Fixed error strokes clear
Diffstat (limited to 'mesh_bsurfaces.py')
-rw-r--r-- | mesh_bsurfaces.py | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py index 4e7e4576..16d7244a 100644 --- a/mesh_bsurfaces.py +++ b/mesh_bsurfaces.py @@ -3147,11 +3147,17 @@ class GPENCIL_OT_SURFSK_add_surface(Operator): # Delete grease pencil strokes if self.strokes_type == "GP_STROKES" and not self.stopping_errors and not self.keep_strokes: - bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + try: + bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + except: + pass # Delete annotations if self.strokes_type == "GP_ANNOTATION" and not self.stopping_errors and not self.keep_strokes: - bpy.data.grease_pencils[0].layers.active.clear() + try: + bpy.data.grease_pencils[0].layers.active.clear() + except: + pass bsurfaces_props.SURFSK_edges_U = self.edges_U bsurfaces_props.SURFSK_edges_V = self.edges_V @@ -3398,11 +3404,17 @@ class GPENCIL_OT_SURFSK_add_surface(Operator): # Delete grease pencil strokes if self.strokes_type == "GP_STROKES" and not self.stopping_errors and not self.keep_strokes: - bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + try: + bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + except: + pass # Delete grease pencil strokes if self.strokes_type == "GP_ANNOTATION" and not self.stopping_errors and not self.keep_strokes: - bpy.data.grease_pencils[0].layers.active.clear() + try: + bpy.data.grease_pencils[0].layers.active.clear() + except: + pass bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT') self.main_object.select_set(True) @@ -3614,7 +3626,10 @@ class GPENCIL_OT_SURFSK_edit_strokes(Operator): ob_gp_strokes = bpy.context.object # Delete grease pencil strokes - bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + try: + bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + except: + pass # Clean up curves bpy.ops.object.select_all('INVOKE_REGION_WIN', action='DESELECT') @@ -3870,7 +3885,11 @@ class CURVE_OT_SURFSK_reorder_splines(Operator): bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN') bpy.ops.curve.select_all('INVOKE_REGION_WIN', action='DESELECT') - bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + try: + bpy.context.scene.bsurfaces.SURFSK_object_with_strokes.data.layers.active.clear() + except: + pass + return {"FINISHED"} |