ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

animation path stroke

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Alfred Steineranimation path stroke
by on Jul 6, 2015 at 12:50:53 pm

Hey there,
I ve made animated a path in the way that i set the starting anchor point in the first keyframe then i took a step forward to the next frame and added another anchor point which is then keyframed and so on.
so the path grows from anchor point to anchor point in each keyframe.

now because the path is very long (about 3000 anchor points in the end of the animation) i need an automation for the following :
I want the path stroke to be only visible from most recent anchor point in the the keyframe i am in ( for example in keyframe number 10 ) 5 anchor points back. that means from anchor point 10 to 9, from 9 to 8, 8 to 7, 7 to 6 and 6 to 5.

so just for understanding when im at the 50th keyframe where i already have 50 anchor points set, in that keyframe i only want to see the last five lines also.
so that i get a construct of 5 lines in result.
I hope anyone gets what i mean and can help me out.
I cannot find anythin on google considering effects working with the anchor point numbers.

Does anyone know if/ how it is possible do? i think it should work with a script
but i dont know how to delete certain vertices via script

i got it to select the path somehow and i can get the vertices array ( in the var Verts ) but i dont know how to remove specific vertices in specific keyframes ...
var theComp = app.project.activeItem;
var theLayer = theComp.layer(1);
//var thePath = theComp.selectedProperties[0];
var myProperty = theLayer.content("Form 1").content("Pfad 1").property(2).value;

var Verts = theLayer.content("Form 1").content("Pfad 1").property(2).value.vertices;


best wishes,
Alfred Steiner


Return to posts index

Dave LaRondeRe: animation path stroke
by on Jul 6, 2015 at 5:44:21 pm

After Effects is designed so that you don't have to set keyframes for each an every frame.

And I don't think we're using the same standard terminology, either. A layer can only have ONE anchor point, but you can animate it. It's impossible to have more than 3,000 anchor points, but you CAN have more than 3.000 anchor point keyframes... and again, having 3,00 keyframes is overkill.

I'm also confused by your use of the tern, "stroke". The characters on a text layer can have a stroke. There is a Stroke effect. I THINK you're talking about an Animation Path, but I'm not sure.


You seem well versed in writing code, but seem to lack the basic concepts of using AE. I would recommend looking at the first few links you'll find here

http://blogs.adobe.com/aftereffects/2010/01/getting-started-with-after-eff....

I doubt it will take you very long at all, and you will learn the proper procedures for using AE and the ways in which AE differs from other applications... which is a very valuable thing indeed.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Alfred SteinerRe: animation path stroke
by on Jul 7, 2015 at 9:23:36 am
Last Edited By Alfred Steiner on Jul 7, 2015 at 9:29:46 am

thank you for answering.

I just reformulate it quickly as good as I can.

I just clicked on the pen tool then I set the first anchor point in the first frame, then i went to the next frame to set the next anchor point and so on.

I made some screenshots to clear things up, the text in there is irrelevant now.


--------------------------------------------------------------

now what i meant with "path stroke" is whats seen in the right of this image here :

now if you look at the first picture i put in here, you can see 4 anchor points in the rightmost block.
i didnt set up a stroke for the image. but what i want is that in the

only the last 2 (or any number) lines or path segments are visible.
so in this rightmost block (you see in the bottom of the image that i am in the fourth frame)
i only want to see the line from 4 to 3 and from 3 to 2.

-this can be done either by manually deleting all points you dont want to have in every keyframe
(that is not possible in my case)

the second option could be drawing a path stroke not from a start in % to an end in % as usually but
somehow from the last point to the two anchor points which where made right befor the last one.
(as i described)

the third thing i think is most likely the solution but I need help to realize it.
I need a script which goes through all frames and in each frame through all path anchor points and then
it just deletes the anchor points which i dont want to see .
(therefore you must know that i changed an option in the general settings of after affects which is called somewhat like "keep constant anchorpoint number in mask edit" or so in english).
this allows to change the path completely in the keyframes without changing the number of anchor points in the keyframes before if you know what i mean.


the problem is how to do the deleting of those single points via script.

this sounds actually much more complicated like it is.

kind regards,
Al Steiner


Return to posts index


Dave LaRondeRe: animation path stroke
by on Jul 7, 2015 at 5:23:56 pm

I see that you're using a Shape Layer. Are you trying to put a stroke on a shape layer? You can limit the length of the stroke using the strokey layer controls. You don't need a script to do it.

And I STILL think you need to learn how After Effects really works, and not how you THINK it works.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Alfred SteinerRe: animation path stroke
by on Jul 8, 2015 at 12:45:26 am

Well i just got it finally via the following script.

Sadly i didnt found any good reference on the net...

I dont know how to know which properties my objects have and how to refer to them right.
anyways i tried and errored it :

var theComp = app.project.activeItem;
var theLayer = theComp.layer(1);
var thePath = theLayer.property("ADBE Root Vectors Group").property("ADBE Vector Group").property("ADBE Vectors Group").property("ADBE Vector Shape - Group").property("ADBE Vector Shape");
var theKeys = thePath.selectedKeys;


var myProperty = 0;
var Verts = 0;
var myShape = 0;

var theKeyTime = 0; // holds the time in seconds of a specific Frame later

var Lines = parseInt(prompt("Enter Line Number:"));
var spliceStart = Verts.length - (Lines+1); // + 1 because a line always consists of two points and the first line offers the first point for the second...

for (var i = 1; i <= thePath.numKeys; i++) {
theKeyTime = theLayer.content("Form 1").content("Pfad 1").property(2).keyTime(i); // the time in seconds at which the specific keyframe happens
myProperty = theLayer.content("Form 1").content("Pfad 1").property(2).valueAtTime(theKeyTime,true);
Verts = myProperty.vertices;
spliceStart = Verts.length - (Lines+1);

if (Verts.length > (Lines+1)) { // if there are already more lines then var Lines defined.
// modify Shape
myShape = 0;
myShape = new Shape();
myShape.closed = false;
myShape.vertices = Verts.splice(spliceStart,(Lines+1));
thePath.setValueAtKey(i,myShape);
}
}


Thanks for your help.

best wishes -
Alf


Return to posts index

Michael SzalapskiRe: animation path stroke
by on Jul 8, 2015 at 5:20:55 pm

Why not just draw the full path with a few clicks of the mouse and animate the stroke properties of the shape layer over time to show the parts you need?
Or, heck, put a mask on a solid layer and use the Vegas effect?

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index


Alfred SteinerRe: animation path stroke
by on Jul 8, 2015 at 7:00:09 pm

please read what i wrote... i wrote that its about 3000 anchor points which should be exact lines.


Return to posts index

Michael SzalapskiRe: animation path stroke
by on Jul 8, 2015 at 7:13:13 pm

Well, if your mask/shape path has to have 3,000 exact points on it, my question still remains. You can just keyframe your stroke to follow it without writing any code.

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]