I found this thread and I already have Developer Extras
enabled but I noticed that sometimes some operators don't show up in the F3 menu search despite REGISTER
being part of the bl_options
and being registered with bpy.utils.register_class(MESH_OT_RemoveLoneVertices)
. Other operators that get registered in the same file as this one do show up in F3. So why does this one not show up? So it's like some randomly show up and others don't. Do you see anything wrong with this file in particular?
import bpy
import bpy_types
import bmesh
class MESH_OT_RemoveLoneVertices(bpy.types.Operator):
bl_idname = "mesh.remove_lone_vertices"
bl_label = "Remove Lone Vertices"
bl_description = "Remove vertices that are not connected to any edges"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context) -> set[str]:
obj = bpy.context.active_object
mesh = obj.data
bpy.ops.object.mode_set(mode='EDIT')
bm = bmesh.from_edit_mesh(mesh)
bm.edges.ensure_lookup_table()
bm.verts.ensure_lookup_table()
bpy.ops.mesh.select_all(action='DESELECT')
for vert in bm.verts:
if not vert.link_edges:
vert.select = True
bmesh.update_edit_mesh(mesh)
bpy.ops.mesh.delete(type='VERT')
def draw(self, context: bpy_types.Context) -> None:
pass
@classmethod
def poll(cls, _context):
return False