0
我試圖在After Effects中爲跟蹤系統開發一個簡單的腳本。在After Effects腳本中記錄對象的x和y位置
Basicaly我需要在文件中的動畫中打印對象的x和y位置。像x,y和時間戳。
贊:
120; 130; 1000; --- 120 x,130 y和1000 ms 130; 160; 2000; --- 130 x,160 y和2000 ms
任何想法?
謝謝
我試圖在After Effects中爲跟蹤系統開發一個簡單的腳本。在After Effects腳本中記錄對象的x和y位置
Basicaly我需要在文件中的動畫中打印對象的x和y位置。像x,y和時間戳。
贊:
120; 130; 1000; --- 120 x,130 y和1000 ms 130; 160; 2000; --- 130 x,160 y和2000 ms
任何想法?
謝謝
您可以通過訪問位置屬性來獲取對象的位置。
見After Effects Scripting Guide
var currTime = 1; // calculated in seconds
var preExpression = true;
var xy = app.project.item(index).layer(index).transform.position.valueAtTime(currTime, preExpression); // returns an array of 2 or 3 [x,y,z]
要寫入數據到文件,你可以這樣做:
var randomname = Number(new Date());
var filepath = "~/Desktop/" + randomname + ".txt";
var outfile = File(filepath);
outfile.open('a');
if (outfile !== '') {
outfile.writeln("Hello I'm an appended line!");
outfile.close();
}
看看到ExtendScript工具包的幫助部分,也許我wiki。
謝謝。它工作得很好:) –
如果你接受答案會很好 – fabianmoronzirfas
我想我做到了,不是嗎? –