diff --git a/io_import_photoscan_cameras.py b/io_import_photoscan_cameras.py old mode 100644 new mode 100755 index 3974d87..cd72e4a --- a/io_import_photoscan_cameras.py +++ b/io_import_photoscan_cameras.py @@ -875,7 +875,8 @@ def execute(self, context): ps = bpy.context.scene.import_photoscan_cameras if(ps.align_to_active): ao = context.view_layer.objects.active - m = ao.matrix_world.copy() + if(ao is not None): + m = ao.matrix_world.copy() ed = {'TIFF': ".tiff", 'TIFF2': ".tif", 'JPEG': ".jpg", 'JPEG2': ".jpeg", 'PNG': ".png", 'BMP': ".bmp", 'OPENEXR': ".exr", 'TARGA': ".tga", } e = ed[ps.image_extension] d = {'xml_path': os.path.realpath(bpy.path.abspath(ps.xml_path)),