From fba8c3db998fb8deb2e85037581b748ee895952c Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Wed, 29 Mar 2017 14:57:24 +1100 Subject: [PATCH] Fix export pc2 poll function Assumed active object --- io_export_pc2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/io_export_pc2.py b/io_export_pc2.py index e00ee46b4..fdc723241 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() -- GitLab