@@ -306,57 +306,19 @@ def update_obj(scene, depsgraph=None):
306306
307307 fs = fileseq .FileSequence (full_path )
308308
309- if obj .BSEQ .use_advance and obj .BSEQ .script_name :
310- script = bpy .data .texts [obj .BSEQ .script_name ]
311- show_message_box (f"Cannot run custom script { obj .BSEQ .script_name } using extension from Blender extensions. Use a custom build to enable. Removing script file..." + str (e ), "INFO" )
312- obj .BSEQ .script_name = ""
313- # try:
314- # exec(script.as_string())
315- # except Exception as e:
316- # show_message_box(traceback.format_exc(), "running script: " + obj.BSEQ.script_name + " failed: " + str(e),
317- # "ERROR")
318- # continue
319-
320- if 'process' in locals ():
321- user_process = locals ()['process' ]
322- try :
323- user_process (fs , current_frame , obj .data )
324- obj .BSEQ .current_file = "Controlled by user process"
325- except Exception as e :
326- show_message_box ("Error when calling user process: " + traceback .format_exc (), icon = "ERROR" )
327- del locals ()['process' ]
328- # this continue means if process exist, all the remaining code will be ignored, whethere or not error occurs
329- continue
330-
331- elif 'preprocess' in locals ():
332- user_preprocess = locals ()['preprocess' ]
333- try :
334- meshio_mesh = user_preprocess (fs , current_frame )
335- obj .BSEQ .current_file = "Controlled by user preprocess"
336- except Exception as e :
337- show_message_box ("Error when calling user preprocess: " + traceback .format_exc (), icon = "ERROR" )
338- # this continue means only if error occures, then goes to next bpy.object
339- continue
340- finally :
341- del locals ()['preprocess' ]
342-
343- else :
344- if obj .BSEQ .match_frames :
345- fs_frames = fs .frameSet ()
346- if current_frame in fs_frames :
347- filepath = fs [fs_frames .index (current_frame )]
348- filepath = os .path .normpath (filepath )
349- meshio_mesh = load_meshio_from_path (fs , filepath , obj )
350- else :
351- meshio_mesh = meshio .Mesh ([], [])
352- else :
353- filepath = fs [current_frame % len (fs )]
309+ if obj .BSEQ .match_frames :
310+ fs_frames = fs .frameSet ()
311+ if current_frame in fs_frames :
312+ filepath = fs [fs_frames .index (current_frame )]
354313 filepath = os .path .normpath (filepath )
355314 meshio_mesh = load_meshio_from_path (fs , filepath , obj )
315+ else :
316+ meshio_mesh = meshio .Mesh ([], [])
317+ else :
318+ filepath = fs [current_frame % len (fs )]
319+ filepath = os .path .normpath (filepath )
320+ meshio_mesh = load_meshio_from_path (fs , filepath , obj )
356321
357- if not isinstance (meshio_mesh , meshio .Mesh ):
358- show_message_box ('function preprocess does not return meshio object' , "ERROR" )
359- continue
360322 update_mesh (meshio_mesh , obj .data )
361323
362324 apply_transformation (meshio_mesh , obj , depsgraph )
0 commit comments