[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [617] trunk/py/scripts/addons/ mesh_relax.py: script was not working if nothing was selected

Fabian Fricke frigi.f at googlemail.com
Wed Apr 21 14:21:50 CEST 2010


Revision: 617
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=617
Author:   frigi
Date:     2010-04-21 14:21:50 +0200 (Wed, 21 Apr 2010)

Log Message:
-----------
script was not working if nothing was selected

Modified Paths:
--------------
    trunk/py/scripts/addons/mesh_relax.py

Modified: trunk/py/scripts/addons/mesh_relax.py
===================================================================
--- trunk/py/scripts/addons/mesh_relax.py	2010-04-21 11:55:56 UTC (rev 616)
+++ trunk/py/scripts/addons/mesh_relax.py	2010-04-21 12:21:50 UTC (rev 617)
@@ -57,8 +57,9 @@
     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!




More information about the Bf-extensions-cvs mailing list