diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-29 06:57:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-30 04:27:36 +0300 |
commit | fba8c3db998fb8deb2e85037581b748ee895952c (patch) | |
tree | 479a8759bef2966ff39862ec2d487d958481cf26 /io_export_pc2.py | |
parent | 5a2c3d67f7f61caea570f139219ddb760da51325 (diff) |
Fix export pc2 poll function
Assumed active object
Diffstat (limited to 'io_export_pc2.py')
-rw-r--r-- | io_export_pc2.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/io_export_pc2.py b/io_export_pc2.py index e00ee46b..fdc72324 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() |