Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #OPERATOR WILL RUN WHEN "S" IS PRESSED
  2.  
  3. import bpy
  4.  
  5. #Using this in case I want to add more modes later
  6. pivot_modes = ['MEDIAN_POINT', 'INDIVIDUAL_ORIGINS']
  7. i = 0
  8.  
  9. #IF SCALE IS ALREADY ACTIVE:
  10.  
  11. #Store the original Pivot Point
  12. pivot_point = bpy.context.tool_settings.transform_pivot_point[:]
  13.  
  14. #Change Pivot Modes
  15. if pivot_point == pivot_modes[i]:
  16. bpy.context.tool_settings.transform_pivot_point = pivot_modes[i+1]
  17.  
  18. elif pivot_point == pivot_modes[i+1]:
  19. bpy.context.tool_settings.transform_pivot_point = pivot_modes[i]
  20.  
  21. #ELSE:
  22.  
  23. #Make sure we always start with Mediant Point Mode
  24. #bpy.context.tool_settings.transform_pivot_point = 'MEDIAN_POINT'
  25.  
  26. #bpy.ops.transform.resize('INVOKE_DEFAULT')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement