Please help me!

Exists a way to delete from action Location and scale?
i have many animations and i need to keep only rotation keyframes…
thanks

This should work, but it will affect all of the actions in your scene.

import bpyfor a in bpy.data.actions:
    
    removeThese = []
    for f in a.fcurves:
        
        if f.data_path.endswith(('location', 'rotation_quaternion')):
            removeThese.append(f)
    
    for r in removeThese:
        a.fcurves.remove(r)

Hi Krisnack thanks for your reply but it gives me this error:

it’s a small identation error…
it should be:


import bpy

for a in bpy.data.actions:
(....)

Thank you very much now works! but it keeps the scale … i would like to keep only Rotation :slight_smile:
thanks again!

i did … i just replaced rotation with scale and now is perfect!

bad that i can’t use just in some actions … but is already a great thing!!
thanks!!