Page 1 of 1

Onion skin

Posted: December 16th, 2007, 2:51 pm
by SFR75
To make onion-skin in After Effects.
For example you have a layer with mask animation.
When you run a script it duplicates the layer twice and shifts one layer a keyframe left and the other keyframe right. Then it puts both duplicate copies in mode Multiply and opacity 50.
So on the screen you see previous and next position.
How about that ? :)

I do it manually sometimes, but if a script could take care of this, that would be really great :)

Posted: December 17th, 2007, 1:38 am
by Paul Tuersley
Give this a try:

Code: Select all

{
	var activeItem = app.project.activeItem;	
	// make sure a Comp is currently active
	if (activeItem == null || !(activeItem instanceof CompItem)){
			alert("Select one layer before running this script");
	} else {
		// make sure one layer is selected
		if (activeItem.selectedLayers.length != 1) {
				alert("Select one layer before running this script");
		} else {			
			var theLayer = activeItem.selectedLayers[0];
					
			// create duplicate layer, offset startTime by 1 frame, set blending mode, set opacity
			var theNewLayer = theLayer.duplicate();		
			theNewLayer.startTime = theNewLayer.startTime - activeItem.frameDuration;
			theNewLayer.blendingMode = BlendingMode.MULTIPLY;
			theNewLayer.opacity.setValue(50);
			
			// repeat for second duplicate
			theNewLayer = theLayer.duplicate();			
			theNewLayer.startTime = theNewLayer.startTime + activeItem.frameDuration;
			theNewLayer.blendingMode = BlendingMode.MULTIPLY;
			theNewLayer.opacity.setValue(50);		
		}
	}
}

Posted: December 17th, 2007, 5:11 am
by SFR75
Wow! :shock: Thanks!

Re: Onion skin

Posted: June 24th, 2013, 3:57 am
by Space Pumpkin
Hi
Question( couple of years later) where would this code go.
In the Position expression?

Cheers

Re: Onion skin

Posted: June 24th, 2013, 1:47 pm
by Paul Tuersley
It's a script, not an expression. So you'd save it as a txt file with a .jsx extension then run it using File > Scripts > Run Script File, or save it into the After Effects / Scripts folder, restart AE and run it by selecting it from the File > Scripts menu.

Paul

Re: Onion skin

Posted: April 3rd, 2014, 10:23 am
by jwiley20
That script is nice n'all but it doesn't really perform the function of onion skinning as needed for animation. I have a somewhat simple work around for onion skinning in After Effects. It involves duplicating the animated layer and then nesting a comp of itself within the original comp. You must pick-whip expressions between the attributes on the duped layer in the nested comp to the original attributes on the animating layer. You then apply the echo effect to that nested comp and adjust to preference.

Well an image is worth a thousand words as they say:
http://snk.to/f-cd1nlhpz

Here's the AE file as well (It's CC):
http://snk.to/f-ctjl43fn

This awesome script helps to automate the linking through expressions process:
http://aescripts.com/duplicate-with-connections/