User Quick Start
Note if you are viewing this on github, you may need to view it on Google Colab
Introduction
This User Quick Start
guide tries to demonstrate
How to get started modifying your own
SEPT
templatesWhy you should care and flexibility you can gain from using
SEPT
Installation
Users can easily install SEPT
according to the following steps:
Installing SEPT
from the python packaging index is as simple as executing the following command:
pip install sept
Getting Started
This tutorial is aimed at someone that is not a developer and instead will be a user of some program that a developer writes that takes advantage of SEPT
For this tutorial, we are going to learn how to write SEPT
templates using the simple application that was created from the Developer Sample Application tutorial.
The finished product from that tutorial will look similar to the following:
This application is a program that will prepare several “Version” entities from your internal Shotgun <https://shotgunsoftware.com>
_ website. If you haven’t worked with Shotgun before, don’t worry. You should be able to substitute Shotgun for any production tracking software, and a “Version” entity for any rendered image sequence that can is approved to send back to the movie studio.
There are 2 main components to this application.
On the left side of the dialog you can see the editor window where we can test our SEPT
template.
On the right side is the help window that shows all of the Token
and Operator
keywords that you have access to.
Modifying Templates
The following are some examples of path templates that you may write.
For simplicity’s sake, the examples are going to work off of a single input file, however in reality you may be working with tens or even hundreds of input files at once.
The quicktime file will have the following information about it
project: HeroJourney
sequence: Battle
shot: 001
step: comp
version: 2
extension: mov
Within your studio, the filepath looks like HeroJourney_Battle_001_comp_v1.mov
.
[ ]:
!pip install sept
from sept import PathTemplateParser
data = {
"project": "HeroJourney",
"sequence": "Battle",
"shot": "001",
"step": "comp",
"version": 2,
"extension": "mov",
}
parser = PathTemplateParser()
First Example
Battle_001_comp_v2.mov
.The following code block allows you to write a SEPT
template and execute it to see the result.
[ ]:
# Type your SEPT template here:
template_str = "{{sequence}}_{{shot}}_{{step}}_v{{version}}.{{extension}}"
result = parser.parse(template_str, data)
print(result)
Breaking It Down
sequence
, shot
, and step
tokens and joins them with an underscore.version
token to the end before adding the file extension
token at the end.To put a Token
in your template you can place the name of your Token
between two sets of curly brackets and SEPT
will write out whatever value is in the data
with that name.
{{tokenName}}
You can put any characters you would like outside of the curly brackets and they will be rendered exactly as you have written them.
Introduction To Operators
Operator
to a Token
to change it in some way.SEPT
provides several common operations out of the box but a developer can write custom ones that may apply better to your specific use case.SEPT
does not provide out of the box that you think it should, please reach out and let me know what you think it should provide!Using An Operator
Operator
with your Token
you need to modify how you write the expression.{{tokenName}}
, you should instead write {{operatorName:tokenName}}
.operatorName
followed by a full colon :
and then the tokenName
.Lowercase Template Example
Operator
, there is no easy way to achieve this, you would need to request that a producer on the show changes the name of the sequence from “Battle” to “battle”. If this is at the start of the project, it may not be a huge deal, but as soon as work has started, this becomes nearly impossible to achieve without having to redo work.battle_001_comp_v2.mov
, we just need to apply a “lower” Operator
on the sequence Token
.[ ]:
# Type your SEPT template here:
template_str = "{{lower:sequence}}_{{shot}}_{{step}}_v{{version}}.{{extension}}"
result = parser.parse(template_str, data)
print(result)
Breaking It Down
lower
to is the “sequence” Token
.Operator
right at the beginning.Operators With Inputs
Operator
types that require additional information from you to do their work.replace
Operator
. This allows you to find and replace characters in your Token.These are called “Operator Inputs” and any Operator
that requires them should provide a description of what it expects and some examples of using it.
To set the value of an input, we need to surround it in square brackets directly after the name of our Operator
.
{{operatorName[inputValue]:tokenName}}
Some operators may expect multiple input values, the syntax for this is very similar, you just need to separate the input values with a comma.
{{operatorName[inputValue1,inputValue2]:tokenName}}
Below is the description from replace
:
replace Operator
Operator Inputs
Find String: The characters that you want to search for and replace
Required: True
Replace String: The characters that you want to replace the "Find String" with.
Required: True
The replace Operator allows you to find and replace characters in your Token.
Examples (name = "alex"):
{{replace[ex,an]:name}} -> "alan"
{{replace[kite,dog:name}} -> "alex"
Replace Sequence Example
Conflict_001_comp_v2.mov
, we just need to apply a “replace” Operator
on the sequence Token
.[ ]:
# Type your SEPT template here:
template_str = "{{replace[Battle,Conflict]:sequence}}_{{shot}}_{{step}}_v{{version}}.{{extension}}"
result = parser.parse(template_str, data)
print(result)
Breaking It Down
[Battle,Conflict]
in our template.Find String
and Replace String
.Find String
equal to “Battle” and the Replace String
equal to “Conflict”. This means that any time it finds “Battle” as the sequence, it will replace it with “Conflict”.Nested Operators
There may be certain times when you need to apply more than one Operator
to a Token
in order to get exactly what you want.
SEPT
fully supports this by nesting an Operator
within another Operator
.Token
value for a separate Token Expression. This allows you to apply more than one Operator
to a Token
.{{operatorName2:{{operatorName1:tokenName}}}}
SEPT
will apply each Operator
one at a time inside out.
Nested Operator Example
Operator
that we saw earlier, “upper”, and the second is “substr” which allows us to return a subset of the Token
.Start Location
and optionally a End Location
.“substr” is a bit special in that it will only accept certain values as inputs, it takes numbers for the location in the Token
as well as “start” and “end”.
To create a filename that looks like BATT_001_comp_v2.mov
, we can use the following expression.
[ ]:
# Type your SEPT template here:
template_str = "{{substr[start,4]:{{upper:sequence}}}}_{{shot}}_{{step}}_v{{version}}.{{extension}}"
result = parser.parse(template_str, data)
print(result)
Breaking It Down
Operator
two inputs, the first is “start” and the second is “4”.Conclusion
You’ve reached the end of our interactive tutorial, this should have taught you the basics of writing a SEPT
template.
You learned how to write a
Token
Apply an
Operator
to aToken
Customize how the
Operator
works by passing it input valuesApply more than one
Operator
to aToken
by nesting the operators.
If you are interested in a more technical understanding of how SEPT
works and how you can customize it to work better for your company, you should check out the Developer Introduction