bpy.ops.3.py 501 B

123456789101112131415161718
  1. """
  2. It is also possible to run an operator in a particular part of the user
  3. interface. For this we need to pass the window, screen, area and sometimes
  4. a region.
  5. """
  6. # maximize 3d view in all windows
  7. import bpy
  8. for window in bpy.context.window_manager.windows:
  9. screen = window.screen
  10. for area in screen.areas:
  11. if area.type == 'VIEW_3D':
  12. override = {'window': window, 'screen': screen, 'area': area}
  13. bpy.ops.screen.screen_full_area(override)
  14. break