# How to reference a particular Panel used in the ui?

I want to change the category value of a panel. And I can get all bpy_class of a module like this:

import bpy_types
typemap_list = bpy_types.TypeMap.get(__name__, ())

for cls_weakref in typemap_list:
cls = cls_weakref()
if cls.bl_label == 'My Panel'
cls.bl_category = 'New category name' # changed here
break


But is it possible to get the right class without needing the loop?

## 1 Answer

You can get the panel in a single operation but not by label, since panels labels aren't necessarily unique, you should use the panel name.

eg:

cls = getattr(bpy.types, "VIEW3D_PT_view3d_display")


Note that bpy_types.TypeMap is part of Blenders internal logic which you're not meant to touch! :)