@@ -181,6 +181,7 @@ def create_meshio_obj(filepath):
181
181
"Meshio Loading Error" + str (e ),
182
182
icon = "ERROR" )
183
183
184
+ # Do I need this for multi-loading?
184
185
if filepath .endswith (".obj" ):
185
186
bpy .ops .import_scene .obj (filepath = filepath )
186
187
obj = bpy .context .selected_objects [0 ]
@@ -201,24 +202,27 @@ def create_obj(fileseq, use_relative, root_path, transform_matrix=Matrix([[1, 0,
201
202
current_frame = bpy .context .scene .frame_current
202
203
filepath = fileseq [current_frame % len (fileseq )]
203
204
204
- if fileseq .extension () == '.obj' :
205
- create_meshio_obj (filepath )
206
- return
207
-
208
- meshio_mesh = None
209
- enabled = True
210
- try :
211
- meshio_mesh = meshio .read (filepath )
212
- except Exception as e :
213
- show_message_box ("Error when reading: " + filepath + ",\n " + traceback .format_exc (),
214
- "Meshio Loading Error" + str (e ),
215
- icon = "ERROR" )
205
+ if filepath .endswith (".obj" ):
206
+ bpy .ops .import_scene .obj (filepath = filepath )
207
+ object = bpy .context .selected_objects [- 1 ]
208
+ object .name = fileseq .basename () + "@" + fileseq .extension ()
216
209
enabled = False
210
+ else :
211
+ meshio_mesh = None
212
+ enabled = True
213
+ try :
214
+ meshio_mesh = meshio .read (filepath )
215
+ except Exception as e :
216
+ show_message_box ("Error when reading: " + filepath + ",\n " + traceback .format_exc (),
217
+ "Meshio Loading Error" + str (e ),
218
+ icon = "ERROR" )
219
+ enabled = False
220
+
221
+ name = fileseq .basename () + "@" + fileseq .extension ()
222
+ mesh = bpy .data .meshes .new (name )
223
+ object = bpy .data .objects .new (name , mesh )
217
224
218
225
# create the object
219
- name = fileseq .basename () + "@" + fileseq .extension ()
220
- mesh = bpy .data .meshes .new (name )
221
- object = bpy .data .objects .new (name , mesh )
222
226
object .BSEQ .use_relative = use_relative
223
227
if use_relative :
224
228
if root_path != "" :
0 commit comments