@@ -153,26 +153,32 @@ def update_obj(scene, depsgraph=None):
153153 show_message_box (traceback .format_exc (), "running script: " + obj .SIMLOADER .script_name + " failed: " + str (e ),
154154 "ERROR" )
155155 continue
156-
156+
157157 if 'process' in locals ():
158158 user_process = locals ()['process' ]
159- user_process (fs , current_frame , obj .data )
159+ try :
160+ user_process (fs , current_frame , obj .data )
161+ except Exception as e :
162+ show_message_box ("Error when calling user process: " + traceback .format_exc (), icon = "ERROR" )
160163 continue
161164
162165 elif 'preprocess' in locals ():
163166 user_preprocess = locals ()['preprocess' ]
164- meshio_mesh = user_preprocess (fs , current_frame )
167+ try :
168+ meshio_mesh = user_preprocess (fs , current_frame )
169+ except Exception as e :
170+ show_message_box ("Error when calling user preprocess: " + traceback .format_exc (), icon = "ERROR" )
171+ continue
165172 else :
166173 filepath = fs [current_frame % len (fs )]
167174 try :
168175 meshio_mesh = meshio .read (filepath )
169176 except Exception as e :
170177 show_message_box ("Error when reading: " + filepath + ",\n " + traceback .format_exc (),
171- "Meshio Loading Error" + str (e ),
172- icon = "ERROR" )
178+ "Meshio Loading Error" + str (e ),
179+ icon = "ERROR" )
173180 continue
174181
175-
176182 if not isinstance (meshio_mesh , meshio .Mesh ):
177183 show_message_box ('function preprocess does not return meshio object' , "ERROR" )
178184 continue
0 commit comments