finding framerate to place keyframes


we're building plugin place keyframes composition

 

we want keyframes placed in timespots match framerate of composition.

 

what have, currently, 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 hackish , terrible approximation of keyframes should placed. (we tried more complicated estimation involving taking framerate given in time scale , dividing rounding errors, , hat sort of worked, sometimes, doesn't work @ all, , either way isn't really need our problem remains same.

 

there must way of placing 1 keyframe per frame, using framerate of composition. we've read find in sdk , aren't seeing it.

 

what can do? there call gives information?

 

-----

 

 

another way of phrasing question

the call keyframesuite4()->aegp_addkeyframes has required argument of a_time place frame.

we'd time match, incrementally, time of each new frame, per compositions original framerate.

how can this?

 

 

---

eta: also, own edification, in

 

aegp_setaddkeyframe(
aegp_addkeyframesinfoh akh,
a_long indexl,
const aegp_streamvalue2*valuep);


what meaning/purpose of a_long indexl?

hi there!

 

what you're looking compsuite8()->aegp_getcompframerate( comph, &fps));

to use it, you'll need comph itemh compsuite8()->aegp_getcompfromitem( itemh, &comph)

 

now, can set a_time keytime = {mytime+i*time.scale / fps, time.scale};

 

hope helps,

françois

 

ps: didn't see end of question...

suites.keyframesuite4()->aegp_addkeyframes(positionkeyframesinfo, aegp_ltimemode_comptime, &keytime, &index);

index index of newly created key, know key have modify suites.keyframesuite4()->aegp_setaddkeyframe(positionkeyframesinfo, index, &tempposition);



More discussions in After Effects SDK


adobe

Comments

Popular posts from this blog

after effects warning: unable to create drawing surface

Maximum number of authorizations reached!