Using different regions
Usually, panels can be moved freely to another part of the interface. There are a few exceptions where repositioning a panel would not make much sense. For instance, a tool that helps select the controls of a character would be of little help in the Video Editor, and its poll()
method might be looking for attributes, such as animation bones, outside of the animation’s context
.
Outside of those cases, changing the bl_*
attributes of a Panel
class is enough to move our panel to a different place. Please refer to the panel attributes that we looked at in the Creating a simple panel section of this chapter.
So, to display our panel in the 3D Viewport area, we can change the values of bl_space_type
and bl_region_type
as follows:
bl_space_type = 'VIEW_3D' bl_region_type = 'UI'
Figure 5.27: Our panel has been moved to the 3D Viewport area
By default, the...