Guest User

Untitled

a guest
Aug 21st, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. import bpy
  2. import bmesh
  3.  
  4. modif = 1.5
  5.  
  6. me = bpy.context.object.data
  7. obj = bpy.context.object
  8. shapekeynames = []
  9. shapekeys = me.shape_keys
  10. for shapekey in shapekeys.key_blocks:
  11.     shapekeynames.append(shapekey.name)
  12.  
  13. for shapekeyname in shapekeynames:
  14.     if shapekeyname == 'Basis':
  15.         continue
  16.  
  17.     shapekeys.key_blocks[shapekeyname].slider_max = modif
  18.     shapekeys.key_blocks[shapekeyname].value = modif
  19.     # apply new 1.5x shape as mix, append old name with extra modifier
  20.     newShapeKey = obj.shape_key_add(shapekeyname + '_NEW', True)
  21.    
  22.     shapekeys.key_blocks[shapekeyname].value = 0
  23.     # delete old shape
  24.     obj.shape_key_remove(shapekeys.key_blocks[shapekeyname])
  25.     # rename new shape to old name
  26.     shapekeys.key_blocks[shapekeyname + '_NEW'].name = shapekeyname
Advertisement
Add Comment
Please, Sign In to add comment