Please help me!


(KaoZ) #1

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


(Krisnack) #2

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)

(KaoZ) #3

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


(Secrop) #4

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


import bpy

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


(KaoZ) #5

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!!