[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4617] trunk/py/scripts/addons/ object_edit_linked.py: Fix for corner case where there are no objects in the scene.

Jason van Gumster jason at handturkeystudios.com
Mon Jul 1 23:00:29 CEST 2013


Revision: 4617
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4617
Author:   thefallenweeble
Date:     2013-07-01 21:00:28 +0000 (Mon, 01 Jul 2013)
Log Message:
-----------
Fix for corner case where there are no objects in the scene.

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

Modified: trunk/py/scripts/addons/object_edit_linked.py
===================================================================
--- trunk/py/scripts/addons/object_edit_linked.py	2013-06-28 21:54:13 UTC (rev 4616)
+++ trunk/py/scripts/addons/object_edit_linked.py	2013-07-01 21:00:28 UTC (rev 4617)
@@ -74,7 +74,7 @@
 
     @classmethod
     def poll(cls, context):
-        return settings["original_file"] == "" and (
+        return settings["original_file"] == "" and context.active_object is not None and (
                 (context.active_object.dupli_group and
                  context.active_object.dupli_group.library is not None) or
                  context.active_object.library is not None)
@@ -155,6 +155,10 @@
     bl_space_type = "VIEW_3D"
     bl_region_type = "TOOLS"
 
+    @classmethod
+    def poll(cls, context):
+        return (context.active_object is not None) or (settings["original_file"] != "")
+
     def draw(self, context):
         layout = self.layout
         scene = context.scene



More information about the Bf-extensions-cvs mailing list