Rename

Description

Rename Blender data of a specified Data Type.

Options

Rename operation consists of 3 sub-operations.

  • Replace
  • Numerate
  • Change Case

Replace

Replace allows you to replace any part of the matched name with a different value. The matching algorithm is described here.

The replacement value can be one of three types:

  • Text — plain UTF-8 encoded text.
  • Relative RNA Value.
  • Absolute RNA Value.

The RNA value refers to the value of a built-in property or property of Blender data.

You can specify which type of replacement value you want to use by setting the Replace Name Source option.

Replace sub-operation.
Replace sub-operation with regular expression matching mode.

If the value of the Replace Name Source option is Text:

  • the value entered in the Replace With field will be used to replace the matched value as is.

If the value of the Replace Name Source option is either Absolute RNA Path or Relative RNA Path:

  • the value entered in the Replace With field will be used to retrieve the RNA value of Blender data.

The RNA value refers to the value of a built-in property or property of Blender data.

Relative and Absolute RNA Value Retrieval Mechanism

If you've ever worked with Drivers in Blender, the Relative RNA Path is equivalent to the Path property of a Single property type Driver variable inside the Drivers Panel. If you want to rename Objects and you enter location[0] in the Relative RNA Path, the Replace sub-operation will fetch the Location X value of each Object being renamed and use this value for further name processing.

The Absolute RNA Path differs from the Relative RNA Path in that the Absolute RNA Path is resolved from the bpy module. E.g.: If you want to add the name of the active scene to some Objects, you would have to enter bpy.context.scene.name in the Absolute RNA Path.

You can easily find RNA data paths of many Blender properties by right-clicking on a property of interest in Blender property panels:

  • Copy Data Path will copy the Relative RNA Path.
  • Copy Full Data Path will copy the Absolute RNA Path.
RNA Data Paths can be easily retrieved from the context menu of Blender properties.

The RNA name of the property, based on a subset of Python attribute access syntax. For example: location.x or location[0] for the raw X location value, or ["prop_name"] for a custom property's value.

Numerate

Numerate allows you to replace any part of the matched text with a generated numerical or alphabetical value of the item's position in the item selection. The matching algorithm is described here.

Numerate sub-operation configured to use numerical values.
Numerate sub-operation configured to use the alphabetical values.

Change Case

Change Case allows you to change the style of the name to one of the common industry naming conventions.

Available options:

  • Lowercase — Change all letters to lowercase.
  • Uppercase — Change all letters to uppercase.
  • Snake Case — Replace space, dot, or dash special character separating the words with an underscore character and change all letters to lowercase. E.g.: snake_case.
  • Camel Case — Remove space, dot, underscore, or dash special character separating the words and capitalize the first letter of a compound word, besides the first word. E.g.: camelCase.
  • Pascal Case — Remove space, dot, underscore, or dash special character separating the words and capitalize the first letter of a compound word. E.g.: PascalCase.
  • Kebab Case — Replace space, dot, or underscore special character separating the words with a dash character and change all letters to lowercase. E.g.: kebab-case.
  • Title Case — Insert a space character between words without a separating character or replace space, dot, or underscore special character separating the words with a space character and capitalize the first letter of every word. E.g.: Title Case.
  • Sentence Case — Insert a space character between words without a separating character or replace space, dot, or underscore special character separating the words with a space character, capitalize the first letter of the firs word, and set all other letters of of other words to lowercase. E.g.: Sentence case.

Camel and Pascal Case Options

In some scenarios, a name we want to change to either camel or pascal case, may contain a sequence of numbers separated by a separator, e.g., sf_corridor_wall_300_300_01a — the two numbers here indicate the X and Y dimensions of the corridor wall asset, and the 01A represents the asset variation. If we were to convert this type, which seems to follow the snake case naming convention, to either camel case or pascal case, the resulting name would end up with the numbers concatenated together: SfCorridorWall30030001a. This may not be desirable because its difficult to distinguish where each number starts and ends.

There is an option designed to overcome this problem:

  • Number Separator — specify a UTF-8 encoded character to use as a separator between numbers.

Name Processing Flow

Name processing starts with the current value of a Data Type item. It is passed as an input to the first enabled sub-operation. This sub-operation processes the input with regard to its options and outputs the result for the next enabled sub-operation in the chain. The last sub-operation's result is finally applied to the Data Type item.

Each sub-operation takes the processed value of the previous sub-operation as its input, modifies the input based on its own properties, and outputs the modified value for the next step in the chain.

Supported Data Types

Operation is supported for:

  • Action
  • Asset Tag
  • Attribute
  • Armature
  • Bone
  • Bone (Edit)
  • Bone (Pose)
  • Brush
  • Camera
  • Collection
  • Constraint
  • Curve
  • Custom Property
  • Driver
  • Driver Variable
  • Grease Pencil
  • Hair
  • Image
  • Lattice
  • Light
  • Light Probe
  • Material
  • Mesh
  • Metaball
  • Modifier
  • NLA Strips
  • NLA Tracks
  • Object
  • Scene
  • Sequence Strip
  • Sound
  • Speaker
  • Texture
  • UV Map
  • Vertex Group
  • View Layer
  • Volume
  • World

Looking to solve your problem?Shoot me a message and I'll let you know how I can help.