we're building a plugin to place keyframes into a composition
we want the keyframes to be placed in timespots that match the framerate of the composition.
what we have, currently, is roughly:
| A_Time time; |
| AEGP_ItemH myitem; |
| suites.ItemSuite8()->AEGP_GetActiveItem(&myitem); |
| suites.ItemSuite8()->AEGP_GetItemCurrentTime(myitem,&time); |
| (for i...)
A_Time keyTime = {mytime+i*1000, time.scale}; |
| suites.KeyframeSuite4()->AEGP_AddKeyframes(positionKeyframesInfo, AEGP_LTimeMode_CompTime, &keyTime, &index); |
| suites.KeyframeSuite4()->AEGP_SetAddKeyframe(positionKeyframesInfo, index, &tempPosition); |
where i*1000 is a hackish and terrible approximation of where keyframes should be placed. (we tried a more complicated estimation involving taking the framerate given in time scale and dividing it by itself but with rounding errors, and hat sort of worked, sometimes, but then sometimes it doesn't work at all, and either way it isn't really what we actually need so our problem remains the same.
there must be a way of placing one keyframe per frame, using the framerate of the composition. but we've read everything we could find in the SDK and we aren't seeing it.
what can we do? is there a call that gives us this information?
-----
another way of phrasing this question
The call to KeyframeSuite4()->AEGP_AddKeyframes has a required argument of an A_Time where to place the frame.
We'd like that time to match, incrementally, the time of each new frame, as per the compositions original framerate.
how can we do this?
---
ETA: Also, for my own edification, in
AEGP_SetAddKeyframe(
AEGP_AddKeyframesInfoH akH,
A_long indexL,
const AEGP_StreamValue2*valueP);
what is the meaning/purpose of A_long indexL?