__author__ = 'thoth'
import bpy
def indent(spaces, text):
return text.replace(r'^', spaces)
def info_dump_area(area):
rval = ""
for i in range(len(area.spaces)):
sp = area.spaces[i]
rval = rval+"space[%d] type=%s\n"%(i, sp.type)
for i in range(len(area.regions)):
r = area.regions[i]
rval = rval+"region[%d] type=%s\n"%(i,r.type)
return rval
def info_dump_screen(screen):
rval = ""
for i in range(len(screen.areas)):
a = screen.areas[i]
rval = rval + "area[%d] type=%s {\n"%(i,a.type)
rval = rval + " %dx%d+%d+%d"%(a.width, a.height, a.x, a.y)
rval = rval + indent(" ", info_dump_area(a))
rval = rval + "}\n"
return rval
def mission1(screen):
print(info_dump_screen(screen))
mission1(bpy.context.screen)
|
Blender python API quick-start
Syntax highlighting by Pygments.