Public Helper Methods
- class python.tk_aftereffects.AdobeItemTypes[source]
This class stores some constants in order to expose certain important adobe aftereffects internal class names within python
- class engine.AfterEffectsEngine(tk, context, engine_instance_name, env)[source]
An After Effects CC engine for Shotgun Toolkit.
Engine instances are constructed by the toolkit launch process and various factory methods such as
start_engine()
.- Parameters:
- property project_path
Get the active project filepath.
- Returns:
The current project path or an empty string
- Return type:
- save(path=None)[source]
Save the project in place or to the given file-path
- Parameters:
path (str) – The target file path. optional.
- save_as()[source]
Launch a Qt file browser to select a file, then save the supplied project to that path.
- property AdobeItemTypes
This returns a constant class that maps constants against adobe aftereffects internal class names.
- Returns:
AdobeItemTypes constants object. see
AdobeItemTypes
- Return type:
- is_item_of_type(item, adobe_type)[source]
Indicates whether the given item is of the given AdobeItemType.
- Parameters:
item (adobe.ItemObject) – item to be checked.
adobe_type (str) – AdobeItemType-constant. One of the constants held by
AdobeItemTypes
- Returns:
Indicating if the given item is of the given type
- Return type:
- property selected_item
Helper getting the currently selected item in the after effects project
- Returns:
The active item
- Return type:
- is_adobe_sequence(path)[source]
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
- check_sequence(path, queue_item)[source]
Helper to query if all render files of a given queue item are actually existing.
- Parameters:
path (str) – filepath to check
queue_item (adobe.RenderQueueItemObject) – an after effects render queue item
- Returns:
True if the path describes a sequence
- Return type:
- iter_collection(collection_item)[source]
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:
- get_render_files(path, queue_item)[source]
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
- Parameters:
path (str) – filepath to iter
queue_item (adobe.RenderQueueItemObject) – an after effects render queue item
- Yields:
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.
- Return type:
- import_filepath(path)[source]
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
- add_items_to_comp(item_collection, comp_item)[source]
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.
- Parameters:
item_collection (adobe.ItemCollectionObject) – object to be analyzed
comp_item (adobe.CompItemObject) – comp that should receive the items from item_collection
- Returns:
Indicating if an item was added or not.
- Return type:
- render_queue_item(queue_item)[source]
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:
- find_sequence_range(path)[source]
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.0001.jpg
, orfile_001.jpg
. We also check for input file names with abstracted frame number tokens, such asfile.####.jpg
orfile.%04d.jpg
.