Benoit Kergosien
Forum Replies Created
-
What I’m doing wrong here ?
The increment doesn’t work properly, it only stores the first marker in my array.
Thanks.
Benoit
var arrayMarker=[];
m=marker;
if (m.numKeys>1){
for (i=1; i<=m.numKeys; i++){
arrayMarker.push(m.key(i).comment);
arrayMarker[0];// test if expression works, it only managed with the first marker ie [0]
}
}
else
{
value;
}
-
Thank you so much for your patience Dan.
I will try to complete the code during the weekend.
Wish me good luck!Benoit
-
Hi Dan,
I exploded my brains out and tried to follow your advices… unsuccessfully!
Here is the best I can do right now.
Please correct my mistakes!
Benoit
layerMarker=thisLayer.marker;
nextMarker="";
maxMarker=layerMarker.numKeys;
nearMarker= layerMarker.nearestKey(time).index;
nearMarkerTime=layerMarker.key(nearMarker).time;if (layerMarker.key(nearMarker)<=1 || time>= layerMarker.key(maxMarker));{
// I tried something to limit the search of markers who doesn't exist but I'm stuck as you can see.
}
else
{
if ( nearMarkerTime<time){
nextMarker=layerMarker.key(nearMarker+1);
}
else
{
nextMarker=layerMarker.key(nearMarker-1);
}
} -
I didn’t miss your edit but it appears it isn’t working.
For linear changes I did the following:
v1=10;
TOKYO=thisComp.marker.key("TOKYO")
t1=TOKYO.time;
nextMarkerTOKYO=TOKYO.index+1;
v2=50;
t2=thisComp.marker.key(nextMarkerTOKYO).time;
delay=1;
linear(time,t1+delay,t2,v1,v2)it does the job for one linear change but to apply this to all my markers I need an expression which increment marker’s index and retreive value linked to comment (in an array?).
ex: marker TOKYO=10 , marker PARIS=50, marker LONDON = 25, etc…Tell me if you didn’t understand my process, it’s a bit tricky because markers’s order isn’t final.
Benoit
-
Hi Dan,
Thanks for your trick about parameters but I thought give the value on a slider control to be more flexible.
Furthermore
parseFloat(marker.key("Tokyo").parameters["value"])
returns a ” no property or method called ‘value’ ”
What’s wrong?Did you have a clue about the linear changes between values?
Thanks again.
Benoit
-
Wow… It was so obvious, I can’t believe that I didn’t try it!
Thank you Dan.In addition, I’ve got some trouble to give value to my markers referencing them with comments.
For example I want that my marker wich comment is “TOKYO” returns a value of 10, the value needs to be hold from the marker’s time until the next marker minus a delay. Then 10 goes linearly to the value returned by the next marker at the next marker’s time, and so on…
Do I need to put all the values associated to the comments in a array or such thing like that? For the changes between values I try some Conditionnal statements without success (only the first works).
Thanks for your help!
Benoit
-
Hello Camille,
Did you try the script rd: Composition Setter by Jeff Almasol?
https://www.redefinery.com/xae/view.php?item=rd_CompSetterBenoit
-
Benoit Kergosien
June 21, 2014 at 11:45 pm in reply to: Access to the time and the duration of value.Hey Dan!
Thanks for your consideration.
I simplify my code as you suggest but for the complicated treshold i’m a bit overwhelmed. I understand what you point but to transform the idea into an expression I’m afraid that I need more help.
I updated my project file if you have time to take a look.
7656_squaredirectionv2.aep.zip
Benoit
-
Hello,
I’m trying to achieve the same thing than James except that I’m a complete beginer in Scripting!
Could you tell me all the code’s steps to realise such a script? And if it’s not too much to ask, please could you comment it, I would gladly appreciate to understand what I would write.
Benoit.