Page 1 of 1

Expressions for Sabre plugin

PostPosted: 05/4/2016, 5:36 am
by CopilotFan7
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.

Re: Expressions for Sabre plugin

PostPosted: 05/4/2016, 7:11 am
by star+circle
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
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

Re: Expressions for Sabre plugin

PostPosted: 05/4/2016, 10:14 am
by CopilotFan7
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?

Re: Expressions for Sabre plugin

PostPosted: 05/4/2016, 10:32 am
by Duncan
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.

Re: Expressions for Sabre plugin

PostPosted: 05/5/2016, 6:28 am
by CopilotFan7
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.