Give Page Feedback | API

Scriptable Assets - Naming Convention

The Naming Convention Asset is a special Scriptable Object that can be created to change the format used/expected by several different tools, components, and other scriptable objects where Asset Chunks are being used. When I speak of format, I am referring to the format of object/asset names.

You will see Naming Convention fields throughout several of our products, and for each of these fields, you can utilize a single Naming Convention asset, even across the different products.

With that said, providing a Naming Convention asset is optional. Our products create a default naming convention for Naming Convention fields that are null, and in 99% of cases, that default format will function perfectly.

Creating A Naming Convention Asset

You can create this asset by selecting from the Top Menu Bar:

Assets -> Create -> Deep Space Labs -> Core -> Naming Convention

Creating A Naming Convention From The Top Menu Bar GIF

or by right clicking a folder (or inside a folder) within the Project Hierarchy and selecting from the pop up menu:

Create -> Deep Space Labs -> Core -> Naming Convention

Creating A Naming Convention From Right Click GIF

By default this Asset is given the name NamingConvention, however we recommend changing this name to something that will better help you differentiate it with other Naming Convention Assets in the future.

What's In A Name?

The Streamable Assets Manager uses Naming Conventions to programmatically construct Asset Chunk Names at runtime. The way it does this is via the same logic employed by the String.Format method, whereby special characters are replaced by runtime data and combined with literal string characters to produce a final string.

There are several special characters available to you in defining the naming convention, each replaced by different runtime data in order to produce the Asset Chunk Names:

1) %g - Replaced by an LOD Group's Group Name.

2) %y - Replaced by a Streamable Cell's Row Number.

3) %x - Replaced by a Streamable Cell's Column Number.

4) %z - Replaced by a Streamable Cell's Layer Number (only necessary if the Asset Chunk Group is 3D!).

5) %c - Replaced by the Chunk Number of the Asset Chunk, in situations where Multi-Chunking is being used.

Any other characters not listed above will be treated as literal characters and placed into the outputted Asset Chunk Name string as they appear in the format string.

--Why Not Write Out The Group Name Rather Than Use %g?--
If you were to write out the Group Name for an Asset Chunk Group as literal characters in the Format Fields (see below), you would need to create a unique Naming Convention asset for each Asset Chunk Group. By using special characters (%g), the Streamable Assets Manager is able to use a single Naming Convention for multiple Asset Chunk Groups, reducing the number of unique Naming Convention assets you need to create.

First Chunk Format Field

This field contains the format to use for the first Asset Chunk for every Streamable Cell. Even if a Cell uses Multi-Chunking, it's first Chunk will always utilize this format. If the %c special characters are placed in this format, they will be treated as literal characters rather than replaced by a Chunk Number, therefore it is generally a good idea to leave those special characters out of this format.

Supplemental Chunk Format Field

Each Naming Convention has a Supplemental Chunk Format field which defines a unique format to be used by Asset Chunks 2, 3, etc. for any given Streamable Cell. While the first Asset Chunk in a multi-chunked Cell will always utilize the First Chunk Format, Chunks 2 and greater will always utilize this format. This format must contain the %c special characters or else you will see a 'Invalid' message below the field.

0 Based Numbering

The first Asset Chunks associated with the first Streamable Cell (Row 1, Column 1, Layer 1) in a Streamable Grid will typically start their naming with 1. For example, the first slice produced by the Terra Slicer tool will typically be named GroupName_1_1.

Some 3rd party programs and Asset Store Products produce Assets that begin at 0 rather than 1. If that is the case with your Assets, you can enable the Numbering Starts At 0 setting.

Default Formats

If no Naming Convention asset is provided to a Naming Convention field, the Streamable Assets Manager is able to auto generate default formats that work in 99% of cases. This makes creating/adding Naming Convention assets a task that needs doing only in special circumstances, reducing your overall workload.

There are a few Default Formats, which are automatically and correctly generated based on whether your Asset Chunk Groups/Streamable Grids are 2D or 3D. These Formats include:

2D First Chunk Format: %g_%y_%x

2D Supplemental Chunk Format: %g_%y_%x_Chunk%c

3D First Chunk Format: %g_%z_%y_%x

3D Supplemental Chunk Format: %g_%z_%y_%x_Chunk%c

2D vs 3D

When the Default Naming Conventions are used, whether your Assets are 2D or 3D can be determined programmatically. If you are using a custom Naming Convention Asset, however, this is not the case, and you will need to ensure your Formats either contain (for 3D Assets) or omit (for 2D Assets) the %z special characters.

Additional Considerations

It is recommended to avoid placing numbers and brackets { or } in your format string, as it can complicate things for the World Designer tool and cause it to not work correctly! If you do use numbers, do not place them inside brackets and do not place them next to any of the special characters that will be replaced by a number (%y, %x, %z, %c). That is, making sure there is at least one literal character between the literal number and the special character.

--Upgrade Note--
The Naming Convention asset has changed a little bit with the introduction of Multi-Chunking. Take a look at the Naming Convention Upgrade Section in the Upgrading Chapter for a list of changes you will need to take into account. Note that all Naming Conventions previously used will need to be reproduced!

Upgrading Naming Conventions