So I have this script I’d like to make, which would measure the distance between two tracks in the movie editor and then make that distance into its own FCurve, if possible in a line that goes straight from the movie editor to a shape key driver. With a good UI, this would be a fast and lightweight way to get face synch from video, without requiring the user to stand absolutely still during capture. (With more math we could do this in bundle-land and get, like, high-quality telemetry but one thing at a time.)
Problem: either I don’t know how to use FCurves, or they actually are difficult. Here’s what it looks like I have to do:
1: Getting the FCurves. Besides having a rather long resource locator, this isn’t so bad:
From memory, so appologies if my syntax is off:
bpy.data.movies[‘clipname’].tracks <- per dimension to get 3 FCurves per track, 6 total in my case.
2: Get the data from the FCurves. This is the hard part that I don’t quite get yet, because FCurves aren’t made out of frames, they’re made out of keys, and if I’m comparing two different tracks that’s potentially a problem. At this stage I can’t even figure out how to request a list of them, because either my Python is even weaker than I thought or I’m looking at this wrong.
3: Pythagorean sum, calculate new keys, put into new FCurve, bind to shape key.
No clue how that’d work, not there yet.
So my question to the veterans around here-- am I looking at this completely wrong, or is it just a matter of getting better with these data structures and their inherited methods?