About structure
Structure, as a package itself, has the form of hierarchic model of embedded groups and templates, that use the JSON language (JavaScript Object Notation).
At first, let's observe an explicit example of creation of the structure, and after that look through its main parts:
- Groups - Buckets for templates or other groups.
- Templates - Description of templates elements and the file itself.
- Elements - Details of a certain template element (composition / sequence or audio file / preset).
To create a package structure we need all these parts (operation with groups, templates and elements) to create a unique catenation with preview files, package code and templates (or audio files, presets).
Thesis: A process of writing of a package structure is a description of details of a template file and its elements in the form of code (obeying the rules demanded by the extension).
Now let's puzzle put how to write the structure and bond it with files system.
Example of a structure creation
note
This example is for After Effects, but it also fits for other peogramms that have compositions / sequence (templates).
For example: let's say we have saved After Effects template (.AEP format - Minimal.aep), and it contains 6 compositions with titles (Minimal 1 ...Minimal 6).
Now we have questions:
- How can we place the template into a package structure?
- How shoul we point preview files for each ellement (composition)?
- Where should we place the template file?
Let's try to answer these questions below.
Create a package structure (based on our compositions and their titles) like that:
warning
The titles of groups, templates and elements have to be in latin letters, without symbols (!@#$%^&*+=~`'"\|/)
Description of the structure (code)
Template with the title Minimal (file format .AEP is ment, but not pointed), inside the template there is a bucket preview (due to the bucket a group became a template), and enumeration of the elements (compositions).
For preview files:
According to the current structure, the preview files (inside a folder Atom Preview Assets) have to be in an additional folder Minimal (title of the template is used as title for the folder, but you can change it with the help of settings for group of elements, in particular, with parameter custom_folder ).
You have to have two types of files (GIF/PNG) for each element, with identifiers titles (ML_1 ...ML_6) that are spoted in the structure (you can use element titles instead of titles of identifiers, then you need to add a special setting for group of elements, to be exact, a parameter preview_name_instead_id).
For template file:
The template file (.AEP) has to have title Minimal.aep and be in a folder Atom After Effects.
Despite the title Minimal in the structure, you can use a template file with another title (see the details in setting for group of elements, parameter aep_file_name).
Let's look at a visual example of disposition of files in the writen structure:
The example if fully runnable, you can check out your package in a test mode right now (note that the code of the structure is only a part of the code, the package represents all the code parts in one file).
To definitely chek out the operating of the structure, apply any element, if efficiently, then the template file is at its place (and as you see preview files, then they are at their place too).
Making the structure more complex
Let's add one more temlate for After Effects (template file: Typo.aep) into the package, this time the template has 4 compositions with titles (Stomp 1 ...Stomp 4).
Locate the template (in the package structure)_in additional group Typography.
Description of the structure (code):
Template with title Stomp (differs from actual Typo.aep) that is located in additional group Typography, there is also a bucket preview in the template, and here we use setting for group of elements for template (separated from
preview
bucket by comma).
The setting of groups of elements allows to change the parameters of a whole group of elements (after the bucket preview), and here what we now change:
- preview_name_instead_id - allows using elements titles instead of preview files ID.
- custom_folder - allows using a folder with diifferent titel for preview files (as you remember, the title of the folder has to correspond with hierarchy that pointed in the structure).
- aep_file_name - allows using title of the temlate file that differs from a title pointed in the structure (by default, the title in the structure has to be a title of the template file).
For preview files:
Now the preview files (only for the template Stomp, no changes for the template Minimal) have to be located in the folder Typography, inside the folder has to be another folder with title of the template Stomp.
However, as you remember, earlier we used a special parameter for the group of elements setting (custom_folder), adn with its help we changed the title for the preview files folder from Stomp to MySpace (if no parameter used, the title of the folder would stay default).
Moreover, by virtue of settings for group of elements (preview_name_instead_id) we now need to use titles of elements instead of their ID: for files (GIF/PNG) use (Stomp 1 ...Stomp 4) instead of (STM_1 ...STM_4).
For template file:
As agreed above, the title of the template file by default is Typo.aep, however we pointed it as Stomp in the structure, it means that the extencion will reffer to the template with the title Stomp.aep (inside the additional folder Typography).
Then again, with the help of special settings for the group of elements (aep_file_name), we set title other than the one in the structure, and now the extencion will use the file Typo.aep (regardless the structure with the template stated as Stomp).
Thus, we added a folder Typography (the template file has to be in the folder), changed the title of the template for the file and its own title in the structure (its title will be shown in the extension menu).
Let's look at a visual example of disposition of files in the writen structure (including the previous code for Minimal):
In a text mode it looks like this:
note
If you'd like to create more groups inside the group and place your templates / preview files there you will hate to create folders for additional groups againg (keeping the hierarchy) as described abowe.
The entire code of the analysed structure
We only took the part structure for the previous example, however the entire package contains two main parts: settings and structure (more on that see in file creation).
Therefore, here is the entire code of our example (including settings and a dropbox {}).
Comming up the entire info on working with groups, templates, and elements in the package structure.