• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Split layer

Contributor ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

In After effects there is a layer splitting function. Sometimes it is very practical for example for character arms, to make the change of depth and it is necessary to create a new upper layer to place the frames that continue. I have created a command with the history, but, the layer must be selected properly and the pasting must be more concrete. I share the video of what I am really looking for.

 

an.getDocumentDOM().getTimeline().copyFrames();

an.getDocumentDOM().getTimeline().addNewLayer();

an.getDocumentDOM().getTimeline().convertToBlankKeyframes();
an.getDocumentDOM().getTimeline().pasteFrames();



https://youtu.be/UnLDqlCEKUA


____
2D vector animator since 2000 & PhD
TOPICS
Timeline

Views

255

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 16, 2022 Jun 16, 2022

Copy link to clipboard

Copied

If this is a feature request, I'd vote for it.

 

Although, rather than call it Split Layer based on After Effects, how about "Duplicate selected Frames to New Layer"?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 17, 2022 Jun 17, 2022

Copy link to clipboard

Copied

Hi,

Assign to this command some handy keyboard shortcut and enjoy 🙂

(function(){
			
	var doc = fl.getDocumentDOM();

	if( ! doc ){
		alert( "No document open." );
		return;
	}
	
	var tml = doc.getTimeline();
	var sel = tml.getSelectedFrames();
	
	if( sel.length != 3 ){
		alert( "Make a contiguous selection on one layer in the timeline." );
		return;
	}
	
	var myLayer = tml.layers[ sel[0] ];
	
	if( myLayer.layerType === "folder" ){
		alert( "Select a non-folder layer." );
		return;
	}
	
	var startFrame = sel[1], endFrame = sel[2];
	var newLayerName;
	
	// Change this to "move" if you want to move the frames instead of copy them.
	var action = "copy";

	if( action === "copy" ){
		tml.copyFrames( startFrame, endFrame );
		newLayerName = "Copy of " + myLayer.name + " ( "+ (startFrame+1) + "-" + endFrame + " )";
	}else if( action === "move" ){
		tml.cutFrames( startFrame, endFrame );
		newLayerName = "Moved from " + myLayer.name + " ( "+ (startFrame+1) + "-" + endFrame + " )";
	}
		
		
	tml.addNewLayer( newLayerName );
	tml.convertToBlankKeyframes( startFrame, endFrame );
	tml.pasteFrames( startFrame, endFrame );

})();

 

 

 

 

- Vlad: UX and graphic design, Flash user since 1998
Member of Flanimate Power Tools team - extensions for character animation

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 19, 2022 Jun 19, 2022

Copy link to clipboard

Copied

Amazing!!!

Thanks!!!


____
2D vector animator since 2000 & PhD

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 20, 2022 Jun 20, 2022

Copy link to clipboard

Copied

LATEST

I have added a label to the frames to which the command is applied, to avoid confusion.

 

an.getDocumentDOM().getTimeline().setFrameProperty('name', 'Split');

(function(){

var doc = fl.getDocumentDOM();

if( ! doc ){
alert( "No document open." );
return;
}

var tml = doc.getTimeline();
var sel = tml.getSelectedFrames();

if( sel.length != 3 ){
alert( "Make a contiguous selection on one layer in the timeline." );
return;
}

var myLayer = tml.layers[ sel[0] ];

if( myLayer.layerType === "folder" ){
alert( "Select a non-folder layer." );
return;
}

var startFrame = sel[1], endFrame = sel[2];
var newLayerName;

// Change this to "move" if you want to move the frames instead of copy them.
var action = "copy";

if( action === "copy" ){
tml.copyFrames( startFrame, endFrame );
newLayerName = "Copy of " + myLayer.name + " ( "+ (startFrame+1) + "-" + endFrame + " )";
}else if( action === "move" ){
tml.cutFrames( startFrame, endFrame );
newLayerName = "Moved from " + myLayer.name + " ( "+ (startFrame+1) + "-" + endFrame + " )";
}


tml.addNewLayer( newLayerName );
tml.convertToBlankKeyframes( startFrame, endFrame );
tml.pasteFrames( startFrame, endFrame );

})();

an.getDocumentDOM().getTimeline().setFrameProperty('labelType', 'name'); an.getDocumentDOM().getTimeline().setFrameProperty('name', '');


____
2D vector animator since 2000 & PhD

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines