[Bf-committers] equivalent in 2.5
Campbell Barton
ideasman42 at gmail.com
Wed Apr 27 05:33:23 CEST 2011
In blender 2.5 normally this is not needed, rather then looping over
all views generally operators are set to only run in that view type.
then they can access context.area, context.region.
But there are still times this is handy, Demo Mode Addon for eg checks
all spaces to auto detect if the screen setup should play an animation
or render.
Heres an example of looping over 3d views in the active window.
import bpy
for area in bpy.context.window.screen.areas:
space = area.active_space
if space.type == 'VIEW_3D':
rv3d = space.region_3d
print(space, rv3d)
... or as a generator to loop over different types.
import bpy
def space_iter_type(view_type):
for area in bpy.context.window.screen.areas:
space = area.active_space
if space.type == view_type:
yield space
for view in space_iter_type('VIEW_3D'):
print(view)
2011/4/27 Yuniel Castro González <ycastrog at estudiantes.uci.cu>:
> Hi.
> Which is the expression equivalent to:
>
> for Win3D in Window.GetScreenInfo (Window.Types.VIEW3D)
>
> in blender 2.5??
>
> --
>
>
>
>
>
>
>
>
> Yuniel
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>
--
- Campbell
More information about the Bf-committers
mailing list