[Bf-extensions-cvs] [fba8c3d] master: Fix export pc2 poll function

Campbell Barton noreply at git.blender.org
Thu Mar 30 03:28:09 CEST 2017


Commit: fba8c3db998fb8deb2e85037581b748ee895952c
Author: Campbell Barton
Date:   Wed Mar 29 14:57:24 2017 +1100
Branches: master
https://developer.blender.org/rBAfba8c3db998fb8deb2e85037581b748ee895952c

Fix export pc2 poll function

Assumed active object

===================================================================

M	io_export_pc2.py

===================================================================

diff --git a/io_export_pc2.py b/io_export_pc2.py
index e00ee46..fdc7232 100644
--- a/io_export_pc2.py
+++ b/io_export_pc2.py
@@ -153,7 +153,11 @@ class Export_pc2(bpy.types.Operator, ExportHelper):
 
     @classmethod
     def poll(cls, context):
-        return context.active_object.type in {'MESH', 'CURVE', 'SURFACE', 'FONT'}
+        obj = context.active_object
+        return (
+            obj is not None and
+            obj.type in {'MESH', 'CURVE', 'SURFACE', 'FONT'}
+        )
 
     def execute(self, context):
         start_time = time.time()



More information about the Bf-extensions-cvs mailing list