PT - OpenSesame Guide
PT - OpenSesame Guide
OpenSesame can also be used in conjunction with OpenSesame Server, a separate script that enables
fully automated project versioning and rendering workflows. aescripts.com/pt_opensesame-server
Step 1
Open the project you want to convert, run OpenSesame, select Export: Full Text Project and click Export
Project. A log file will be created listing any items that couldn't be exported (see 'Backwards compatible
project limitations' below).
NOTE: If you don't have the version of After Effects required to open the project you will need someone
that does to do this first step. Possibly you could ask the person you received the project from. They can
use the trial version of OpenSesame for this as there are no trial limitations when exporting.
Step 2
Launch your earlier version of After Effects (CS3 or later) and run OpenSesame. Click Import Project, then
choose the previously exported text file.
NOTE: Where possible OpenSesame stores absolute and relative file paths for footage used in a project
(relative to the exported project location). If importing on a different computer than was used for the
export, footage should still be relinked if it's in the same location relative to the project file.
If the text styles weren't imported correctly and you have both versions of AE on the same computer, you
can copy/paste the text styles (using the Text tool to select the text) from the original to the imported
project.
Troubleshooting
If the import stalls before completing there may be a problem when trying to import certain types of
footage. Click [?] to access the preferences and check the 'Don't import footage' option, then try
importing again.
If that doesn't help, locate the text file containing 'import failed on' in the name, open a support ticket at
aescripts.com/contact and send a copy of that file along with the main exported text file.
Trial limitations
The trial version of OpenSesame is limited so that effects aren't added to the imported projects. Remove
this limitation by purchasing a license at aescripts.com/pt_opensesame
Step 1
Run OpenSesame, select Export: Export List Only, then click 'Show Export List'. When exporting parts of a
project for external editing, you use the Export List to select the parts you want to edit.
Step 2
To export all the text in the project for editing, simply click the 'All Text' button. To export some of the
text either click 'All Text' first, then select the unwanted ones and use 'Remove Items' to remove them
from the list, or go through the project selecting the specific layers and use the add 'Selected Text'
button.
NOTE: Items that have been added to the Export List are flagged in the layer comments. You can restore
them to the Export List later by simply clicking the 'Load List' button.
Step 3
Use the options below the Export List to choose to export just the text contents or also the text styles
(Font, Font Size and Fill Color). Once that's done you can close the Export List window.
Step 4
Use the Format menu to choose the export format. You can export to either tab separated (.TSV) or
comma separated (.CSV) text file formats, both of which can be opened directly into a spreadsheet like
Excel for editing.
Step 5
Click the 'Export Project' button. You'll be asked to resave your project file and a text values file will be
created along with it, with the same name and "VALUES" at the end.
Step 6
Open the text VALUES file in either a text editor or spreadsheet app like Excel and edit the text as
required. Once completed, save the file in the same format. Save as many versions as you like, the naming
of the text file is not important.
Step 7
Run OpenSesame and click the Import Project button. Select the text file containing the edited text.
OpenSesame will open the original After Effects project and make the changes specified in the text file.
Compositions and footage items will display their respective CompID and FootageID values in the Export
List. These are After Effects' internal identifiers for the items and also what OpenSesame uses to identify
them in the text values file. Layers will display their layer number (#).
Add Script
Use this to add OpenSesame compatible helper scripts to your export. See the 'Helper scripts' section and
'Editing OpenSesame text files > Scripts section' for more information.
Before adding any helper scripts, I'd recommend adding any other project items first and sorting the list
by type. Helper scripts will be listed in the text file and applied in the order they are added (although you
can always edit this order in the text file manually). Helper scripts aren't saved with the template project,
so if you return to it later and use 'Load List' to restore the export list, you'll have to add the scripts again.
NOTE: When using the Export > Full Text Project option, helper scripts are the only items that can be
added to the Export List. All other aspects of the project will be included in the export anyway.
Remove Items
Select items in the Export List and use this button to remove them.
Load List
When an item is added to the Export List a flag is added to the comments in the project. If you reopen a
template project at a later date, you can restore the export list by simply clicking this button.
OpenSesame will scan through the project looking for those comments and add any flagged items to the
export list.
Sort
Items appear in the export list in the order that they're added. Use the Sort pulldown to sort them by type
or group them by composition. Use the Refresh option if you've made any changes to the project and
want to see those changes reflected in the export list.
Text
You can either choose to only export the actual text contents of text layers, or you can also export the
text styles, which will include Font, Font Size and Fill Color.
Layers
For layers you can export just the on/off switches for video (and audio if applicable), the layer times
(startTime, inPoint and outPoint) or both.
Properties
For properties you can export just the property values, or you can also export any expressions that might
be applied to them.
Footage
For footage you can choose to just export the absolute footage paths or you can also export relative
paths. Relative paths can only be generated if the footage is on the same volume as the exported project,
and the paths are relative to that location (stored in the Header section's FootageBase setting).
Export Project
Once you've added the items you want editable to the Export List, click "Export Project". You'll be asked
to resave your project file and a text values file will be created along with it, with the same name and
"VALUES" at the end.
If you are using relative paths to specify footage then ideally you should export to your Watch Folder
location. The FootageBase path at the beginning of the text file will be the path you export to and any
relative footage paths will be relative to that location.
Import Project
For OpenSesame, once you've edited the text file externally, use the “Import Project” button and select
the edited text file. OpenSesame will open the original After Effects project and make any changes
specified in the text file.
You can also use this for testing in advance of deploying with pt_OpenSesame Server.
Preferences
Text encoding
Set the text encoding format used to read/write text values files. See 'Additional topics > Text Encoding'
for more information.
Preserve commas / tabs
Tabs and commas that are used in text, comp names, layer names or footage will be encoded so they
don't cause problems in the tab or comma separated text file (see the Special Characters section). When
this 'Preserve' option is enabled, only the character that is being used as the separator will be encoded.
pt_OpenSesame Server
OpenSesame Server provides a fully automated API based solution for project customization, versioning
and rendering to generate content on demand, using either the JSON API for web apps or regular text
files that can be edited in a spreadsheet.
Set up any number of project templates and change many things including text, footage, property
values, layer switches and render queue items. Changes are made by submitting a text file to a watch
folder, whether that's across a network, from a mobile device, database or web app.
OpenSesame Server creates detailed log files, has built-in error handling, can automatically restart and
continue rendering or send alerts in case of any failures. You can abort renders remotely and easily
prioritize tasks.
Have multiple computers running OpenSesame Server to process and render submissions
simultaneously, or have one computer modify the projects and save them for processing on a render
farm. It's compatible with the After Effects Render Engine, so you can easily set up a render farm to
generate high volumes of content on demand.
Creating project templates
OpenSesame Server works in conjunction with a separate script called OpenSesame which you use to
prepare the project templates. aescripts.com/pt_opensesame
With OpenSesame it is possible to export an entire AE project to a text file, but that is primarily intended
to create backwards compatible projects by importing then (again using OpenSesame) into earlier
versions of After Effects. These text files are much larger, harder to edit and slower to import, so it's more
likely you'll want to export just the editable values. Both types of text file can be imported using
OpenSesame Server, but these instructions will assume you are using the "Export Editable Values" option.
Email Alerts
In the preferences you can set up email alerts to be notified when a text values file has been processed.
You can choose whether to receive an email alert for each import or only in cases where there was an
error.
To set this up, check 'Send Email Alerts' in the preferences, then click Configure to enter your mail server
and authentication settings. Use the option to send a test email to ensure it has been configured
correctly.
Logs
The built-in log panel displays a full record of when OpenSesame Server was launched, the watch mode
started/stopped, each processed submission and any issues not related to a specific submission (such as
losing network access to the watch folder).
Detailed logs are also created for each processed text file in the OpenSesame Logs folder. The default log
folder location is inside your chosen watch folder but there is a preference that lets you choose an
alternate location for it.
A new subfolder will be created for each text file that is processed, named based on the date and time it
started being processed, along with the name of the text file. i.e. 2014-06-17 09-08-33 test1 VALUES.
The log file starts with the name of the computer that is processing it, followed by the path and name of
the text file being processed. If there are any errors during the import and processing of changes they will
be written to the log.
If OpenSesame Server is set to render the revised project, the rest of the log file is made up of the detailed
render logs that After Effects creates during a render. This includes the output paths, render settings and
output modules used for the render.
The log file is continuously updated during a render, logging each frame as it is rendered, so it can be
queried if you want to monitor the render progress.
Using OpenSesame Server with a render farm
Rather than having OpenSesame Server do the rendering, you can set it up so it only applies the changes
to the project, before saving a copy of the project that can be rendered on a render farm.
In the Options section of the text values file you will need to set it to not render the project and to save
the project either to the logs folder or a path and name you specify.
Also, if you're going to use AE's built-in Render Engine / Watch Folder feature, you will need to set the
RenderControl option so OSS generates the necessary render control file (.rcf).
For more information on setting this up, check out the 'Render section > Render / Save options'.
Preferences
Text encoding
Set the text encoding format used to read/write text values files. See 'Additional topics > Text Encoding'
for more information.
Purge cache
With this enabled, OpenSesame will purge the memory cache before it starts rendering. This may help if
you aren't seeing the changes made to the project being reflected in the resulting renders.
NOTE: In this case you should also turn off Preferences > Media & Disk Cache > Enable Disk Cache as the
OpenSesame purge will only affect the RAM cache.
Common settings
This is a list of settings that are common to many of the item types in the exported text file.
Title
The first part of each line of the .tsv/.csv file or the Title variable for each object in the JSON file are used
to specify what editable value type is being referred to.
On the first line of a .tsv/.csv file or the Header object of a JSON file the title “pt_OpenSesame” is used by
to verify that it is a valid text values file.
CompID
Most entries contain a CompID setting. This is the internal number that After Effects uses to identify a
composition and is what OpenSesame uses to locate it in a project.
The only time you may want to change this value is in the Render Settings as this specifies which
composition will be rendered. To find the CompID value for a particular composition, either add the
comp or something inside it to the list of editable values before exporting your template.
Layer
The layer setting specifies the layer number of the Layer, Text or Value that is to be edited. In general you
would not want to edit this but there are times when you might.
For example, if you have a number of similar layers in a composition and want to specify that one of
those layers should be turned on (depending on some external criteria) you would turn them all off when
exporting the template, include one of the layers in the Export List when exporting, then edit the Layer
number setting in the text values file to choose which layer is to be edited. In this case, you would also set
Video:1 to turn it on.
Name
The name of the item referred to in the entry, for example the name of the layer.
Comp
The name of the composition containing the item referred to in the entry.
Header section
The header section is the first line of the .csv or .tsv file or the Header object in the JSON file. It contains
the information that identifies this as an OpenSesame text values file, contains the name of the AE project
it is linked to, and sets a base footage path for any footage being specified using relative footage paths.
This is a list of the settings contained in the Header section.
Title
This simply says “pt_OpenSesame” and tells the script that this is a valid text values file.
Version
The version of OpenSesame that was used to export the template. Generally it is best if you use the same
version OpenSesame (and OpenSesame Server) to export and re-import the text file, as it's possible the
OpenSesame text file format may change over time due to bug fixes or additional features. You'll receive
a warning if importing a text file created in an earlier version.
AEProject
The name or file path of the AE project which this text values file will be making changes to. On export,
just the name of the AE Project is specified in this setting, and in this case the project must be in the same
location as the text values files. However, if you'd prefer to have the AE project located somewhere else,
you can do this by including the full file path and name for the project in the AEProject setting.
FootageBase
The base footage path used to find footage that has been specified using a relative path. This setting will
only be added if there are footage items in the Export List and you've selected relative footage paths in
the Export List options.
By default this will be the path that the project template was exported to and any relative paths will be
relative to this location. Where possible, OpenSesame will export absolute and relative file paths for any
footage.
When OpenSesame is locating footage it will try an additional FootageBase path, the location where the
text file was imported from, if this is different from the specified FootageBase path. So even if you have
moved the project and footage since the template was exported, as long as the footage remains relative
to the template's current location the footage should still be found.
Because of this, you can actually use the FootageBase to specify a second base path location, for example
if some footage is stored on a different drive or network. This means you can use relative paths for this
footage too and it can still be found by OpenSesame.
Encoding
You can override the encoding setting that OpenSesame uses during import by adding an “Encoding:”
setting in the header section. This way you can submit text values files with different encoding formats
and OpenSesame should import them correctly, regardless of the 'Error: Reference source not found'
import preference.
Main section
Subsequent lines in the .csv or .tsv files, or the Main object array in the JSON file, contain information for
all the Footage, Comps, Layers and Properties that were marked to be editable. Which of these settings
are exported will depend on the selections in the Export List options.
Footage item
This is a list of settings specific to the Footage item type:
FootageID
As with CompID this value refers to the internal number that After Effects uses to identify a footage item.
You should retain this setting and not change it. It can be useful to know what this value is though, as you
can change the FootageID setting on a Layer entry to make OpenSesame change the footage being used
for that layer.
ImageSeq
This is a value of 0 or 1 which specifies whether the footage is an image sequence. If the footage is a still
or video it should be set to 0. If it is an image sequence it should be set to 1. You will only need to change
this if you're changing the path to choose some different footage and that footage is of a different type to
the original.
Path
This specifies the absolute path where the footage item is located. Change this or the Relative Path to
another footage location to change what footage is being used in the project. If you keep both Path and
RelativePath settings then OpenSesame will first try whichever of the two is set as favoured by the
“Favour absolute/relative path” preference. It will use the first valid footage path it finds.
Typically you would decide which path type you prefer to use and delete the other one from the text file.
RelativePath
This specifies a path to where the footage is located, relative to the location where the project file was
exported.
Comp item
The Comp item is primarily included so you can find the CompID value for use elsewhere. Use this to
change which comp is being rendered by a Render item or replace one precomp layer with another by
changing the FootageID on a Layer item.
Comp
Use the Comp setting to change the name of the composition. One reason to do this is if you're using the
ExportToAME helper script to send a comp to be rendered in Adobe Media Encoder as it derives the
filename for the render from the composition name.
Layer item
This is a list of settings specific to the Layer item type.
FootageID
For layers that have a footage source this refers to the internal After Effects number for that footage item
that is already in the project. Change this to the ID of a different footage item to have OpenSesame
change the footage used for this layer. It can be removed if you don't need to change the footage source.
So if you have footage that you want to change, you can either change the file path of the footage item
(on the Footage line change Path or RelativePath), or you can have multiple footage items in the project
already and just change which footage item is being used for a particular layer.
Video
Controls if a layer is on or off, the equivalent of turning the eyeball icon on/off on a composition layer.
The only layers that don't have this are audio only layers. Set to 0 to turn the layer off, 1 to turn it on.
Audio
If the layer has audio, this setting will control whether the audio is on or off. Set to 0 to turn the audio for
this layer off, set to 1 to turn it on.
startTime
This controls the startTime for the layer. This is the time into the composition in seconds of this layer's
original untrimmed start time, which may not be the same as the layer's inPoint if it has been trimmed.
Changing this will offset the layer and any keyframes it contains in time, with the in/out points moving
with it.
InPoint
This is the inPoint in seconds for the layer relative to the start of the composition. Changing this will trim
the inPoint of the layer while not changing the timings of any keyframes or the outPoint.
OutPoint
This is the outPoint in seconds for the layer relative to the start of the composition. Changing this will trim
the outPoint of the layer while not changing the timings of any keyframes or the inPoint.
Text item
This is a list of settings specific to the text item type.
NOTE: Due to a limitation with AE scripting, OpenSesame cannot edit a text layer and retain multiple
fonts, sizes or colors contained in a single text layer. Editing any text layer using OpenSesame will cause it
to have a single style for all characters. If you need to edit a text layer containing multiple styles you
should break it up into a separate text layer for each style before exporting the template.
Font
The font used for the text layer. If you want to change the font you should use the exact name for that
font as used by AE scripting. To find the proper font names, create a text layer for each font you want to
use and export a template with these text layers included in the export list.
FontSize
The font size for the text layer. This is the same as the font sizes shown in the After Effects Character
panel.
FillColor
The Fill Color for the text layer.
Values
This setting contains the text contents for the text layer.
Times
If the text layer's Source Text property has keyframes this setting will include the time in seconds for each
of those keyframes.
Values item
This is a list of settings specific to the property values item type.
PropName
The name of the property. This is included to make it easier for you to know which property is being
referred to. It is not an essential item and can be deleted if you wish. Changing the PropName setting will
have no effect on the template. For effect properties, the PropName will contain both the effect and
property name in the format effectName|propertyName.
Property
This describes the path to the property from the layer that contains it. It is an essential setting used to
locate the property and must not be deleted. In most cases you won't want to edit this.
The property path is made up of a series of match names, the internal naming system that After Effects
uses to describe each property and the property group that it is in. For mask, shape or effect properties,
part of the path will be a number which refers to the index for that particular item in its group. Each part
of the path is separated by a vertical bar symbol.
Values
This setting contains the values for the specified property.
Times
When exporting a keyframed value, this additional setting contains the keyframe times in seconds.
Examples of property values
Static values
Non keyframed values are stored under “Values” as either single values for one-dimensional properties or
multiple values for two/three dimensional values. The values of a multi-dimensional property are
separated by semi-colons in tsv/csv formats or stored as an array in the JSON format.
Examples
A static one dimensional property like Opacity property:
TSV/CSV
Values: 100
JSON
"Values": 100
Keyframed values
For properties with keyframes, these are saved as sets of values with each keyframed value separated by
a vertical bar symbol in tsv/csv formats or as an array of keyframe values in JSON format. The times (in
seconds) for each keyframe are stored under “Times”, with the values separated by semi-colons in tsv/csv
formats and as an array in the JSON format.
Examples
An Opacity property with two keyframes, fading in over the first second of the composition:
TSV/CSV
Values: 0;100
Times: 0; 1
A Position property on a 2D layer with two keyframes moving from top left to bottom right:
TSV/CSV
Values: 0;0|640;480
Times: 0; 1
JSON
"Values": [ [ 0 , 0 ], [ 640, 480 ] ]
“Times”:[ 0 , 1 ]
NOTE: When OpenSesame imports keyframed values and there were already keyframes in the template
project, the keyframes will be replaced but any existing keyframe interpolation settings will be preserved.
If you don't want to change the keyframe times then the “Times” setting can be removed from the text
file. Values will be applied in order at the times of the existing keyframes. If the number of values doesn't
match the number of keyframes, additional keyframes will be removed, additional values will be ignored.
Color values
RGB color values are stored as three decimal values between 0.0 and 1.0, separated by semi-colons. It isn't
possible to specify high dynamic range values greater than 1.0 as this isn't supported by scripting in After
Effects.
Example
The Color property of the Fill effect, set to red:
TSV/CSV
Values: 1;0;0
JSON
"Values": [ 1, 0, 0 ]
Text values
On a text item, the text contents of that layer are stored under Values. The text may have been encoded
so it can be safely stored in the text file, depending on the export format and what characters it contains.
See the Special Characters section for information on how text may be encoded.
If there are no keyframes the text will be a single string for the text contents. If there are keyframes they
will be stored in the same format as other keyframed values, with both Values and Times settings.
IMPORTANT NOTE FOR TSV/CSV EXPORT: The text values setting is unique in OpenSesame in that the
“Values:” heading and the actual text are separated by a comma/tab when exporting editable values as
TSV or CSV. This is designed to make it easier to edit the text when using a spreadsheet, as the actual text
contents will be displayed in a separate cell.
Examples
The text value for a text layer without keyframes:
TSV/CSV
Values:some text
JSON
"Values": "some%20text",
Checkbox values
Checkbox properties are used in various effects such as the Expression Controls > Checkbox Control
effect. Checkbox values are stored as either 0 for unchecked and 1 for checked.
Example
The Checkbox property of the checkbox Control effect set as checked:
TSV/CSV
Values: 1
JSON
“Values”: 1
Scripts section
These are the generic settings used for all helper scripts. A helper script may also add additional settings
specific to that script.
PostRender
Helper scripts can run either 'pre render', after the changes in the text file have been applied but before
any render items are set up and the project is rendered and/or saved, or 'post render', after any renders
have completed. By default, all helper scripts are added as pre render scripts so this is set to “false”. If a
helper script is designed to always be used 'post render' it can override the default, or you can manually
edit it to PostRender:true after export.
NOTE: Post render scripts will run even if nothing is being rendered. For example, you may have specified
that the altered project is to be saved instead, and want the post render script to start some process
involving that saved project file.
ScriptPath
The filename or full file path for the helper script. On export it will add the full file path but you can also
specify just the filename, in which case OpenSesame will search for the script in the following location
order:
– the folder containing the currently running copy of OpenSesame, unless it's running from within
the Scripts/Startup or Scripts/ScriptUI Panels folder. In those cases it will look in the main Scripts
folder.
– If the 'Allow helper scripts' pref is set to allow scripts from any location it will additionally search
in the folder that contains the OS text file.
Render section
Render Settings
If you delete all the "Render" lines in the values text file it will leave the project's existing render queue
items untouched. For OpenSesame Server this will cause it to render any existing queued items to their
original file paths.
If you retain the "Render" line you must at least have the "CompID:" value which identifies the numeric ID
of the composition that will be rendered. If you delete the "Start:" and "Duration:" values it will default to
rendering the work area range specified in the original AE project. The "RenderSettings:" will use the
default render settings template specified in After Effects on the render machine, or you can change it to
the name of another template. That template must already be set up on the render machine otherwise
the default template will be used.
Output Module settings
If you retain the "Render" lines you must ensure there is at least one subsequent "OutputModule" section,
and for that there must at least be a filename specified under "Path:". If you only specify a filename, or if
the file path is invalid:
– OpenSesame will set the folder path to your Documents folder.
– OpenSesame Server will render that item to the render folder specified in the OpenSesame Server
preferences.
You can set the "OMName:" to another output module template to change the file format and size of the
render. This template must already have been set up in After Effects on that computer. If the template
isn't found it will revert to the default template used by AE on that machine.
You can add as many “Output Module” lines as you like after each “Render” line, each with there own file
path and output module template.
Note: When OpenSesame has to use default Render Settings and Output Module templates, these are the
templates that are set to be applied by default on that particular machine, which is not necessarily the
same as the template settings saved in the template project. The only time it is guaranteed to use the
exact templates saved in the original AE project are when there are no "Render" lines in the text values
file, but this also removes the ability to specify a new file name and path for the render. In other words, if
you rely on using the default Render Settings or Output Module templates you should ensure they have
been set correctly as the default templates in After Effects on the render machine. For Render Settings
the default template is "Best Settings" which is most likely what you will want anyway.
Render Project
By default this is set to "RenderProject:true" and the project will be rendered after changes are applied.
When using one of the SaveProject options to hand off the project to a render farm you would set this to
"RenderProject:false" instead.
Save Project
Change the “SaveProject” string to one of the following options:
Of
Project will not be saved. This is the default setting and assumes you will be rendering locally.
To_Path
Save the changed project to one or more locations. You could use this to hand off the changed project to
a render farm instead of rendering locally. NOTE: If you select this option you must also specify a path for
the project in the "Path:" section.
To_Log_Folder
Save the changed project to the log folder alongside the moved text file. Useful for troubleshooting, as
you can review the project state after the changes were made but before it started rendering. You can
even use this option when creating a render farm with the AE Render Engine by choosing the log folder
as the render engine watch folder.
RenderControl
If you've chosen to save the project, you can use the RenderControl setting to make OpenSesame create
an After Effects render control file (RCF) which is needed if you're going to use AE's built-in Watch Folder
mode for rendering the altered projects. See the After Effects help regarding 'Automated rendering and
network rendering' for more information on AE's watch folder and render engine.
To have these RCF files created (in the same location as the saved project) you should set RenderControl
to a value higher than zero. This value will set the maximum number of computers that will render the
project. Only image sequence renders are suitable for multi-machine rendering, so for anything else you
should set RenderControl:1
NOTE: An RCF file includes the version number of AE used to create it and is only valid for that version, so
you should ensure your watch folder render machines are running the same AE version as OpenSesame
Server.
Path
If you use "SaveProject:To_Path" then you must also specify a path for the saved After Effects project in
the "Path:" section. You can either just specify a path to an existing folder, in which case the project will
be named based on the imported text file, or specify a full folder and filename path.
You can save multiple copies of the project by adding extra settings that begin with Path. For example
you can add settings called “Path2”, “Path Backup”, etc containing additional folder or folder/filename
paths.
Additional topics
Text Encoding
Specify the text encoding format used to read/write text values files using the 'Error: Reference source
not found' preference in the Help Window. The default encoding is UTF-8, a unicode format that can
contain characters in all languages, and this is still the recommended format to use.
However, Excel generally has poor support for UTF-8, so if you're finding that foreign language characters
are getting lost when editing the text files in Excel you can try one of the other encoding formats.
MS_ANSI is Microsoft's legacy format for western languages so this can work better for Excel.
Be aware that OpenSesame can have problems reading text files if the encoding format for the text file
doesn't match the “Text Encoding” pref, so you should be consistent with your encoding format for both
export and subsequent imports.
The only recommended encoding formats are UTF-8, or MS-ANSI for use with Excel. The other options
have been included in case they are helpful, but they haven't been tested.
NOTE: You can override the encoding setting that OpenSesame uses during import by including an
“Encoding:” setting in the header section of the text values file. This way you can submit text values files
with different encoding formats and OpenSesame should import them correctly, regardless of the Text
Encoding import preference. See the 'Editing OpenSesame text files > Header section' for more
information on this.
Special Characters
CSV/TSV Export
Certain characters are converted in order to be safely stored in the text file. When making changes to the
text values file you should ensure you follow these conventions.
The following characters are converted:
\n (carriage return) is converted to %n%
\r (line feed) is converted to %r%
Commas are converted to %c%
Tabs are converted to %t%
Note: Depending on whether you export as a comma or tab separated text file, there's a preference to
preserve the character that isn't being used as the separator. So if you're going to be editing text and
would prefer to retain commas as they are, you can choose to export as tab separated. With the ' Preserve
commas / tabs' preference enabled this will prevent commas from needing to be converted.
If you want to set up a spreadsheet so someone can enter text while using regular line returns, you could
place the actual text entry cells in a lower part of the spreadsheet under the “End” line then link to those
cells from the intended destination in the Text settings line.
For example, use this in the Text Values cell to link it to a lower cell, substituting any line returns with the
required %r%:
=SUBSTITUTE(K21,"
","%r%")
You can nest these functions to substitute multiple different characters such as this example which will
replace both line returns and commas:
=SUBSTITUTE(SUBSTITUTE(K21,",","%c%"),"
","%r%")
By moving the data entry to a lower part of the spreadsheet there are many ways you can help make it
easier for someone to change the values, such as setting up in-cell dropdown lists in cases where you
want to offer a limited set of choices.
If you're finding that non-English alphabetical characters aren't being preserved you could try changing
the 'Error: Reference source not found' preference to use a Microsoft legacy encoding option such as MS-
ANSI for export and subsequent imports.
JSON Export
When expressions are exported they are always encoded using the standard Javascript encodeURI
method and should be encoded the same way if modified and resubmitted.
While a text layer's Values setting isn't encoded on export you should consider encoding them using the
encodeURI method for your JSON submissions. OpenSesame Server will always attempt the decodeURI
method on text Values, and you may run into problems if the text includes certain characters and isn't
encoded when submitted.
Text justification
Use the justification options at the top of AE's Paragraph panel to choose whether text is Left Aligned,
Right Aligned or Centered. This will ensure text remains correctly aligned to your design template
however many characters are used.
Scale
There are a number of ways you can change the size of the text to accommodate varying numbers of
characters.
You could change the FontSize setting on the Text item in the text values file depending on the number
of characters being applied to the text layer. You could also do this by adding the text layer's Scale
property to the Export List and changing this, giving you the option to change the scale width
independently of the scale height. You could even add an expression to the Scale property that would
automatically change the scale based on the number of characters . But these options all require some
testing to find the right settings to use depending on the number of words/characters being applied.
Auto Scale
OpenSesame Server has an additional option for more accurately altering the size of a (point text only)
text layer depending on its contents. When setting up your AE project template, if you rename a text
layer in a specific way it will automatically resize the text layer to fit if it goes over a certain size.
Select a text layer in the Timeline panel (where the layers in the composition are listed) then press Enter
to enable renaming of the layer. Note: Renaming the text layer is different from changing the actual
contents of the text layer as seen in the composition. Rename the text layer using one of the following
formats:
WIDTH 500
FIT 500
Rename the text layer to either WIDTH or FIT, followed by a space, then the width in pixels you want to
constrain the text to. WIDTH causes only the width of the text layer to be reduced, while FIT will uniformly
scale the width and height to constrain the text inside the chosen pixel width.
In both cases, the scale will never exceed 100% so text with a small number of characters won't be scaled
up to fit. Text will only be scaled down if it would otherwise exceed the specified width.
NOTE: When setting this up, ensure the text layer hasn't been animated or rotated. You may want to
precompose the static text then animate it in a subsequent comp. Additionally, don't include the text
layer's Scale property in your Export List. If you do, this setting may be applied after the auto scale has
rescaled the text layer, causing the setting to be overridden.
Here's an example where you can specify the final dimensions. It will non-uniformly scale the element to
that exact size:
finalSize = [500,500]
x = (finalSize[0]/width)*100;
y = (finalSize[1]/height)*100;
[x,y];
There are many other ways of using expressions to help your project react to changes without having to
specify everything in the text file. One simple example is to link multiple properties of the same type and
value to a single 'master' property, so you only need to add that one 'master' property to the Export List
and can change all instances by just editing that one value in the text file. For example, you could have
multiple copies of the Color Balance (HLS) effect linked through expressions so you could change the
color scheme of the entire project by just editing a single set of Hue and Saturation values.
Helper scripts
Use helper scripts to extend OpenSesame's functionality in all kinds of ways, or to make changes that
would otherwise be difficult to accomplish just by altering the text values file. You can run as many
helper scripts as you like, and choose whether they run before or after any renders are completed.
This feature is primarily intended for OpenSesame Server's fully automated project versioning and
rendering workflow, and is included in OpenSesame so you can test helper scripts with your project
templates before deploying to OpenSesame Server, but regular OpenSesame users may find it useful too.
How to use
While setting up your editable values for export, click the 'Add Script' button in the Export List, then
locate the script you want to include as part of the import process.
By default, helper scripts are set to be applied 'pre-render', after the changes in the text file have been
applied, but before the render items are set up and the project is rendered and/or saved. To have them
applied 'post-render' you'll need to set PostRender:true in the text file's Scripts section. See the 'Editing
OpenSesame text files > Scripts section' for more information.
Security
As a security precaution, the ability to run helper scripts is disabled by default. See the 'Preferences >
Allow helper scripts' section for information on enabling this. Scripts run by After Effects have a wide
range of abilities, including reading, writing and deleting files on your computer, so you should only use
scripts obtained from trusted sources.
CompID:
Specify a single id value for the comp to be altered. This is the unique value assigned by After Effects to
every project item, and is what OpenSesame uses to locate those items. If you included the composition
or contained layers / properties as part of the export list you can find the CompID from there in the text
file. Otherwise, open the comp and with nothing selected, return to the Export List window and click ‘Add
Selected Items’ to add the comp, then export again.
NOTE: Only one composition can be altered per use of this helper script, but you can duplicate the whole
helper script entry multiple times if you want to run it more than once on different comps.
Layers:
Specify the layer numbers of the layers you want rearranged, in order from first to last. The first layer will
retain its current start time. All subsequent layers will be moved to start directly after the previous layer.
Options are:
- Rearrange all layers by setting a single value of 0. This is the default setting and causes all layers in the
comp to be rearranged, starting from layer 1.
- Set multiple values to specify the exact layers and order. For TSV and CSV exports this must be a string
of numbers separated by semi-colons. So 1;2;3 would be used to specify arranging layers 1-3, starting
from 1. For JSON exports you can either specify the string in the same way, or use an array of layer
numbers.
- Rearrange no layers. Unlikely, as this is the point of the script, but if you want to do this just set a single
value which is higher than the number of layers in the comp.
ExtendOutLayers:
Specify whether the layers should have their out points extended. If footage has been replaced by
OpenSesame and is now of a longer duration, layer out points aren’t automatically extended, which is
another reason this script comes in handy. Options are:
- Extend out points on all layers by setting a single value of 0. This is the default setting and causes all
layers to have their out points extended. It will also default to this if this setting is completely removed
from the text file.
- Set one or more values to specify layers to be extended. For TSV and CSV exports with multiple values
this must be a string of numbers separated by semi-colons. So 1;3 would extend the out points of layers 1
and 3 only. For JSON exports you can either specify the string in the same way, or use an array of layer
numbers.
- Extend no layers. Unlikely, as this is the point of the script, but if you want to do this just set a single
value which is higher than the number of layers in the comp.
ChangeCompDuration:
Choose whether the comp duration should be changed to fit the out point of the last layer being
arranged. Set to true or false. If this setting is removed from the text file completely it will default to true.
NOTE: If you're changing the duration of the comp / work area and want these changes reflected in the
render duration, you should remove the Start: and Duration: settings from any Render Settings lines in
the text values file. Removing these settings will cause the render durations to adopt the altered comp
work area settings instead.
OSHelper_ExportToAME
OSHelper_ExportToAME provides a method for exporting a render through Adobe Media Encoder. There
are two different methods for doing this depending on which version of After Effects you're running.
NOTE: When using this helper script, make sure you set RenderProject:false In the main Render section so
your queued renders are only being rendered through AME, not After Effects as well.
Alongside the generic helper script options, these additional options are used:
AllQueued:
Only available in After Effects CC 2017 and later, setting this to true will cause all queued render items to
be sent for rendering in AME, so you can set up your render queue items in the regular way with control
over the render path / name.
CompID:
If the 'AllQueued' option is not available (AE CC 2015 or earlier) or if you set it to false, you can instead
specify the CompID for the comp you wish to send to AME. Using this option will replicate AE's File >
Export > Add to Adobe Media Encoder Queue menu item.
This will use whatever render location and output template has been set as the default in AME, and the
only way you'll be able to alter the render name is to change the Comp name in the main text entry for
that comp item.
NOTE: An alternate but more restrictive method for rendering through AME is to have OpenSesame save
the altered project into a watch folder being monitored by AME. This will cause it to render any comps in
the top level of the project (i.e. any comp not inside a folder) using AME's default render location and
output template.
OSHelper_OpenURL
OSHelper_OpenURL can be used to open a specified URL. This will cause the URL to be opened in your
computer's default web browser and can be used to trigger some kind of event on render completion.
Alongside the generic helper script options, these additional options are used:
URL:
Specify the URL you wish to open, beginning http://.
Additional helper scripts
The following scripts can also be used as helper scripts and are available for purchase on aescripts.com:
pt_ImportSubtitles
aescripts.com/pt_importsubtitles
The latest version of pt_ImportSubtitles can either be used manually as a standalone UI script or as a
headless OpenSesame helper script. Use with OpenSesame Server to fully automate importing subtitles
into your project. You can specify the subtitle file to import along with most other settings you'd
normally access through the pt_ImportSubtitles user interface.
TM_HebrewText
aescripts.com/typemonkey-hebrew-text-modifier
The latest version of the Type Monkey Hebrew Text mod can also be used as an OpenSesame helper
script. If you're making text changes in Hebrew you can apply them with the character stored in logical
order and have TM_HebrewText convert them to the display order needed to appear correctly in After
Effects.
TM_ArabicText
aescripts.com/typemonkey-arabic-text-modifier
The latest version of the Type Monkey Arabic Text mod can also be used as an OpenSesame helper script.
If you're making text changes in Arabic you can apply them with the character stored in logical order and
have TM_ArabicText convert them to the display order needed to appear correctly in After Effects.
Scripts need to be specially designed to work as OS Helper scripts. If there are other scripts on sites like
aescripts.com that offer functionality you would like to use in OpenSesame Server's automated
environment, you should contact the author to see if they'd be prepared to add OS Helper Script support.
While I've included helper script support in the above scripts at no additional cost if you've previously
purchased them, due to the niche nature of the OpenSesame Server user base it's more likely that other
script authors would charge extra for this.
Please open a support ticket at aescripts.com if there is a helper script you would like. If you have an
OpenSesame Server SLA ( Service Level Agreement) then I may be able to help as part of that, depending
on the complexity of what you require. Otherwise myself or other script authors may be available for hire
to provide a solution.
OSHelperScript_Run()
The one thing you need to do to create a working helper script is to make sure everything is inside one or
more functions, and have a function called OSHelperScript_Run() as the starting point for your helper
script. On import, after OpenSesame evaluates the script file it will call this function.
So the most basic example would be:
// CODE START
function OSHelperScript_Run() {
alert(“hello world”);
}
// CODE END
But don't do that! Helper scripts are designed to be used with OpenSesame Server's automated workflow,
so putting up an alert would require user intervention and bring everything to a halt!
If all you want to do is to create simple helper scripts that rely on no external data other than what they
can access through the After Effects project itself, that's really all you need to know to get started.
But there's also much more to it if you feel like reading on...
OSHelperScript_Setup()
You can optionally include a function called OSHelperScript_Setup() if you want settings specific to your
helper script to be included in the initial OpenSesame text values file export. During the export process,
the helper script is evaluated and this function will be called if it exists, allowing you to define additional
settings as part of the OSHelperScript_Data object.
An example of this would be:
// CODE START
function OSHelperScript_Setup() {
OSHelperScript_Data.DoThisCoolThing = true;
}
// CODE END
Which would result in the exported text file containing a line like:
Script, PostRender:false, ScriptPath:myHelperScript.jsx, DoThisCoolThing:true
OSHelperScript_Data
Helper scripts have access to the OSHelperScript_Data object for sending and receiving information from
OpenSesame / Server both while the helper script is running during an import, but also during export to
supply OpenSesame with additional script specific settings you want included in the exported text file.
OSHelperScript_Data.JSON
Read only, true or false. Most useful during the OSHelperScript_Setup() process on export, you can find
out if the text values file is being exported in JSON format.
Use this information to decide if your own script specific settings can include arrays and special
characters like commas and tabs, or if you need to ensure they are strings suitable for exporting to TSV
and CSV files.
This is also accessible during the OSHelperScript_Run() process on import to find if the imported text
values file is in JSON format. It's probably not such a good idea to rely on this though as you can easily
parse strings and check for instances of arrays.
The included OSHelper_ArrangeLayers.jsx script shows an example of how to allow for either types of
values on import without needing to rely on OSHelperScript_Data.JSON.
OSHelperScript_Data.PostRender
During an OpenSesame import you can read the OSHelperScript.PostRender boolean to determine if the
helper script is running either pre or post render.
During export, all helper scripts exported to the text values file are set as pre-render scripts. If your helper
script is designed to always be used as a post render script you can override this by including in the setup
function:
OSHelperScript_Data.PostRender = false;
This is the only time when this setting should be included and would be done simply to save the user
from having to make this change manually.
OSHelperScript_Data.RelativePathsArray
This is a copy of the array of relative file paths used by OpenSesame. If there's only one item in the array it
will be the location of the imported text file. If the text file specifies an additional “FootageBase” path in
the Header section then this will also be included.
This could be useful if your script specific settings ask for a file location, but you're happy for the user to
just supply a file name and let you find it by adding that to the relative path location.
OSHelperScript_Data.Message
Use this to send a string back to OpenSesame which will be included in the import logs. Typically this
would be to report whether the helper script completed successfully. If the string contains the word error
it will be treated as such, and could set off an 'email alert on error notification' if that is enabled In the
OpenSesame Server prefs.