-L0Lock-

Untitled

Sep 4th, 2024
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import bpy, mathutils
  2.  
  3. for area in bpy.context.window.screen.areas:
  4.     if area.type == 'VIEW_3D':
  5.        
  6.         view_matrix = area.spaces.active.region_3d.view_matrix
  7.         print(f"CURRENT MATRIX:\n{view_matrix}")
  8.  
  9.         flipped_view_matrix = view_matrix.copy()
  10.         flipped_view_matrix[2][0] *= -1  # Flip scale-X? visibly not...
  11.  
  12.         print(f"NEW MATRIX:\n{flipped_view_matrix}")
  13.  
  14.         # Apply the new view matrix
  15.         area.spaces.active.region_3d.view_matrix = flipped_view_matrix
  16.         area.tag_redraw()
Advertisement
Add Comment
Please, Sign In to add comment