CompItem
Properties
null if the composition contains no enabled camera layers.false. This parameter doesn't do anything.displayStartTime and frameDuration to compensate for floating-point problems.true, Draft 3D mode is enabled for the Composition panel. This corresponds to the value of the Draft 3D button in the Composition panel.true, indicates that the composition uses drop-frame timecode. When false, indicates non-drop-frame timecode. This corresponds to the setting in the Composition Settings dialog box.duration of the mainSource object, and is read-only.00000000-0000-0000-0000-000000000000.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.true, frame blending is enabled for this Composition. Corresponds to the value of the Frame Blending button in the Composition panel.frameRate value (frames-per-second).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.time attribute, which uses seconds.orientationType, positionType, position. In After Effects (Beta) 26.5 and later, each entry also has color and pinned, and orientationType/positionType become GuideOrientationType/GuidePositionType enum values instead of raw integers.true, the AVItem has an audio component. In a CompItem, the value is linked to the composition.true, the AVItem has a video component. In a CompItem, the value is linked to the composition.true, only layers with shy set to false are shown in the Timeline panel. When false, all layers are visible, including those whose shy value is true. Corresponds to the value of the Hide All Shy Layers button in the Composition panel.Property.setAlternateSource(). Returns true if the item can be used, or otherwise false. A CompItem or a FootageItem can be used as an alternate source for the layer, with some restrictions: if the AVItem is a FootageItem, its FootageSource should not be a SolidSource; if it's a FootageItem whose FootageSource is a FileSource, that FileSource should not point to a non-media file (e.g. a JSX script file); setting the AVItem cannot create a cyclical reference within the project.true, motion blur is enabled for the composition. Corresponds to the value of the Motion Blur button in the Composition panel.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.app.project.rootFolder).true, the frame rate of nested compositions is preserved in the current composition. Corresponds to the value of the "Preserve frame rate when nested or in render queue" option in the Advanced tab of the Composition Settings dialog box.true, the resolution of nested compositions is preserved in the current composition. Corresponds to the value of the "Preserve Resolution When Nested" option in the Advanced tab of the Composition Settings dialog box.setProxy(), setProxyWithSequence(), setProxyWithSolid(), or setProxyWithPlaceholder().CompItem.renderers.[1, 1], half resolution is [2, 2], and quarter resolution is [4, 4]. The default is [1, 1].true, this item is selected. Multiple items can be selected at the same time. Set to true to select the item programmatically, or to false to deselect it.true, a proxy is used for the item. It is set to true by all the SetProxy methods, and to false by the SetProxyToNone() method.Instance Methods
addGuide
Returns: any
Since: 27.0
Adds a guide to the item's view and returns its index. Two forms: addGuide(orientationType, position) adds a pixel guide using an orientation and pixel position; addGuide(guideOptions) adds a guide described by a GuideOptions object (After Effects (Beta) 26.5+).
applyPreset
Returns: boolean
Since: 27.0
Applies the specified animation preset to all the currently selected layers in this composition. If no layer is selected, it applies the animation preset to a new solid layer.
Parameters
duplicate
Returns: CompItem
Since: 27.0
Creates and returns a duplicate of this composition, which contains the same layers as the original.
exportAsMotionGraphicsTemplate
Returns: boolean
Since: 27.0
Exports the composition as a Motion Graphics template. Returns true if the Motion Graphics template is successfully exported, otherwise false. The name in the Essential Graphics panel is used for the file name of the Motion Graphics template. Use the motionGraphicsTemplateName attribute to set the name. Optionally specify the path to the folder where the Motion Graphics template file is saved; if not specified, it saves to the current user's Motion Graphics Templates folder. If the project has been changed since the last save, After Effects will prompt the user to save it - use the project save() method first to avoid this.
Parameters
getGuideAsObject
Returns: { orientationType: GuideOrientationType; position: number; positionType: GuidePositionType; color: number[]; pinned: boolean }
Since: 27.0
Returns the guide at the specified index as a GuideOptions object, which you can modify and pass back to setGuide(). This is a convenient way to read a guide's full state (orientation, position, position type, color, pinning).
Parameters
getMotionGraphicsTemplateControllerName
Returns: string
Since: 27.0
Gets the name of a single property in the Essential Graphics panel.
Parameters
getRenderGUID
Returns: DeferredCall
Since: 27.0
Asynchronously computes a GUID that uniquely identifies the rendered state of this composition at the specified time, useful for detecting whether a frame's render output has changed. Returns a DeferredCall that resolves to a 36-character GUID string.
Parameters
ProjectThread enum value specifying which thread to perform the computation on.layer
Returns: Layer
Since: 27.0
Returns a Layer object, which can be specified by name, an index position in this layer, or an index position relative to another layer.
Parameters
[1..numLayers] - or a Layer object in this composition (used with relIndex) - or the name of the desired layer as a string.otherLayer. This value is added to the otherLayer value to derive the absolute index of the layer to return.openInEssentialGraphics
Returns: boolean
Since: 27.0
Opens the composition in the Essential Graphics panel.
openInViewer
Returns: Viewer
Since: 27.0
Opens the composition in a Composition panel, and moves the Composition panel to front and gives it focus.
remove
Returns: boolean
Since: 27.0
Deletes this item from the project and the Project panel. If the item is a FolderItem, all the items contained in the folder are also removed from the project. No files or folders are removed from the disk.
removeGuide
Returns: boolean
Since: 27.0
Removes an existing guide. Choose the guide based on its index inside the Item.guides array.
Parameters
saveDraftFrameToPng
Returns: DeferredCall
Since: 27.0
Renders the frame at the specified time using a draft-quality render and saves it as a PNG file. Returns a DeferredCall that resolves once the file has been written.
Parameters
saveFrameToPng
Returns: DeferredCall
Since: 27.0
Renders the frame at the specified time and saves it as a PNG file. Returns a DeferredCall that resolves once the file has been written.
Parameters
setGuide
Returns: any
Since: 27.0
Updates an existing guide. Two forms, distinguished by the type of the second argument: setGuide(position, guideIndex) moves the guide at guideIndex to a new pixel position; setGuide(guideIndex, guideOptions) applies the properties set on a GuideOptions object to the guide at guideIndex (partial update, After Effects (Beta) 26.5+). The two forms take their arguments in the opposite order.
setMotionGraphicsControllerName
Returns: boolean
Since: 27.0
Sets the name of a single property in the Essential Graphics panel.
Parameters
setProxy
Returns: boolean
Since: 27.0
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 parameters, instead using the user preferences.
Parameters
setProxyToNone
Returns: boolean
Since: 27.0
Removes the proxy from this AVItem, sets the value of proxySource to null, and sets the value of useProxy to false.
setProxyWithPlaceholder
Returns: boolean
Since: 27.0
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 preferences.
Parameters
setProxyWithSequence
Returns: boolean
Since: 27.0
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.
Parameters
true, use the "Force alphabetical order" option.setProxyWithSolid
Returns: boolean
Since: 27.0
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.