Fix T59208: Error when loading reference/background image in edit mode
authorJacques Lucke <mail@jlucke.com>
Wed, 12 Dec 2018 15:38:54 +0000 (16:38 +0100)
committerJacques Lucke <mail@jlucke.com>
Wed, 12 Dec 2018 15:39:00 +0000 (16:39 +0100)
release/scripts/startup/bl_operators/object.py

index e4d9b6e2f79c4ee63e6dfb6426b5fa31aa2de477..ec90054695464c03336264e5c3ccf2d9f657983b 100644 (file)
@@ -884,6 +884,10 @@ class LoadImageAsEmpty:
         default=True
     )
 
+    @classmethod
+    def poll(cls, context):
+        return context.mode == "OBJECT"
+
     def invoke(self, context, event):
         context.window_manager.fileselect_add(self)
         return {'RUNNING_MODAL'}