Guest User

Untitled

a guest
Jul 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import bpy
  2. is_local_view = sum(bpy.context.space_data.layers[:]) == 0
  3.  
  4. for area in bpy.context.screen.areas:
  5. if area.type == 'VIEW_3D':
  6. space = area.spaces[0]
  7. if space.local_view: #check if using local view
  8. for region in area.regions:
  9. if region.type == 'WINDOW':
  10. override = {'area': area, 'region': region} #override context
  11. bpy.ops.view3d.localview(override) #switch to global view
  12.  
  13. if context.space_data.local_view:
  14. bpy.ops.view3d.localview()
Add Comment
Please, Sign In to add comment