Documentation: View3DOverlay.show_stats.

The UI shows the following:

enter image description here

However when I run bpy.data.screens['Layout'].overlay.show_stats, there is an error: AttributeError: 'Screen' object has no attribute 'overlay.

  • $\begingroup$ Trying to change bpy.data.screens['Layout'].overlay.grid_scale = 0.001 and hit the same issue. $\endgroup$ Jul 24 at 9:21

1 Answer 1


Look at the type.

Sometimes the tooltips can be screwy as shown in question the overlay is not a property of screen.

On the bpy.types.View3DOverlay help page linked go to the bottom to references.

WIll see a link to SpaceView3D.overlay

which is the space assigned to the 3d view.

In the python console

>>> for i, a in enumerate(C.screen.areas):
...     i, a.type
(1, 'CONSOLE')
(3, 'VIEW_3D')

>>> space = C.screen.areas[3].spaces.active
>>> space.overlay.show_stats

>>> type(space)
<class 'bpy.types.SpaceView3D'>

>>> type(space.overlay)
<class 'bpy.types.View3DOverlay'>

If a script is run within the context of the 3Dview area, a panel draw, menu shortcut etc, then

space = context.space_data

The blender screen is split into areas. When you change the area type in UI, the active space used is associated with that type. When you see the type SpaceFoo you know its the space of the "Foo" area. eg "SpaceProperties", "SpaceConsole"


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.