I'm getting very odd behavior from the FxTimingAPI when called from a Generator, especially with the new instance that results from a Generator being cut in half on the timeline.
Immediately after the generator is cut in half, querying the FxTimingAPI about the startTimeForEffect of the generator returns -1. Actually, this seems to be true for most FxTimingAPI queries. The values FxTimingAPI returns seem to be invalid, up until the first time the Generator is rendered. (Therefore, querying FxTimingAPI from parameterChanged is problematic.)
If the new Generator (2nd half of the cut generator) is rendered into the inspector's viewer, then the values returned from the FxTimingAPI seem to be inconsistent. Sometimes they look right (relative to the Viewer, but not the Timeline), but sometimes they look like the values left over from a previous clip that was inspected.
Basically, I'm not getting truly valid values relative to the generator/clip in the timeline, until after the first time the new instance is rendered into the canvas.
Loading the parameters into the inspector by double-clicking on the generator in the timeline seems like it should make FxTimingAPI give timeline relevant results. But, it does not. Not until after a render into the canvas of that generator. (Which does not happen until the playhead is over that generator. Which the user may not happen to do.)
Is this correct?
Is there a way for me to force the FxTimingAPI to initialize, without doing a render? (Since I can't force the user to move the playhead.)
-- Brian
PS: For debugging purposes, I've created some Float Parameters, and am setting them from inside the parameterChanged and renderOutput methods, to reflect the following FxTimingAPI calls:
id timingApi = [_apiManager apiForProtocol:@protocol(FxTimingAPI)];
double dbg_StartTime = [timingApi startTimeForEffect:self]; double dbg_Duration = [timingApi durationForEffect:self];
double dbg_InPointOfTimelineForEffect = [timingApi inPointOfTimelineForEffect:self]; double dbg_OutPointOfTimelineForEffect = [timingApi outPointOfTimelineForEffect:self];
double dbg_StartTimeOfImageParm = [timingApi startTimeOfImageParm:kMyImageParamID forEffect:self];
double dbg_DurationOfImageParm = [timingApi durationOfImageParm:kMyImageParamID forEffect:self];
|