1
$\begingroup$

I'd like to create a footer where there's no "FOOTER" bl_region_type for example in the 3D view, it seems impossible to do in python? is this hardcoded in C++?

import bpy

class HELLO_PT_world(bpy.types.Header):
    bl_idname      = "HELLO_PT_world"
    bl_label       = "HelloWorld"
    bl_space_type  = "VIEW_3D"
    bl_region_type = "FOOTER"
    
    def draw(self, context):
        self.layout.label(text="Is This Working?")
        
        
print("Trying to register")
from bpy.utils import register_class
register_class(HELLO_PT_world) #-> RuntimeError: Error: Region not found in space type
                               #   Well I want to add a new region in this space... Duh... 

$\endgroup$

1 Answer 1

1
$\begingroup$

Easily checked.

The type of region available to each of the area types is probably in the docs somewhere, however it is easily checked using the python console.

With a 3d view area as the variable area (C.screens.areas[3] in this example)

>>> area
bpy.data.screens['Scripting.001']...Area

>>> area.type
'VIEW_3D'

>>> for region in area.regions:
...     region.type
...     
'TOOL_HEADER'
'HEADER'
'TOOLS'
'UI'
'WINDOW'

if it's not there, it's not possible with python.

Somewhat related https://blender.stackexchange.com/a/161773/15543

$\endgroup$
3
  • $\begingroup$ Ah that is sad, i was hoping it was not hard coded per area type $\endgroup$
    – Fox
    Mar 2, 2021 at 15:59
  • $\begingroup$ Do panels even register / draw in header / footer / window regions when they are available? The poor ol' python console only has two. $\endgroup$
    – batFINGER
    Mar 2, 2021 at 16:24
  • $\begingroup$ ah, correct we need to use bpy.types.Header (even for footer) $\endgroup$
    – Fox
    Mar 3, 2021 at 0:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .