Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created November 2, 2015 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/a01cbb28aed399146a86 to your computer and use it in GitHub Desktop.
Save zeffii/a01cbb28aed399146a86 to your computer and use it in GitHub Desktop.
import bpy
for window in bpy.context.window_manager.windows:
for area in window.screen.areas:
# areas, Editors(UV/3D/Node)/Properties/Outliner...etc
if not area.type == 'VIEW_3D':
continue
# each area has potentially panels, and headers open.
# you are just interested in the 3d part.
for s in area.spaces:
if s.type == 'VIEW_3D':
print(area.height, area.width)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment