Removing an existing Panel

In an add-on I would like to remove or modify one of the existing Blender Panels. Does anyone know of anyway this can be accomplished?

Just to be clear I am aware of the bpy.utils.unregister_class(class), but from my add-on i don’t have access to the default blender panels.

Any help is appreciated. Thanks.

I feel silly now, but i figured it out.

Just in case anyone else stumbles onto this thread you can unregister any panel in blender with this.

bpy.utils.unregister_class(bpy.types.<class_name>)

but obviously replace <class_name> with the class name that you want to remove.

Just an other silly thing, how do you get the class name of the panel you want to remove?

Thx

You have to find the class you want to remove. Blender keeps all of their interfaces in the scripts/startup/bl_ui directory. If you look through those scripts you will find every panel, menu, and header defined in Blender. Lets say you want to remove the “name” panel in the 3D Viewport. In the scripts/startup/bl_ui/space_view3d.py module you will find a class called VIEW_PT_view3d_name. All you need to do is add this to your add-on:

bpy.utils.unregister_class(bpy.types.VIEW_PT_view3d_name)

and the panel will be removed. I hope this helps!