This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://blender.stackexchange.com/questions/56795/script-outdated-shape-keys-and-applying-subdivision-surface-modifier | |
import bpy | |
def reset_shape_keys (): | |
for name, shape_key in get_active_block().items(): | |
shape_key.value = 0 | |
def get_active_block (): | |
if bpy.context.object.active_shape_key is None or bpy.context.object.active_shape_key.id_data is None: | |
bpy.context.object.active_shape_key_index = 0 |