@@ -189,17 +189,12 @@ def extract_solid2model(root_node, node):
189
189
if len (obj_chunk .materials_names ) > 0 :
190
190
mat = obj_chunk .materials_names [geom .material_index ]
191
191
else :
192
- if (
193
- obj_chunk .material_insts_lt_v16 is not None
194
- and len (obj_chunk .material_insts_lt_v16 ) > 0
195
- ):
192
+ if obj_chunk .material_insts_lt_v16 is not None and len (obj_chunk .material_insts_lt_v16 ) > 0 :
196
193
mat_idx = obj_chunk .material_insts_lt_v16 [geom .material_index ]
197
194
elif obj_chunk .materials is not None and len (obj_chunk .materials ) > 0 :
198
195
mat_idx = obj_chunk .materials [geom .material_index ]
199
196
else :
200
- mat_idx = obj_chunk .custom_materials [
201
- geom .material_index
202
- ].material_user_inst
197
+ mat_idx = obj_chunk .custom_materials [geom .material_index ].material_user_inst
203
198
204
199
if type (root_node .nodes [mat_idx ]) == str :
205
200
mat = root_node .nodes [mat_idx ].split ("." )[0 ]
@@ -211,11 +206,7 @@ def extract_solid2model(root_node, node):
211
206
for chunk in visual_node .body :
212
207
if isinstance (chunk , Container ) and chunk .chunkId == 0x0900600F :
213
208
if len (chunk .chunk .vertexStreams ) == 0 :
214
- meshes .append (
215
- export_CPlugVisualIndexedTriangles_without_vertex_stream (
216
- visual_node , mat
217
- )
218
- )
209
+ meshes .append (export_CPlugVisualIndexedTriangles_without_vertex_stream (visual_node , mat ))
219
210
continue_meshes = True
220
211
if continue_meshes :
221
212
continue
@@ -308,9 +299,7 @@ def extract_mesh(data, static_node, lod, offset_index, ent_idx, off_pos, off_rot
308
299
final_pos = [ent .pos , * off_pos ]
309
300
final_rot = [ent .rot , * off_rot ]
310
301
311
- meshes = extract_mesh (
312
- data , model , 1 , offset_index , ent_idx , final_pos , final_rot
313
- )
302
+ meshes = extract_mesh (data , model , 1 , offset_index , ent_idx , final_pos , final_rot )
314
303
filename = (
315
304
os .path .basename (file ).split ("." )[0 ]
316
305
+ ("_" if len (offset_index ) > 0 else "" )
@@ -341,9 +330,7 @@ def extract_meshes(root_data, data, off_pos=None, off_rot=None, extracted_files=
341
330
final_pos = [ent .pos , * off_pos ]
342
331
final_rot = [ent .rot , * off_rot ]
343
332
344
- result += extract_meshes (
345
- root_data , model , final_pos , final_rot , extracted_files
346
- )
333
+ result += extract_meshes (root_data , model , final_pos , final_rot , extracted_files )
347
334
return result
348
335
elif data .classId == 0x900C000 :
349
336
# print("skip surf (for now?)")
0 commit comments