### clear keyframe of specific property of selected object import bpy def clear_keyframe(obj, data_path, ind=None): try: fcs = obj.animation_data.action.fcurves if ind is None: fc = fcs.find(f'{data_path}') else: fc = fcs.find(f'{data_path}', index=ind) fcs.remove(fc) print(f"{obj} {fcs} removed") except: if hasattr(obj, "name"): print(f"{obj.name} fcurve remove fail") else: print(f"object fcurve remove fail") for obj in bpy.context.selected_objects: clear_keyframe(obj, "location", 0) clear_keyframe(obj, "location", 1) clear_keyframe(obj, "location", 2)