Tutorial¶
In this tutorial, we will be configuring the naming convention templates for an episodic program.
Your team is working on the next season of Dr Who, and you are working within the following folder structure:
/projects/
|- drWho
|- build
|- ep001
|- conform
| |- hiero
|- sh001
|- comp
|- nuke
|- comps
|- precomps
The Compositing tasks are broken down in episodes and shots. For each shot,
the Nuke scene files must be saved into the comp/nuke
folders.
For instance:
/projects/drWho/ep001/sh001/comp/nuke
The Conforming tasks are broken down in episodes only. For each episode,
the Hiero project files must be saved into the conform/hiero
folders.
For instance:
/projects/drWho/ep001/conform/hiero
Instead of hard-coding the project name, we would like to define a naming convention which could easily be adapted to a new project which would adopt a similar structure.
Defining a comp template¶
Let’s create a template to define the naming convention for the Compositing tasks.
Open the Setting Dialog and click on the “Comp Resolvers” tab to create the template.
Click on the “+” button on the top-right corner to add a new template which is automatically named “Comp1”.
Note
You can edit the name by double clicking on the “Comp1” tab. You would then be able to type a new name and click enter to apply it. We will keep the automatic “Comp1” name in this tutorial.
We want the Nuke composition scene files to be named in the form of:
drWho_ep001_sh001_comp_v001.nk
Therefore, the pattern-base value should be:
{project}_{episode}_{shot}_{description}_v{version}
The project
, episode
and shot
tokens should be extracted from
the folder structure. For instance, let’s consider the following location:
/projects/drWho/ep001/sh001/comp/nuke
The resolved tokens should be:
Token Name | Resolved Value |
---|---|
project | drWho |
episode | ep001 |
shot | sh001 |
Therefore, the pattern-path value should be:
/projects/{project}/{episode}/{shot}/comp/nuke
To prevent any matching error, we can be even more specific and define
custom regular expression for the episode
and shot
tokens:
/projects/{project}/{episode:ep\d+}/{shot:sh\d+}/comp/nuke
Note
We can uncheck the match-end box so that the naming convention can be applied to scenes saved in sub-folders, for instance:
/projects/drWho/ep001/sh001/comp/nuke/test
This is how the settings dialog should look like:
Note
If more than one comp template is defined, the first matching one will be used.
Defining output templates¶
Let’s now create two output templates to define the naming convention for the render outputs for the comp template previously created:
Default renders should be saved in the
comp/comps
folder and be named in the form of:drWho_ep001_sh001_comp_v001/drWho_ep001_sh001_comp_v001.%03d.exr
Precomps renders should be saved in the
comp/precomps
folder and be named in the form of:drWho_ep001_sh001_precomp_v001/drWho_ep001_sh001_precomp_v001.%03d.exr
Note that we also want to create subfolders for each outputs to better organize the image sequences.
Click twice on the “+” button located on the top-right corner of the frame below the composition template filled up in the previous section to add a two new output templates which will be automatically named “Output1” and “Output2”.
Double click on the tab labels to rename them “comps” and “precomps”.
The pattern-base values for “comps” and “precomps” should be respectively:
{project}_{episode}_{shot}_comp_v{version}/{project}_{episode}_{shot}_comp_v{version}
{project}_{episode}_{shot}_precomp_v{version}/{project}_{episode}_{shot}_precomp_v{version}
Note
We could also have used a single convention for both outputs by using the description token:
{project}_{episode}_{shot}_{description}_v{version}/{project}_{episode}_{shot}_{description}_v{version}
The pattern-path values for “comps” and “precomps” should be respectively:
/projects/{project}/{episode:ep\d+}/{shot:sh\d+}/comp/comps
/projects/{project}/{episode:ep\d+}/{shot:sh\d+}/comp/precomps
Warning
New tokens are currently not extracted from the pattern-path of output templates.
We will also check the append-passname-to-name and append-passname-to-subfolder boxes for “comps” so that we can automatically add the passname token to the subfolder and the base name.
This is how the settings dialog should look like:
Defining a project template¶
Let’s create a template to define the naming convention for the Conforming task.
Open the Setting Dialog and click on the “Project Resolvers” tab to create the template.
Click on the “+” button on the top-right corner to add a new template which is automatically named “Project1”.
Note
You can edit the name by double clicking on the “Project1” tab. You would then be able to type a new name and click enter to apply it. We will keep the automatic “Project1” name in this tutorial.
We want the Hiero project files to be named in the form of:
drWho_ep001_v001.hrox
Therefore, the pattern-base value should be:
{project}_{episode}_v{version}
The project
and episode
tokens should be extracted from
the folder structure. For instance, let’s consider the following location:
/projects/drWho/ep001/conform/hiero
The resolved tokens should be:
Token Name | Resolved Value |
---|---|
project | drWho |
episode | ep001 |
Therefore, the pattern-path value should be:
/projects/{project}/{episode}/conform/hiero
Like for the Compositing tasks, we can prevent any matching error by defining
custom regular expression for the episode
token:
/projects/{project}/{episode:ep\d+}/conform/hiero
We will also check the append-username-to-name box so that we can automatically add the username token to the base name.
This is how the settings dialog should look like:
Note
If more than one project template is defined, the first matching one will be used.
Saving the configuration¶
Apply to automatically save the new configuration into
~/.nuke/nomenclator.toml
.
Note
You could save the configuration into another location when you have writing permissions
by using the NOMENCLATOR_CONFIG_PATH
environment variable.
This is how the configuration saved should look like:
[[comp-templates]]
id = "Comp1"
pattern-path = "/projects/{project}/{episode:ep\\d+}/{shot:sh\\d+}/2D/scripts"
pattern-base = "{project}_{episode}_{shot}_{description}_v{version}"
match-end = false
[[comp-templates.outputs]]
id = "comps"
pattern-path = "/projects/{project}/{episode:ep\\d+}/{shot:sh\\d+}/2D/comps"
pattern-base = "{project}_{episode}_{shot}_comp_v{version}/{project}_{episode}_{shot}_comp_v{version}"
append-passname-to-name = true
append-passname-to-subfolder = true
[[comp-templates.outputs]]
id = "precomps"
pattern-path = "/projects/{project}/{episode:ep\\d+}/{shot:sh\\d+}/2D/precomps"
pattern-base = "{project}_{episode}_{shot}_precomp_v{version}/{project}_{episode}_{shot}_precomp_v{version}"
[[project-templates]]
id = "Project1"
pattern-path = "/projects/{project}/{episode:ep\\d+}/conform/hiero"
pattern-base = "{project}_{episode}_v{version}"
append-username-to-name = true
Note
You can directly edit the TOML configuration and send it to a team member to share it.
Managing the composition¶
Now you can open a new Nuke script and create two Write nodes.
Open the Comp Manager Dialog and browse to:
/projects/drWho/ep002/sh003/comp/nuke/
You can see that the names are automatically generated following the naming conventions defined in the previous sections.
Rename the “Write1” and “Write2” outputs respectively to “foreground” and “background”, and rename the passname similarly. Then change the destination of the “background” node to “precomps”.
No previous version of the script has been discovered with this naming convention, therefore the version token will be initialized to 1:
Save the script by clicking on “Apply”. You can now see that the nodes and name files have been updated:
Now when you re-open the Comp Manager Dialog, default values should be prefilled. As a previous version of the script exist with this naming convention, the version is now initialized to 2:
Save the script once again by clicking on “Apply”.
Managing the outputs¶
You might need to change the output without saving a new version of the Nuke script. This can be achieved by opening the Output Manager Dialog:
The corresponding nodes will be updated once clicking on “Apply”, but the version remains the same and the Nuke script will not be saved.
Managing the project¶
Now you can open a new Hiero script.
Open the Project Manager Dialog and browse to:
/projects/drWho/ep002/conform/hiero/
You can see that the names are automatically generated following the naming conventions defined in the previous sections.
No previous version of the project has been discovered with this naming convention, therefore the version token will be initialized to 1:
Note
The description token could also have been used, but it is currently using the same list as the Comp Manager, which might not make too much sense for projects. In the future, we might want to add a separate project description list.