@@ -40,11 +40,15 @@ def retrieve_data(context, export_settings):
4040 context .error (f'Filename is longer than { STRING_LENGTH } characters, aborting export!' )
4141 return None
4242
43- bpy .ops .object .mode_set (mode = 'OBJECT' )
43+ try :
44+ bpy .ops .object .mode_set (mode = 'OBJECT' )
45+ except :
46+ pass
4447 hierarchy , rig , hlod = None , None , None
4548
4649 hierarchy , rig = retrieve_hierarchy (context , container_name )
47- hlod = create_hlod (hierarchy , container_name )
50+ if hierarchy :
51+ hlod = create_hlod (hierarchy , container_name )
4852
4953 data_context = DataContext (
5054 container_name = container_name ,
@@ -72,12 +76,14 @@ def retrieve_data(context, export_settings):
7276 context .error ('aborting export!' )
7377 return None
7478
75- if 'H' in export_mode and not hierarchy .validate (context ):
76- context .error ('aborting export!' )
77- return None
79+ if 'H' in export_mode :
80+ if hierarchy is not None :
81+ if not hierarchy .validate (context ):
82+ context .error ('aborting export!' )
83+ return None
7884
7985 if export_mode in ['HM' , 'HAM' ]:
80- if not data_context .hlod .validate (context ):
86+ if data_context . hlod and not data_context .hlod .validate (context ):
8187 context .error ('aborting export!' )
8288 return None
8389
@@ -89,7 +95,7 @@ def retrieve_data(context, export_settings):
8995 if 'A' in export_mode :
9096 timecoded = export_settings ['compression' ] == 'TC'
9197 data_context .animation = retrieve_animation (context , container_name , hierarchy , rig , timecoded )
92- if not data_context .animation .validate (context ):
98+ if data_context . animation and not data_context .animation .validate (context ):
9399 context .error ('aborting export!' )
94100 return None
95101 return data_context
0 commit comments