Skip to content

Commit 7124bf6

Browse files
committed
fix for preprocess and process still exist in next for loop
1 parent e2fef18 commit 7124bf6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

simloader/importer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ def update_obj(scene, depsgraph=None):
200200
user_process(fs, current_frame, obj.data)
201201
except Exception as e:
202202
show_message_box("Error when calling user process: " + traceback.format_exc(), icon="ERROR")
203+
del locals()['process']
204+
# this continue means if process exist, all the remaining code will be ignored, whethere or not error occurs
203205
continue
204206

205207
elif 'preprocess' in locals():
@@ -208,7 +210,10 @@ def update_obj(scene, depsgraph=None):
208210
meshio_mesh = user_preprocess(fs, current_frame)
209211
except Exception as e:
210212
show_message_box("Error when calling user preprocess: " + traceback.format_exc(), icon="ERROR")
213+
# this continue means only if error occures, then goes to next bpy.object
211214
continue
215+
finally:
216+
del locals()['preprocess']
212217
else:
213218
filepath = fs[current_frame % len(fs)]
214219
try:

0 commit comments

Comments
 (0)