How to Register Again - Unregister Class (bpy_types) ?

Hi everyone.
I unregister class, VIEW3D_PT_tools_transform

import bpy_types
bpy.utils.unregister_class(bpy_types.bpy_types.VIEW3D_PT_tools_transform)

How can I register it again with a script?


This not working:

bpy.utils.register_class(bpy_types.bpy_types.VIEW3D_PT_tools_transform)

You can unregister a class using the reference in bpy.types… but as soon you do that, that reference is gone, and you need the original class to register it again…


import bl_ui
bpy.utils.register_class(bl_ui.space_view3d_toolbar.VIEW3D_PT_tools_transform)

The class is stored in the ‘space_view3d_toolbar.py’ at ‘blenddir/2.XX/startup/bl_ui/’

something usefull: you can check where the class comes from with:

bpy.types.CLASS.__module__

Thanks you very much!!!