Move layers to layer marks

What type of scripts do you need?

Moderator: byronnash

Post Reply
jeffedit
Posts: 1
Joined: June 4th, 2007, 5:22 pm

I'm sure this is feasible, but clearly above me:
I do a lot of see and say lists...vo says it, type comes on screen. I will preview audio on a layer and drop marks at each point that the text line should come on. All the marks are on one layer. I use a script to import a csv list and create a comp layer for each line of text. Is there a script that I can program so that after I drag all the text layers into the comp (same start point, say the first mark), it will then line up each subsequent layer with the next mark, similar to the keyframe assistant "sequence layers"?
Any help appreciated. TIA
Jeff
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I'm not aware of an existing one but that doesn't sound too hard to do. You can access an array of the markers and then shift the layer startTime to the keyTime property of each marker.
nab
Posts: 203
Joined: November 29th, 2005, 3:00 am
Location: Royan
Contact:

a very basic script could be like this:
(assuming the first layer has the markers on it, layers below have to be shifted according to the marker keys time)

Code: Select all

{
	var myComp = app.project.activeItem;
	if (myComp == null || !(myComp instanceof CompItem))
		alert("No active composition");
	else if (myComp.numLayers < 2)
		alert("At least two layers are required.");
	else
	{
		var markerLayer = myComp.layer(1);
		var markerGroup = markerLayer.Marker;
		var iter = Math.min(markerGroup.numKeys,myComp.numLayers);
		
		app.beginUndoGroup("markersToStartTimeDemo.jsx");
		for (var i = 1; i < iter; i++)
		{
			var curTime = markerGroup.keyTime(i);
			myComp.layer(myComp.numLayers - i + 1).startTime = curTime;
		}
		app.endUndoGroup();
	}	
}
Post Reply