Copy link to clipboard
Copied
Hello,
I have an animation that is of someone walking in an sitting down. Imagine a 'J' type motion path that auto-orients a person to the path - so that they are looking where they are going. When the person gets to his seat, I would like the rotate that person so that they are looking at the stage. I have about 30 people that I need to do this with, so, instead of manually rotating I would like to have a script that does this.
Imagine walking into a play and going to your seat. You have to turn to sit in your seat. This is what I'm looking to do.
Bonus if you can tell me how to, at the end of the motion path, I can break out of a loopout() and go to the next frame to get into the sitting pose.
Thanks
Kevin
- edit -
I'm new to After Effects scripting, but not javascript syntax. Any resources to learn would be awesome.
If you have Auto-Orientation set to Orient Along Path and the motion path is ending as shown then all you have to do is add two rotation keyframes to the person waling layer.
If you need the person to turn to face the stage and then move back to the seat then you should add a null, parent the layer to the null, set the null to Orient Along Path, turn off Auto-Orientation for the person walking layer use the Null to move the person, then add the rotation keyframes, then animate the position of
...Copy link to clipboard
Copied
It would really help if we knew how you setup your animation. Are the layers 2D? Are you using Puppet Pina? Character Animator? A layered PSD or AI file?
If this were my project I would have separate body parts, point the head to a null using vector math in an expression, and have the body parts all parented to the torso and move the torso with a Null.
Show us a screenshot of what you have now with the modified properties of the layers that you are working with revealed. Select the layer, press 'uu' the take a screenshot an embed it in the forum so we understand your workflow. Somebody will then be able to point you to an efficient workflow.
Copy link to clipboard
Copied
Hello,
I understand what you are saying and thank you. Give me a minute to get all of this together. Your advice is much appreciated.
Copy link to clipboard
Copied
Below is what I'm working on. My end-goal is to illustrate how coronavirus can be spread in a crowd of people - like a church. I'll have someone 'infected' (to be outlined in red) spread the virus to others (visible particles of COVID and when they 'infect' someone, that person turns red). This is part of a larger presentation - but this is the most animation intensive. I plan on exporting this through Bodymoving and placing it on a website.
What I would like to do is have the characters walk in and sit down. But before a couple of them take their seats, they will meet and talk - as you would usually do in a church setting.
On the left, 2/3 is the animation that I'm working on. It's a top-view of the church. It's not the best, but I think it gets the point across. And that's the whole idea of this - to get the point across and keep it simple.
The right side is Illustrator with the characters I'm using as a base in After Effects that are brought to AE via Overlord. The only items on the character that is animated are the shoes. They simply move back and forth. Exciting, I know. When the characters get to their seat, which is at the end of the motion path, I would like for them to turn and face the front of the church. If I could place an expression that detects the end of the motion and has them turn to face the front, that would be great.
I do have a sitting position for the character so they can sit on a pew.
My end-goal is to illustrate how coronavirus can be spread in a crowd of people - like a church. Yes, I plan on adjusting design, this is just to get the animation down. Everything, so far, works as a little animation. I'm hoping to keep it this way.
This is part of a larger project regarding the spread of Covid including the structure, how it infects the body, and how it's distributed.
Copy link to clipboard
Copied
If you have Auto-Orientation set to Orient Along Path and the motion path is ending as shown then all you have to do is add two rotation keyframes to the person waling layer.
If you need the person to turn to face the stage and then move back to the seat then you should add a null, parent the layer to the null, set the null to Orient Along Path, turn off Auto-Orientation for the person walking layer use the Null to move the person, then add the rotation keyframes, then animate the position of the person walking layer to move it back to the seat. Something like this:
Trying to write an expression to keep everything on one layer is going to get complicated. You'll have to use the time of the last keyframe as the starting point for a rotation animation based on a linear method, throw in an extremely complex auto orient to motion path expression with an if statement, and then move the person walking back to their seat.
If the person walking layer is not going to get any more position keyframes then you could save an animation preset for just the rotation turn and apply it when you move the CTI to the last position keyframe. That would make all layers rotate the same direction.
If all of the person walking layers are going to have the same number of keyframes and they just stop then turn to the stage, and you want the ones on the top side of the aisle to rotate counter-clockwise and the ones below the center of the aisle to rotate clockwise, you could write an expression that would rotate the layers like this:
rStart = position.key(3).time;
t = time - rStart;
if (t < 0)
r = value + 0
else
r = linear(t, 0, .5, 0, 90)
if (transform.position[1] < height/2)
value - r
else
value + r
That should let you know how the expression works.
Copy link to clipboard
Copied
Hi Rick,
Thank you for the detailed explanation as this has been a great intro to scripting in After Effects. While I didn't use your exact code, I went through it, googled, and come up with something that applies to the changes in animation I have made. Thank you, sir!
I have more questions, but I'll post them in the main forum. I do appreciate your help - it has led me in the right direction!
Kevin