如何使用標記和javascript標記分割After Effects中的圖層,extendscript?

[英]How to split layer in After Effects using marker of markers and javascript, extendscript?


I am trying to split layer in After Effects using extendscript. First of all, i want get the time value of the marker. Then i want set the Timeline cursor on necessary point on the Timeline. And finally i'll split layer to pieces.

我正在嘗試使用extendscript在After Effects中拆分圖層。首先,我想獲得標記的時間值。然后我想將時間軸光標設置在時間軸上的必要點上。最后我會分層次地分裂。

How did this in javascript? Maby you know how get time parameter from marker and then use this value to shift Timeline cursor from necessary position?

這是怎么回事? Maby你知道如何從標記獲取時間參數然后使用此值將時間軸光標從必要位置移位?

Or you know other way how do it?

或者你知道其他方式怎么做?

2 个解决方案

#1


1  

The easiest way would be to duplicate the layer:

最簡單的方法是復制圖層:

var newLayer = myLayer.duplicate();

Then set the inPoint of that layer to the marker time:

然后將該圖層的inPoint設置為標記時間:

newLayer.Inpoint = myLayer.property("Marker").keyTime(<index of marker>)

And the outPoint of the original layer:

和原始圖層的outPoint:

myLayer.Outpoint = myLayer.property("Marker").keyTime(<index of marker>);

Then if you need to set the comp time to the marker time just use the time property of the comp object (I'm assuming here that there's a variable called myComp which is set to the comp object, eg var myComp = app.project.activeItem):

然后,如果你需要將comp時間設置為標記時間,只需使用comp對象的time屬性(我假設這里有一個名為myComp的變量,它被設置為comp對象,例如var myComp = app.project。 activeItem):

myComp.time = myLayer.property("Marker").keyTime(<index of marker>);

Before you spend too much more time trying to nut this out, it's worth downloading the After Effects Scripting Guide (I realise it says CS6, it's the most up-to-date version there is as of 2017), and if you want GUI fun also get the Javascript Tools Guide

在你花費太多時間試圖解決這個問題之前,值得下載After Effects腳本指南(我意識到它說的是CS6,它是2017年最新的版本),如果你想要GUI的樂趣還可以獲得Javascript工具指南

#2


1  

There is no need of markers for spliiting the layer.Just you have to duplicate the layers and make the use of intime and outtime and set them accordingily.For the splitting of between layer the original will be splitted to the required three layers or portions. So I have given the :

不需要標記來旋轉圖層。只需要復制圖層並使用實時和停機時間並根據它們進行設置。對於圖層之間的分割,原始圖像將被分割為所需的三個圖層或部分。所以我給了:

var portions =3;

You can make the use of inPoints and outPoints to mark the interval for the layer for splitting :

您可以使用inPoints和outPoints來標記要拆分的圖層的間隔:

var sliceTime = 15.0; //give the end time for the part of layer)
var origOutPoint = layer.outPoint;
comp.time = sliceTime;
while (portions > 1) {
    var d = layer.outPoint - sliceTime;
    dupeLayer = layer.duplicate();
    layer.outPoint = dupeLayer.inPoint = sliceTime;

    sliceTime = 20.0;
    portions--;
    layer = dupeLayer;
}

Hope this might help you.

希望這可能對你有所幫助。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2017/01/19/72f0f90df77dff49dca7541ac441c211.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com