I am not a programmer and I don't know what I am doing.
I want to export many shapekeys as OBJ files from an active object. Doing this manually would take an insane amount of time. Unfortunately, I haven't found an existing script that is doing this.
What I want to do: (Blender button: I dont know how to do that)
for each 'shapekey' in the 'acive object': if shapekey is 'hidden' 1. unhide shapekey 2. export 'active object' as "shapekey's name".obj 3. hide shapekey
Here is what I managed to cobble together from code I found in stackoverflow and blender stack exchange so far:
import os import bpy # Save the files where the .blend file is located basedir = bpy.path.abspath('//') ob = bpy.context.object.data.shape_keys.key_blocks for i in ob: if i.mute == True: i.mute = False print(i.name) bpy.ops.export_scene.obj( filepath=os.path.join(basedir, i.name + '.obj'), use_selection=True, global_scale=1, axis_forward='-Z', axis_up='Y', use_materials=False, keep_vertex_order=True) i.mute = True