diff --git a/global_bpy.py b/global_bpy.py index 01f10f6..af93e24 100644 --- a/global_bpy.py +++ b/global_bpy.py @@ -11,6 +11,10 @@ def reset_bpy(): # not using this cause this cause seg fault frequently # global_bpy.ops.wm.read_factory_settings(use_empty=True) + # check if there's no object, return + if len(bpy.data.objects) == 0: + return + # enter object mode if bpy.context.mode != 'OBJECT': bpy.ops.object.mode_set(mode='OBJECT')