Last active
May 21, 2023 18:21
-
-
Save satishgoda/4414757 to your computer and use it in GitHub Desktop.
The goal of this script is to print the number of Spaces in each area of the current screen in Blender (http://learningblender3dsoftware.blogspot.in)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.blender.org/documentation/blender_python_api_2_65_3/bpy.types.Area.html | |
# http://www.blender.org/documentation/blender_python_api_2_65_3/bpy.types.Space.html | |
import bpy | |
template_Area = "Area: {0}\n" | |
template_Space = "\tSpace: {0} {1}\n" | |
for area in bpy.context.screen.areas: | |
print(template_Area.format(area.type)) | |
spaces = area.spaces | |
for space in spaces: | |
is_active = "[ACTIVE]" if (space == spaces.active) else "" | |
print(template_Space.format(space.type, is_active)) | |
------------------- OUTPUT ------------------------ | |
Area: INFO | |
Space: INFO [ACTIVE] | |
Area: PROPERTIES | |
Space: PROPERTIES [ACTIVE] | |
Area: CONSOLE | |
Space: CONSOLE [ACTIVE] | |
Space: TIMELINE | |
Area: OUTLINER | |
Space: OUTLINER [ACTIVE] | |
Area: TEXT_EDITOR | |
Space: TEXT_EDITOR [ACTIVE] | |
Space: FILE_BROWSER | |
Space: VIEW_3D | |
Area: VIEW_3D | |
Space: VIEW_3D [ACTIVE] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment