Expressions for Sabre plugin

Scripting for After Effects

Expressions for Sabre plugin

Postby CopilotFan7 on 05/4/2016, 5:36 am

Hi everyone,

I'm trying to take some of the pain out animating sabre by hand. I've done the following:

Motion tracked sabre handle
Applied tracking to null
Patented sabre start to null
Patented sabre end to null

Of course, this gives me no sabre because start and end are at the same position.

Can you please tell me what I can do so that end is at a specific offset from the null? That is, so that it continues to track the light sabre handle but is, say, 200px long (and thus visible), vs 0 px long.

If there is a way to animate the end position as an offset from the null (to account for angle change, etc.) That would be great, too!

Thanks so much for your help.
CopilotFan7
 
Posts: 44
Joined: 08/3/2013, 2:32 pm

Re: Expressions for Sabre plugin

Postby star+circle on 05/4/2016, 7:11 am

You can't do it from a single tracking point, but if you track the top AND the bottom ends of the handle, then you can derive the saber tip position with a third null using this position expression for the third Null:

Code: Select all
mult=5;
thisComp.layer("Null 1").transform.position+ (thisComp.layer("Null 1").transform.position-thisComp.layer("Null 2").transform.position)*mult


Where Null 1 is at the handle top, Null 2 is at the handle bottom.

The variable "mult" sets the length of the saber in relation to the lenght of the handle
star+circle
 
Posts: 745
Joined: 12/6/2014, 3:07 pm
Location: Finland

Re: Expressions for Sabre plugin

Postby CopilotFan7 on 05/4/2016, 10:14 am

Thank you very much, Star+Circle. Unfortunately when I had initially tried to track rotation I found I wasn't able to get a very good track on the bottom of the handle.

Is there no way you know of to specify the sabre end point as, say, 500 pixels and 45 degrees from the start point I'd tracked?
CopilotFan7
 
Posts: 44
Joined: 08/3/2013, 2:32 pm

Re: Expressions for Sabre plugin

Postby Duncan on 05/4/2016, 10:32 am

Duplicate the null with the tracking information.

Parent the Core Start to one null's position, and the Core End to another Null's position.

On the Core End null, select the word "Position" to highlight all the keyframes. Then scrub the X and Y values to your desired position.

This will adjust all the key frames over to the new distance you set.

Doing it this was you will be locking yourself into a set distance and angle. I tried parenting to another null, but this creates an issue where the beam shoots off on one side.

If you want control, you'd probably be best off animating the end position manually.
Duncan
 
Posts: 325
Joined: 01/30/2013, 3:36 pm

Re: Expressions for Sabre plugin

Postby CopilotFan7 on 05/5/2016, 6:28 am

Thank you very much, Duncan, that did the trick!

Lesson learned, I'm going to make sure to use sticks of some kind next time and use sabre over it.
CopilotFan7
 
Posts: 44
Joined: 08/3/2013, 2:32 pm


Return to After Effects Expressions