Blender sculpt brushes how do you reset ot delete copies.

i accidentally flooded my sculpt brushes with copies, so now i’m wondering can you delete them while in a project? If then don’t worry.

import bpy

for i in bpy.data.brushes:
    if "." in i.name:
        i.user_clear()
        bpy.data.brushes.remove(i)

This script will remove all the brushes that have a “.” in their name (As all of copies if you have not renamed them).