Since this is related to the animation module now handled by dr.Sybren I’m tagging him.Although it might be just a python API thing
So as I’m fiddling a lot with keyframes. I inevitably end up dealing with fcurves.But I was wondering why is there two ways to accessing keyframes. Is this repeating data? or just two paths to the same.
One way is through
object.animation_data.action.fcurves[i].keyframe_points and the other is more in line with what we see in the
graph editor and
dopesheet, which is -
object.animation_data.groups[i].channels[i].keyframe_points . Again both work but I feel like the second is more accurate with what we have in the dopesheet, and gives more accurate way to distinguish between channels/fcurves. Was the fcurves way an old data path? That is still hanging around?
Which brings me to another point about fcurves/channels.
Right now the out of the box way to identify fcurves/channels is with
.array_index. And that would be totally fine if blender actually gave each fcurve/channel it’s own unique index. But instead I would get 0,1,2 for location and 0,1,2 for rotation etc. . But sometimes it will actually work right and give me 0,1,2 for location and 3,4,5 for rotation etc. . Still it’s obvious that if take that index and store it along with some values, and apply it later. In the cases where it gives me 0,1,2 for every set of three fcurves/channels , it will modify all fcurves/channels with that index…thus all.
So I’m wondering… since we have user editable names for objects and we can reference them with
object.name. Since we have user editable names for action and can reference it with action.name. Since we have user editable names for groups and can reference them with
group[i].name . Why can’t we have an
fcurve/channel.name instead of
.array_index, which more often than not, is identical with other fcurves/channels.
At the moment I’m working around this issue with using
fcurves/channels[i].data_path and concatenating that with the
array_index and I get something like “0.location”,“1.location”,“2.location”.
I’m thinking, considering that in the dopesheet we have non user editable(hardcoded) identifiers for channels like “X Location”, “X Rotation”, “X Scale”. why don’t we have a
fcurve/channel.name , in which we have the proper channel name string?