# Modifying FCurve values on armature bones via python

I have this script, which does what i need with object actions.

import bpy

y_scale = 10

try:
for fcu in bpy.context.object.animation_data.action.fcurves:
if fcu.data_path == "location":
for kp in fcu.keyframe_points:
kp.co.y *= y_scale
kp.handle_left.y *= y_scale
kp.handle_right.y *= y_scale
except TypeError:
pass


But i actually need to do this with armature bones. Can somebody modify this script to make it work with bones on all actions presented in armature?

• if fcu.data_path.endswith("location"): would prob do it. The location data path for pose bones is pose.bones["Bone"].location for example with bone name: "Bone". – batFINGER Oct 15 '16 at 6:13
• It works now, thank you. How do i mark this answered? – BlenderTard Oct 15 '16 at 9:52
• Noting that the modified script is still viable in 2.8, and quickly fixes broken actions and pose libraries after applying an armature's scale. Great work! – jackiejake Jul 21 at 8:04