Public Helper Methods¶
This class stores some constants in order to expose certain important adobe aftereffects internal class names within python
AfterEffectsEngine(tk, context, engine_instance_name, env)¶
An After Effects CC engine for Shotgun Toolkit.
Engine instances are constructed by the toolkit launch process and various factory methods such as
Get the active project filepath.
Returns: The current project path or an empty string Return type: str
Save the project in place or to the given file-path
Parameters: path (str) – The target file path. optional.
Launch a Qt file browser to select a file, then save the supplied project to that path.
This returns a constant class that maps constants against adobe aftereffects internal class names.
Returns: AdobeItemTypes constants object. see
Return type: AdobeItemTypes
Indicates whether the given item is of the given AdobeItemType.
Indicating if the given item is of the given type
Helper getting the currently selected item in the after effects project
Returns: The active item Return type: adobe.ItemObject
Helper to query if an adobe-style render path is describing a sequence.
The sequencepath must contain one of the following patterns in order to be recognized:
### @@@ [###] %0xd
Parameters: path (str) – filepath to check Returns: True if the path describes a sequence Return type: bool
Helper to query if all render files of a given queue item are actually existing.
True if the path describes a sequence
Helper to iter safely through an adobe-collection item as its index starts at 1, not 0.
One may use this method like this:
item_collection = engine.adobe.project.items for item in engine.iter_collection(item_collection): print item.name
Parameters: collection_item (adobe.ItemCollectionObject) – the after-effects collection item to iter Yields: the next child item of the collection Return type: adobe.ItemObject
Yields all render-files and its frame number of a given after effects render queue item.
The path is needed to uniquely identify the correct output_module
2-item-tuple where the firstitem is the resolved path (str) of the render file and the second item the frame-number or None if the path is not an image-sequence.
Helper method to import footage into the current comp. This method contains logic to determine as what the given file-path may be imported (PROJECT, FOOTAGE, COMP etc.) To influence this logic you can implement the “import_footage_hook” for this engine. It will also collect all new items and return those in case the import leads to more than one (1) Item-objects to be imported.
Parameters: path (str) – filepath to be imported. Sequences should give either the first frame or the frames replaced by hashes (#), at (@) or the percent formatting (%04d) syntax. Returns: All new items that were imported Return type: list-of-adobe.CompItemObject
Helper method that adds the “best-matching” items from a given adobe.CollectionItem into a given CompItem. Where “best-matching” means, that the first CompItem found is added alternatively the first Footage item is added. In case the collection contains only FolderItems, this method will recurse into the folders until one ItemObject was found.
Indicating if an item was added or not.
renders a given queue_item, by disabling all other queued items and only enabling the given item. After rendering the state of the render-queue is reverted.
Parameters: queue_item (adobe.RenderQueueItemObject) – The render queue item to be rendered Returns: Indicating successful rendering or not Return type: bool
Parses the file name in an attempt to determine the first and last frame number of a sequence. This assumes some sort of common convention for the file names, where the frame number is an integer at the end of the basename, just ahead of the file extension, such as
file_001.jpg. We also check for input file names with abstracted frame number tokens, such as
Parameters: path (str) – The file path to parse. Returns: None if no range could be determined, otherwise (min, max) Return type: tuple or None