2
$\begingroup$

I want to let user change the "keymap space" at real time.

enter image description here

I know,

bpy.data.window_managers['WinMan'].windows[0].screen.areas

Which gives the list of open areas, not all.
And, All are present in bpy.types.Space (as Subclasses)

But don't know how to get them as list...

$\endgroup$
0

1 Answer 1

1
$\begingroup$

This script should work:

import bpy

for area_type in bpy.types.Area.bl_rna.properties['type'].enum_items:
    print(area_type.name, "=>", area_type.identifier)

It will give you this output:

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ I thought that bl_rna only works with bpy.ops. Good to know, bl_rna always use bpy.types under the hood. Thanks for your answer. $\endgroup$ Commented Aug 1, 2023 at 6:30

You must log in to answer this question.

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