[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1638] trunk/py/scripts/addons/ light_field_tools/light_field_tools.py: light field tools: report errors

Aurel W aurel.w at gmail.com
Mon Feb 21 22:51:11 CET 2011


Revision: 1638
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1638
Author:   aurel
Date:     2011-02-21 21:51:11 +0000 (Mon, 21 Feb 2011)
Log Message:
-----------
light field tools: report errors

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

Modified: trunk/py/scripts/addons/light_field_tools/light_field_tools.py
===================================================================
--- trunk/py/scripts/addons/light_field_tools/light_field_tools.py	2011-02-21 21:08:47 UTC (rev 1637)
+++ trunk/py/scripts/addons/light_field_tools/light_field_tools.py	2011-02-21 21:51:11 UTC (rev 1638)
@@ -273,6 +273,7 @@
 
         obj = self.baseObject = context.active_object
         if not obj or obj.type != 'MESH':
+            self.report({'ERROR'}, "No selected mesh object!")
             return 'CANCELLED'
 
         self.verts = self.arrangeVerts()
@@ -345,10 +346,12 @@
         obj = context.active_object
         # check if active object is a mesh object
         if not obj or obj.type != 'MESH':
+            self.report({'ERROR'}, "No selected mesh object!")
             return 'CANCELLED'
 
-        # check if it has at least one face
-        if len(obj.data.faces) < 1:
+        # check if it has one single face
+        if len(obj.data.faces) != 1:
+            self.report({'ERROR'}, "The selected mesh object has to have exactly one quad!")
             return 'CANCELLED'
 
         rl = scene.lightfield.row_length



More information about the Bf-extensions-cvs mailing list