From 96b8b425006bc9ade6895d50f556bc3d4bcd5709 Mon Sep 17 00:00:00 2001
From: Fabian Fricke <frigi.f@googlemail.com>
Date: Wed, 21 Apr 2010 12:21:50 +0000
Subject: [PATCH] script was not working if nothing was selected

---
 mesh_relax.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mesh_relax.py b/mesh_relax.py
index 211ecfca3..c19ea3cd0 100644
--- a/mesh_relax.py
+++ b/mesh_relax.py
@@ -57,8 +57,9 @@ def relax_mesh(self, context):
     me_name = me_old.name
 
     # deselect everything that's not related
-    for o in bpy.context.selected_objects:
-        o.selected = False
+    if bpy.context.selected_objects:
+        for o in bpy.context.selected_objects:
+            o.selected = False
 
     # duplicate the object so it can be used for the shrinkwrap modifier
     obj.selected = True # make sure the object is selected!
-- 
GitLab