After_Effects_CS6_Scripting_Guide(AE脚本参考书)(7)

2019-04-14 10:37

After Effects scripting referenceAVItem object

31

AVItem duration attribute

app.project.item(index).durationDescription

Returns the duration, in seconds, of the item. Still footage items have a duration of 0.

?In a CompItem, the value is linked to the duration of the composition, and is read/write. ?In a FootageItem, the value is linked to the duration of the mainSource object, and is read-only.

Type

Floating-point value in the range [0.0..10800.0]; read/write for a CompItem; otherwise, read-only.

AVItem footageMissing attribute

app.project.item(index).footageMissingDescription

When true, the AVItem is a placeholder, or represents footage with a source file that cannot be found. In this case, the path of the missing source file is in the missingFootagePath attribute of the footage item’s source-file object. See “FootageItem mainSource attribute” on page66 and “FileSource missingFootagePath attribute” on page61.

Type

Boolean; read-only.

AVItem frameDuration attribute

app.project.item(index).frameDurationDescription

Returns the length of a frame for this AVItem, in seconds. This is the reciprocal of frameRate. When set, the reciprocal is automatically set as a new frameRate value.

This attribute returns the reciprocal of the frameRate, which may not be identical to a value you set, if that value is not evenly divisible into 1.0 (for example, 0.3). Due to numerical limitations, (1 / (1 / 0.3)) is close to, but not exactly, 0.3.

If the AVItem is a FootageItem, this value is linked to the mainSource, and is read-only. To change it, set the conformFrameRate of the mainSource object. This sets both the frameRate and frameDuration of the FootageItem.

Type

Floating-point value in the range [1/99.. 1.0]; read-only for a FootageItem, otherwise read/write.

31

After Effects scripting referenceAVItem object

32

AVItem frameRate attribute

app.project.item(index).frameRateDescription

The frame rate of the AVItem, in frames-per-second. This is the reciprocal of the frameDuration. When set, the reciprocal is automatically set as a new frameDuration value.

?In a CompItem, the value is linked to the frameRate of the composition, and is read/write.

?In a FootageItem, the value is linked to the frameRate of the mainSource object, and is read-only. To change

it, set the conformFrameRate of the mainSource object. This sets both the frameRate and frameDuration of the FootageItem.

Type

Floating-point value in the range [1.0..99.0]; read-only for a FootageItem, otherwise read/write.

AVItem hasAudio attribute

app.project.item(index).hasAudioDescription

When true, the AVItem has an audio component.

?In a CompItem, the value is linked to the composition. ?In a FootageItem, the value is linked to the mainSource object.

Type

Boolean; read-only.

AVItem hasVideo attribute

app.project.item(index).hasVideoDescription

When true, the AVItem has an video component.

?In a CompItem, the value is linked to the composition. ?In a FootageItem, the value is linked to the mainSource object.

Type

Boolean; read-only.

AVItem height attribute

app.project.item(index).heightDescription

The height of the item in pixels.

?In a CompItem, the value is linked to the composition, and is read/write.

32

After Effects scripting referenceAVItem object

33

?In a FootageItem, the value is linked to the mainSource object, and is read/write only if the mainSource

object is a SolidSource. Otherwise, it is read-only.

Type

Integer in the range [1...30000]; read/write, except as noted.

AVItem name attribute

app.project.item(index).name Description

The name of the item, as shown in the Project panel.

?In a FootageItem, the value is linked to the mainSource object. If the mainSource object is a FileSource, this

value controls the display name in the Project panel, but does not affect the file name.

Type

String; read/write.

AVItem pixelAspect attribute

app.project.item(index).pixelAspect Description

The pixel aspect ratio (PAR) of the item.

?In a CompItem, the value is linked to the composition. ?In a FootageItem, the value is linked to the mainSource object.

The value you retrieve after setting may be slightly different from the value you supplied. The following table compares the value as it appears in the UI with the more-accurate value returned by this attribute.

PAR in the After Effects UI0.9111.51.091.211.331.462

PAR returned by the pixelAspect attribute0.9090909090909111.5

1.094017094017091.212121212121211.333333333333331.458689458689462

Type

Floating-point value, in the range [0.01..100.0]; read/write.

33

After Effects scripting referenceAVItem object

34

AVItem proxySource attribute

app.project.item(index).proxySource Description

The FootageSource being used as a proxy. The attribute is read-only; to change it, call any of the AVItem methods that change the proxy source: setProxy(), setProxyWithSequence(), setProxyWithSolid(), or setProxyWithPlaceholder().

Type

FootageSource object; read-only.

AVItem setProxy() method

app.project.item(index).setProxy(file)Description

Sets a file as the proxy of this AVItem. Loads the specified file into a new FileSource object, sets this as the value of the proxySource attribute, and sets useProxy to true. It does not preserve the interpretation param-eters, instead using the user preferences. If the file has an unlabeled alpha channel, and the user preference says to ask the user what to do, the method estimates the alpha interpretation, rather than asking the user. This differs from setting a FootageItem's main source, but both actions are performed as in the user interface.

ParametersfileReturns

An ExtendScript File object for the file to be used as a proxy.

None.

AVItem setProxyToNone() method

app.project.item(index).setProxyToNone()Description

Removes the proxy from this AVItem, sets the value of proxySource to null, and sets the value of useProxy to false.

Parameters

None.

Returns

Nothing.

34

After Effects scripting referenceAVItem object

35

AVItem setProxyWithPlaceholder() method

app.project.item(index).setProxyWithPlaceholder(name, width, height, frameRate, duration)Description

Creates a PlaceholderSource object with specified values, sets this as the value of the proxySource attribute, and sets useProxy to true. It does not preserve the interpretation parameters, instead using the user prefer-ences.

NOTE: There is no direct way to set a placeholder as a proxy in the user interface; this behavior occurs when a proxy has been set and then moved or deleted.

Parametersnamewidth, heightframeRatedurationReturns

A string containing the name of the new object.

The pixel dimensions of the placeholder, an integer in the range [4..30000].The frames-per-second, an integer in the range [1..99].

The total length in seconds, up to 3 hours. An integer in the range [0.0..10800.0].

Nothing.

AVItem setProxyWithSequence() method

app.project.item(index).setProxyWithSequence(file, forceAlphabetical)Description

Sets a sequence of files as the proxy of this AVItem, with the option of forcing alphabetical order. Loads the specified file sequence into a new FileSource object, sets this as the value of the proxySource attribute, and sets useProxy to true. It does not preserve the interpretation parameters, instead using the user preferences. If any file has an unlabeled alpha channel, and the user preference says to ask the user what to do, the method estimates the alpha interpretation, rather than asking the user.

Parametersfile

forceAlphabeticalReturns

An ExtendScript File object for the first file in the sequence.When true, use the “Force alphabetical order” option.

Nothing.

AVItem setProxyWithSolid() method

app.project.item(index).setProxyWithSolid(color, name, width, height, pixelAspect)Description

Creates a SolidSource object with specified values, sets this as the value of the proxySource attribute, and sets useProxy to true. It does not preserve the interpretation parameters, instead using the user preferences.

35


After_Effects_CS6_Scripting_Guide(AE脚本参考书)(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:新视野大学英语4课后翻译答案1-8单元

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: