Select Mesh Objects with ngon faces.
XY Problem. The issue with the exporter is ngons ie meshes with faces using more than four vertices.
Rather than search for anything by name, instead will search by trait. Here is an
example script to select all mesh type objects with 1 or more ngon faces in their data.
import bpy
context = bpy.context
scene = context.scene
for ob in scene.objects:
ob.select_set(
ob.type == 'MESH'
and any(len(p.vertices) > 4 for p in ob.data.polygons)
)
Evaluated mesh,
If applying modifiers is selected in the exporter, doing same on evaluated mesh
import bpy
context = bpy.context
scene = context.scene
dg = context.evaluated_depsgraph_get()
for ob in scene.objects:
ob.select_set(False)
ev_ob = dg.objects.get(ob.name) # hidden obs not in dg
if ev_ob is None or ev_ob.type != 'MESH':
continue
faces = ev_ob.data.polygons
ob.select_set(
any(len(f.vertices) > 4 for f in faces)
)
The next thing to consider will be how to deal with the ngon faces, eg could poke or triangulate, ngons to make them tris.
One option would be to append a triangulate modifier instead of select
if any(len(f.vertices) > 4 for f in faces):
ob.modifiers.new("Tri", 'TRIANGULATE')