@@ -148,7 +148,16 @@ def invoke(self, context, event):
148
148
return self .execute (context )
149
149
150
150
def execute (self , context ):
151
- bpy .ops .object .lily_surface_import ('EXEC_DEFAULT' , url = bpy .context .window_manager .clipboard )
151
+ try :
152
+ bpy .ops .object .lily_surface_import ('EXEC_DEFAULT' , url = bpy .context .window_manager .clipboard )
153
+ except RuntimeError as err :
154
+ msg = err .args [0 ]
155
+ if msg .startswith ("Invalid Input Error: " ):
156
+ error = msg [len ("Invalid Input Error: " ):]
157
+ self .report ({'ERROR_INVALID_INPUT' }, error )
158
+ return {'CANCELLED' }
159
+ else :
160
+ raise err
152
161
return {'FINISHED' }
153
162
154
163
def list_variant_enum (self , context ):
@@ -306,7 +315,16 @@ def invoke(self, context, event):
306
315
return self .execute (context )
307
316
308
317
def execute (self , context ):
309
- bpy .ops .object .lily_world_import ('EXEC_DEFAULT' , url = bpy .context .window_manager .clipboard )
318
+ try :
319
+ bpy .ops .object .lily_world_import ('EXEC_DEFAULT' , url = bpy .context .window_manager .clipboard )
320
+ except RuntimeError as err :
321
+ msg = err .args [0 ]
322
+ if msg .startswith ("Invalid Input Error: " ):
323
+ error = msg [len ("Invalid Input Error: " ):]
324
+ self .report ({'ERROR_INVALID_INPUT' }, error )
325
+ return {'CANCELLED' }
326
+ else :
327
+ raise err
310
328
return {'FINISHED' }
311
329
312
330
def list_variant_enum (self , context ):
@@ -425,7 +443,16 @@ def invoke(self, context, event):
425
443
return self .execute (context )
426
444
427
445
def execute (self , context ):
428
- bpy .ops .object .lily_light_import ('EXEC_DEFAULT' , url = bpy .context .window_manager .clipboard )
446
+ try :
447
+ bpy .ops .object .lily_light_import ('EXEC_DEFAULT' , url = bpy .context .window_manager .clipboard )
448
+ except RuntimeError as err :
449
+ msg = err .args [0 ]
450
+ if msg .startswith ("Invalid Input Error: " ):
451
+ error = msg [len ("Invalid Input Error: " ):]
452
+ self .report ({'ERROR_INVALID_INPUT' }, error )
453
+ return {'CANCELLED' }
454
+ else :
455
+ raise err
429
456
return {'FINISHED' }
430
457
431
458
# -------------------------------------------------------------------
0 commit comments