From 3d71a0995decd1c74b088e4007a1c2fe310b0301 Mon Sep 17 00:00:00 2001
From: Bastien Montagne <montagne29@wanadoo.fr>
Date: Sun, 10 Nov 2013 13:28:24 +0000
Subject: [PATCH] Import FBX: correct behavior for empty FBX files (no
 'Objects' nor 'Connections'  top-level elements).

---
 io_scene_fbx/import_fbx.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index f38b04999..2b5bf3be3 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -925,9 +925,11 @@ def load(operator, context, filepath="",
     fbx_connections = elem_find_first(elem_root, b'Connections')
 
     if fbx_nodes is None:
-        return print("no 'Objects' found")
+        operator.report({'ERROR'}, "No 'Objects' found in file %r" % filepath)
+        return {'CANCELLED'}
     if fbx_connections is None:
-        return print("no 'Connections' found")
+        operator.report({'ERROR'}, "No 'Connections' found in file %r" % filepath)
+        return {'CANCELLED'}
 
     # ----
     # First load property templates
-- 
GitLab