Aaron Asch
Forum Replies Created
-
Dan you are the man. That little change fixed the error. The code is now error free!! I set up a quick test and it seems to be working just fine using the Legacy ExtendScript. So thank you immensely for that!! And yes, I had to dig out an old machine that happened to have 6.5 on it to open the projects as well.
Thanks once again for all of your help both in the past and now. You have been an indispensable asset to this community for a very long time. I genuinely appreciate what you do.
-
Hi Dan, thanks for the quick response. Indeed that is some old code!! But brilliant none-the-less. As I figured, it was simply out dated. I’ve used it to great effect in the past and now need it again for a current project. It’s always so frustrating when things that used to work no longer do.
I tried plugging your new code in by itself, and also at the beginning of the original code. As I wasn’t sure how to place it. Both seemed to do the same thing. Everything shifted to the left. So that didn’t quite work.
Changing the project settings, however, did work for the old code. At least it appears to. I still get an error though. But now it’s a different one. This time at line 29 for both the POI and Position. It says “property or method named ‘time’ in Class ‘Property’ is missing or does not exist.” It’s weird because it says the expression has been disabled but I can still preview it. I’ll keep playing around with it to see if it gives me any other problems. Below are the original codes for the Position and POI. If there is a way to update these to achieve the same result with modern code that would be great!! If it’s too big of an ask, no worries. I can always keyframe!! Thanks again for all of your help.
Point of interest———————————————————————
pan_time = .5;
s = this_comp.layer(“POI Null”).effect(“Slider Control”).param(“Slider”);
n = s.num_keys;
if (n==0){ //check for no keyframes
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_world(L.anchor_point);
new_value = old_value;
percent = 1.0;
}
else if (n==1){
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_world(L.anchor_point);
L = this_comp.layer(s.key(1).value);
new_value = L.to_world(L.anchor_point);
percent = 0;
if (time > s.key(1).time+pan_time){
percent=1.0;
}
else{
percent = (time – s.key(1).time)/pan_time;
}
}
else if(time > s.key(n).time){
L = this_comp.layer(s.key(n-1).value);
old_value = L.to_world(L.anchor_point);
L = this_comp.layer(s.key(n).value);
new_value = L.to_world(L.anchor_point);
percent = 1.0;
if (time < s.time+pan_time){
percent= (time-s.key(n).time)/pan_time;
}
}
else if(time < s.key(1).time){
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_WORLD(L.anchor_point);
new_value = old_value;
percent = 1.0;
}
else{
j = n;
while(time<s.key(j).time){
j -= 1;
}
if(j==1){
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_world(L.anchor_point);
}
else{
L = this_comp.layer(s.key(j-1).value);
old_value = L.to_world(L.anchor_point);
}
L = this_comp.layer(s.key(j).value);
new_value = L.to_world(L.anchor_point);
percent = 1.0;
if (time < s.key(j).time+pan_time){
percent = (time-s.key(j).time)/pan_time;
}
}
ease(percent,old_value,new_value)
______________________________________Position—————————————————————————————–
pan_time = .5;
s = this_comp.layer(“Main Cam Null”).effect(“Slider Control”).param(“Slider”);
n = s.num_keys;
if (n==0){ //check for no keyframes
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_world(L.anchor_point);
new_value = old_value;
percent = 1.0;
}
else if (n==1){
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_world(L.anchor_point);
L = this_comp.layer(s.key(1).value);
new_value = L.to_world(L.anchor_point);
percent = 0;
if (time > s.key(1).time+pan_time){
percent=1.0;
}
else{
percent = (time – s.key(1).time)/pan_time;
}
}
else if(time > s.key(n).time){
L = this_comp.layer(s.key(n-1).value);
old_value = L.to_world(L.anchor_point);
L = this_comp.layer(s.key(n).value);
new_value = L.to_world(L.anchor_point);
percent = 1.0;
if (time < s.time+pan_time){
percent= (time-s.key(n).time)/pan_time;
}
}
else if(time < s.key(1).time){
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_WORLD(L.anchor_point);
new_value = old_value;
percent = 1.0;
}
else{
j = n;
while(time<s.key(j).time){
j -= 1;
}
if(j==1){
L = this_comp.layer(s.value_at_time(0));
old_value = L.to_world(L.anchor_point);
}
else{
L = this_comp.layer(s.key(j-1).value);
old_value = L.to_world(L.anchor_point);
}
L = this_comp.layer(s.key(j).value);
new_value = L.to_world(L.anchor_point);
percent = 1.0;
if (time < s.key(j).time+pan_time){
percent = (time-s.key(j).time)/pan_time;
}
}
ease(percent,old_value,new_value)