Ok, my brain is just not catching the monkey wrench in this equation. A bit confusing to describe too.
1. Comp1(23.976 fps) has a precomp layer with keyframed Time Remaping.
2. Comp2(25 fps, long story, but it cannot change, it must stay at 25) is said precomp in Comp1 containing source stuff (not important), and a null (important).
3. I am runnning my script to grab Comp1 Time Remaped keyframe values used...
4. ...then I am placing a marker on null layer in Comp2 on the matching frame.
My goal is to reveal in Comp2 all of the frames used in my Time Remap animation. I basically am looking at a null layer in comp2 with clusters of markers on the frames used. My only issue is that the markers are hitting non whole frame points. For example frame 8 will have three markers at fractional points on it. I think this is somehow due to fps differences, but at the same time, the Time Remap keyframe value IS stating the actual whole frame number. So, I'm not truly sure if it is FPS. Any thoughts?
Ok, I've made some headway, but not a solid solution. If I take the returned keyframe value and divide it by Comp2's frameDuration and not Comp1's, then round that, I get 98% correct whole frame values...
Math.round(myKeyValue / comp2.frameDuration);
SO CLOSE, but not spot on exact as every so often I get a 1 frame diversion (this may have to do with the seven decimal rounding mentioned in a previous thread http://forums.adobe.com/thread/956954?tstart=0)
It is mainly that. However if you get some difference here and there, I would try with Math.ceil and Math.floor to see if it is getting better.
But, if your comps are really long, probably you'll need a more precise version.
Another thing. There is some discrepancies between comp.frameDuration and (1/comp.framerate) in 23.976 and 29.97 fps. You should try your formula with both to see if you get better results.