I use the below code to retrieve location of pose.bone, but it always give 0 (or -0).
It seems the pose.bone location is the relative position of its parent so it will not-zero value once I grab pose.bone to somewhere?!
Is there a way to get "global location(X, Y, Z)" of pose.bone??
for action in bpy.data.actions:
print(action)
for fcurve in action.fcurves:
print("data_path:" + fcurve.data_path + ", channel " + str(fcurve.array_index))
for keyframe in fcurve.keyframe_points:
print(keyframe.co)
data_path:pose.bones["Bone.011"].location, channel 0
Vector (13.0000, -0.0000)
Vector (29.0000, -0.0000)
Vector (40.0000, -0.0000)
Vector (45.0000, -0.0000)
Vector (83.0000, -0.0000)
Vector (110.0000, -0.0000)
data_path:pose.bones["Bone.011"].location, channel 1
Vector (13.0000, 0.0000)
Vector (29.0000, 0.0000)
Vector (40.0000, 0.0000)
Vector (45.0000, 0.0000)
Vector (83.0000, 0.0000)
Vector (110.0000, 0.0000)
data_path:pose.bones["Bone.011"].location, channel 2
Vector (13.0000, -0.0000)
Vector (29.0000, -0.0000)
Vector (40.0000, -0.0000)
Vector (45.0000, -0.0000)
Vector (83.0000, -0.0000)
Vector (110.0000, -0.0000)
data_path:location, channel 0
Vector (13.0000, 0.0245)
Vector (45.0000, -3.3037)
Vector (83.0000, 0.0245)
Vector (110.0000, 1.5101)
data_path:location, channel 1
Vector (13.0000, -0.0075)
Vector (45.0000, -0.0075)
Vector (83.0000, -0.0075)
Vector (110.0000, -0.0075)
data_path:location, channel 2
Vector (13.0000, 3.0031)
Vector (45.0000, 2.5048)
Vector (83.0000, 1.8442)
Vector (110.0000, 1.8442)