Name Data Actions

Note

This is built for use with Blender. Things will likely not work correctly with other software.

Many actions require transform data to function. Use FBX files.

Name Data Actions is an opt-in system where the Unity Tools looks at the files you’re importing to automatically configure components based on the objects name.

This allows you to:

  • Model and configure tracks in a single program

  • Reduce the time you need to spend in the Unity editor

  • Rename objects and maintain BallisticNG component configuration

Opt In

To opt into the system, create an object in your modeling software called _Import:. There are several options which can be provided, which must be comma separated:

  • LightAll: All objects in the imported file will be automatically exposed to the lightmapper.

  • AutoConfig: Automatic configuration based on object names will be enabled.

  • KeepNames: Disables name stripping, allowing you to see the full input into AutoConfig. AutoConfig must also be enabled for this to do anything.

  • KeepMe: Keeps the _Import object.

Here are some examples of the import object name:

  • _Import: LightAll

  • _Import: LightAll, AutoConfig

  • _Import: AutoConfig

  • _Import: LightAll, AutoConfig, KeepNames, KeepMe

Syntax

Note

Any errors in parsing will be logged to Unity’s console.

Anything after a dollar sign ($) are processed in each objects name. Dollar signs also declare multiple actions, with each action being parsed after each dollar sign.

When duplicating objects in Blender, it’ll add a .number to the end of the name. This will cause malformed name data and throw errors. Attach a trailing dollar sign to the end of the name to bypass this.

Spaces are skipped when parsing actions unless they are part of a string literal. A string literal works like in programming languages. Wrap text in quotation marks "like this" for the text to be interpreted as is. This is useful for providing complex strings as values for variables, such as CSV data.

A backslash (\) is an escape. You can use escapes for ignoring the intended behaviour of special characters like the quotation mark. If you want to use a backslash itself, you’ll need to use a double backslash (\\). The first backslash is the escape, the second backslash is the escaped character.

Booleans are declared with true and false.

Parsing is case insensitive


After the dollar sign is the actions name, followed by flags deliminated by underscores and then a variable block. Flags and variables can be excluded if desired. Here are some examples:

  • Object Name$action_flag1_flag2[var1:value, var2:value]

  • Object Name$action_flag1

  • Object Name$action[var1:value]

  • Object Name$action

The variable block is defined by the open and close square brackets ([]). Variable declarations are comma separated, and variables are declared using the variable name, a colon (:), and then the value.


Here’s a simple example of how you might setup the object for terrain using the advanced terrain shader:

  • Terrain$lit_tan$flare_block

The first action $lit_tan is setting up a lightmapping options script and enabling the Encode In Tangents option. The second action $flare_block is setting up a flare occluder.

Here’s an example of setting up a push zone:

  • Pusher$push[space:localtozone, dy:1, gain:10, falloff:5]

Note

This is an open source system. You can modify, add to and share changes with others.

The source files can be found in Assets -> BallisticNG Tools -> Scripts -> NameData within your Unity project.