Fusion “Change Strings” Script – Batch Change Names, Expressions, Filepaths

Page 1 – Manual

Change Strings has been updated last on 08.09.2020 to version number 1.4.1

Change Strings can batch change or rename most strings, meaning text, in Blackmagicdesign Fusion and Fusion inside DaVinci Resolve. These strings are Tool/Node names, expressions, and filepaths. Simply write the text you want to replace (or delete) into the designated Search for and Replace with Text fields. Make sure you have all the tools selected on which you want the search and replace operation to be performed and press OK.

You can download this script here, or in the Downloads area on the next page. There you will also find a Changelog and Legacy Versions.

Download Change Strings

Learn here how to install scripts in Fusion or DaVinci Resolve.

Change Strings is my first attempt at teaching myself scripting, and the programming language Lua, for Fusion.

This page serves as an in depth manual of the script as well as the download page.

Change Strings supports an unlimited number of find and replace operations in the same session and is even capable to switch patterns around, all thanks to the Pattern Breaker (more about this in the Advanced Settings section here). Another great feature is, that Change Strings will respect your large and lower case letters even with case sensitivity disabled.

Make sure to check out the Advanced Searches as they will help you find and replace much quicker. For example, to remove the annoying numbers that Fusions appends to tool names when they are copied.

I created this script for my own personal use, but after putting more and more functionality into it, I decided to make it publicly available for free. After the initial release, I found myself obsessing over the user experience and new features which ended in Change Strings 1.2. Pretty much all bugs have been ironed out and you should have a great experience without any issues with this script. But of course, please message me in case there are any.

Feature requests are also welcomed as they will help me improve the script and ultimately the Fusion experience for all of us.

You can watch Change Strings in action in this video:

Or read about changing Names and staying organized here. And a separate blog post about changing filepaths and filenames can be found here.

Change Strings Main Window

Change Strings find and replace in Fusion or DaVinci Resolve

About Button

The About Button will open a new window with some information about the script and some advanced settings. Jump to the About window explanation by clicking here.

Search for and Replace with Text field

( Jump down to removing numbers ↧ )

As the names suggest, these are the text fields where the user (you) can write in all the searches you want the script to perform. You can separate different searches by using a space between words (or patterns). Users of Houdini might be familiar with this type of list-separation.

It is important to understand how Change Strings works to take full advantage of its features.

General Search Behavior

If you are looking for the shortcodes, or Advanced Searches, click here.

Let’s say we have this set of nodes in our flow and want to perform a very simple Search and Replace Operation.

Node Flow in Fusion

First, we decide to get rid of the long names. We want to change all “Element” into a simple “E”. Change Strings will simply search for every tool that has “Element” in its name and change it to “E”.

Change strings search behavior

Easy enough. This will result in this:

Change Strings changed node flow

But let’s do a more interesting example. We want to change all “Merge” into “Combine” and the first Merge7 should be called “Combine_A” and the second “Combine_B”. For this, we will put this into Change Strings (I have colored the different Searches to more easily show the concept):

Multiple Searches in Change Strings

I have separated the different searches with empty spaces in between the different patterns. As you can see, Change Strings will use the first Search for Input and replace it with the first Replace with Input, then it will use the second inputs and so forth. Notice that “7” and “7_1” are two completely different patterns for the Search and Replace operation which we can use for our advantage. But, we need to make sure, that it changes “7_1” before changing “7”. Otherwise, it would change “Merge7_1” to “Combine_A_1” before searching for “7_1”.

(Sounds more complicated than it is. If you’ve ever used a Search and Replace tool in another software, you will understand this.)

This results in these names:

Results of Multiple Searches in Change Strings

You may be wondering what happens if you search for more patterns than you want to replace. And yes, this is possible as well. Let us assume we want to change “Text” to “Heading” and we want both “Blue” and “Red” to be called “Background”. This is what we would need to put into Change Strings:

Multiple Searches in Change Strings with less Replace inputs

As you can see, if there are more Search for Inputs than Replace with Inputs available, Change Strings will simply use the last available Replace with Input. This would result in these node names:

It’s important to note, that Fusion can not have two nodes with the same name. This is why the second “Background_E_1” has gotten an additional “1”. This is the default Fusion renaming behavior. We could use Change Strings to replace “11” with “2” but in this case it would be easier to just rename it ourselves.

Also, if you put in more Replace with Inputs than there are Search for Inputs, then Change Strings will simply ignore the Inputs that don’t have a corresponding Search Input.

Advanced Searches

Change Strings was written in Lua, this means that we have access to additional search shortcuts that are built into the programming language. These are the ones that are supported:

%aletters (Using this will most likely have you run into the Max Replace Limit, learn more here )
%ddigits (Very useful for removing the digits Fusion creates by copying nodes, a mini-tutorial is right below)
%lall lower case letters
%uall upper case letters
%ppunctuation characters (Like “, . ; : _”)
%sspace characters (The recommended way of removing only a space would be to type a space into the Search for field. But this is handy if you want to search for a pattern that contains a space character)

These shortcodes also work the other way around. For example, “%S” (uppercase letter) would search for all characters that are NOT spaces. And “%D” would search for all characters that are NOT digits.

If you are familiar with Lua you might know about the shortcode “.”. This would usually force Lua to replace all characters. This was disabled and instead changed to search and replace for dots “.” instead. I believe this is the wanted behavior in most cases.

Percentage signs “%” and text containing percentage signs can be searched and replaced since the update to Change Strings 1.3. Change Strings will notice when you are using one of the supported shortcodes above and still perform the correct operation.

Remember you can search for something like “Text%sin%sFusion” which would search for the string “Text in Fusion”, if you want to replace or remove this text including the spaces in between.

Searching for “Text in Fusion” would replace the individual words but leave the spaces in between.

The most useful is definitely “%d” as shown in the mini tutorial below:

Removing the numbers from copied nodes

( Jump up to About Button ↥ )

( Jump down to Replace in Settings ↧ )

Everyone using Fusion knows that when you copy a node, Fusion will append a number to the name. This is important so that each node has a unique name, but it can be annoying to remove them, especially if you start to copy copies. Let’s look at the following (horrific) example. I use the Advanced Searches to remove the digits. These are our nodes:

Copying nodes append more and more numbers to the node names

We simply search for “%d” and will replace it with nothing which will give use this:

Much better!

Switch Button

Switch Button

This button will switch the Inputs from the Search for or Replace with fields.

Replace in Settings

Replace in Settings in Change Strings

Texts:

Names

Checking this will make Change Strings search and (if it finds) replace the patterns in all the names of the currently selected nodes. This includes pipe routers but excludes Modifier names, as those are “not selected” when you are selecting a node. I will look into this at some point.

Remember that Fusion does not support spaces in tool/node names. They are not changed to “_” either. Many other characters like “#, *, ~” are not supported in tool names as well.

Expressions

Checking this will make Change Strings search and (if it finds) replace the patterns in all the Expressions of the currently selected nodes. This excludes Modifier Expressions or the Expression Modifier, as those are “not selected” when you are selecting a node. I will look into this at some point.

Expressions are the most likely place where you could be confronted with the Max Replace Limit, which is explained here.

Styled Text

Checking this will make Change Strings search and (if it finds) replace the patterns in all the Styled Text Textboxes of the currently selected nodes. Notable example are the Text+ and Text3D Tools. But theoretically fuses and macros that use the same naming convention as the Text+ Tools will work, too.

Filepaths:

Loaders

Checking this will make Change Strings search and (if it finds) replace the patterns in all the Filename text inputs of the currently selected Loaders.

It will remember the previous Loader settings such as TrimIn or Hold last frame. Change Strings 1.2 which includes support for Proxy filenames and the QuickSelection feature make this a great alternative to the popular Change Paths script. Since you get all the benefits of Change Strings find and replace operation with the ease of quickly doing this on all Loaders.

Proxys

Checking this will make Change Strings search and (if it finds) replace the patterns in all the Proxy text inputs of the currently selected Loaders.

It will remember the previous Loader settings such as TrimIn or Hold last frame. Change Strings 1.2 which includes support for Proxy filenames and the QuickSelection feature make this a great alternative to the popular Change Paths script. Since you get all the benefits of Change Strings find and replace operation with the ease of quickly doing this on all Loaders.

Loaders

Checking this will make Change Strings search and (if it finds) replace the patterns in all the Filename text inputs of the currently selected Savers.

Change Strings 1.2 which includes the QuickSelection feature makes this a great alternative to the popular Change Paths script. Since you get all the benefits of Change Strings find and replace operation with the ease of quickly doing this on all Savers.

Settings

Be Case Sensitive

Enabling this will force Change Strings to only replace patterns that have the same capital and lower letters as your Search for Inputs.

Disabling this means that Change Strings will ignore capital or lowercase letters in its search, but as mentioned before, it will not convert everything lowercase and the replacement will keep its correct upper case letters.

This is achieved by temporarily converting the string and the search lowercase, then searching for the location of where it is found, cutting out this pattern in the original string, and finally using this pattern to replace it with the desired new string. This is repeated until either the search string is not found again or the Max Limit is reached. Usually, the Pattern Breaker will ensure that the Max Limit is not reached. (Learn about the Max Limit here)

Change Strings will change its behavior on the fly if it detects a situation in which the Case sensitive mode would be of benefit. For example, when using Advanced Searches.

Include Modifiers

Attention: This is a Tristate Checkbox. Meaning it supports 3 states instead of the normal 2! These are unchecked, checked and partially checked! In this case it will transition from unchecked to checked to partially checked. This is simply for a consistent UI experience.

Enabling this will include connected Modifiers of the currently selected tools in the search and replace operation. Names and Expression can be changed on Modifiers.

Clicking on it again will change the text and visual appearance of this checkbox to Only Modifiers and partially checked. This is to indicate that Change Strings will ignore the visibly selected tools and perform its search and replace operation only on the Modifiers of the currently selected tools.

I have chosen not to include other connected tools. For example, a Tracker tool could be connected to the Center inputs of a Transform tool. But it will not be included in the search as long as it is not properly selected. This is because I want to remove unnecessary confusion. Connecting the Center to a Tracker Modifier on the other hand would, of course, include it in the search.

Remember Inputs

Enabling this will save your current settings and inputs in Change Strings, but only if you let it run by pressing the (now properly named) OK and Save Button.

Change Strings in Fusion Standalone will, by default, save all the data locally into the current composition file. This means, if you have not yet saved your project, it will prompt you to do so. Also, you will keep your settings even if you open the composition on a different computer.

You can change this behavior to save the settings globally into the Fusion Preferences file. This means you will keep your Change Strings inputs even if you switch compositions. Of course, you can always switch back to locally saving. (Jump down to Advanced Settings)

Change Strings in DaVinci Resolve will always save its settings into the Fusion Preferences file. There is currently no way of changing this. (Why is explained here)

The Remember Inputs Checkbox will always remember its last state. This is because you might not want to overwrite or save your current search a few times in a row. I know I did, which is why this feature exists.

If you open your .comp or Fusion Settings file in a Text Editor, you will be able to see the Data that Change Strings has written. It’s located in:

Prefs = {
Comp = {

ChangeStrings = {}

Usually at the end of the file.

You can delete these settings manually if you don’t want anybody to know you’ve used my script. Just make sure you’ve not accidentally deleted or left too many “}” as this will corrupt your comp file until you’ve manually fixed this.

Stay open

As the name indicates, this will force Change Strings to stay open and await new commands.

OK and Cancel Button

OK

This should be self-explanatory. OK will run the script on all selected nodes. If you have Remember Inputs checked, then this button will change into OK and Save and run the script, and once it’s finished, it will save the composition so it can save the Change Strings settings as well.

In DaVinci Resolve it will save the Project. This is not necessary but there is no Live-Saving inside the Fusion page, so why not save it once more.

Cancel

This will simply close the window and not save any Inputs, even if Remember Inputs is selected. If you want to save them you can let the script run without having any nodes selected.

About Window

Change Strings About Window including the Advanced Settings

The About Window features some (very necessary) self-promotion as well as a little help. But most importantly, this is where you can change the mysterious Advanced Settings you’ve heard about. This is the Pattern Breaker, Max Replace Limit, Force Resolve/Global mode and since Change Strings 1.2 the Print Actions checkbox.

You see how reluctant I am to give you access to these settings, due to the additional Show Advanced Settings Checkbox you have to conquer beforehand.

Pattern Breaker

What is the Pattern Breaker?

The Pattern Breaker is a very important and integral part of this script. It ensure that Change Strings only runs as often as it has to and that you can replace several different versions of a pattern in the same string. For example, imagine you have a node that is called “Pear_APPLE_pear” and you want to change it to “PEAR_APPLE_PEAR”. You could enable Be Case Sensitive and Search for “Pear pear”. But that requires you to type in both variants of “Pear”.

If we were to disable Be Case Sensitive and only Search for “pear” then Change Strings would only find the first “Pear” over and over due to the way it searches and replaces in this mode (more about this here ). This would eventually be stopped by the Max Replace Limit but it still wouldn’t replace beyond the first “Pear”.

This is where the Pattern Breaker comes into play. Instead of replacing the first “Pear” with “PEAR”, it uses “PEïèëAR”. So now our node is called “PEïèëAR_APPLE_pear”. Change Strings will repeat this operation and now it will find the second “pear” and again replace it with “PEïèëAR”. After this, our node is called “PEïèëAR_APPLE_PEïèëAR”. It will repeat this operation again but realize that it can’t find any more variations of the pattern “Pear” and stop the loop.

Once it’s certain the pattern is nowhere to be found (or the Max Limit is reached) it will remove the Pattern Breaker to reveal the desired name/expression/filepath.

This also is the reason why Change Strings can switch patters around without breaking a sweat (or falling into an endless loop).

There are of course fringe cases where the Pattern Breaker is not enough. For example. If your node is called “Pear_ar” and you want to replace “Pear” with “PEAR” and “ar” with “BB”. This would eventually lead to the name “PEBB_BB”. In this case, enabling Be Case Sensitive would give you the desired result, but I hope you understand what happened if you run into this issue.

Changing the Pattern Breaker

The default Pattern Breaker is “ïèë”. Which I chose because it’s very difficult to type on most keyboards and as far as I know not a word. But if you really need to change it, then I want to give you the ability to do so.

You can type any string into the designated field and hit the OK (Saves the composition) Button.

Do not add spaces or special characters like ‘#’ into this field. This would stop this script from working on names since those do not support those characters. If you’ve decided to change the Pattern Breaker, see if it would theoretically work as a node name, then you can use it as a Pattern Breaker.

Note that by default, in Fusion Standalone, this will only be saved in the current composition file. If you find yourself needing the pattern “ïèë” a lot and want to be able to switch between local and global saving, then you need to change this in the script itself.

Change Strings in DaVinci Resolve only works in global mode. Changing anything in the script is not necessary (but of course possible).

For this you can simply click on Script>Edit>ChangeStrings, in Fusion Standalone.

Script>Edit>ChangeStrings

This will open a Text Editor in which you can change all “ïèë” to whatever you want to use. There is a level of redundancy built into this to make sure that there is always a Pattern Breaker, so make sure you replace it everywhere.

If you need to edit the Script and are using DaVinci Resolve, then you need to manually locate the script in your file browser and open it in a Text Editor.

Max Replace Limit

What is the Max Replace Limit?

It stands for Maximum Replace Limit in case you didn’t notice. Whenever you run Change Strings, not in Case Sensitive mode, it will repeat the search until it can’t find the string anymore. This can (in fringe cases) lead to endless loops. That’s why there is an upper limit to how often it can try to replace a pattern. You can see it count in the console.

Since Change Strings 1.2 this also limits the search and replace operations if it is in Case Sensitive mode. This ensures that Change Strings is virtually unable to crash. Please send me a message if it does anyway.

This means if you have an Expression that is “aaaaaaaaaaaaaaaah” and you want it to be angrier like “AAAAAAAAAAAAAAAAh”, then Change Strings would always find another “a” in the Expression and run until it reaches the Max Limit.

Changing Max Replace Limit

If for some reason, you find that Change Strings wasn’t able to complete its job due to reaching the Max Replace Limit, then you can increase the value in the designated field. If you have Print Actions enabled then you would see the following message in the console:

Change Strings Max Limit Reached Console message

Just run the script again or increase the Max Replace Limit.

Note that by default, in Fusion Standalone, this will only be saved in the current composition file. If you find yourself exceeding the default value of 30 a lot and want to be able to switch between local and global saving, then you need to change this in the script itself. See Changing the Pattern Breaker to learn how.

Change Strings in DaVinci Resolve only works in global mode. Changing anything in the script is not necessary (but of course possible).

Force Resolve Global Mode

Fusion Standalone

This Checkbox is only visible for Fusion Standalone users. As long as this is enabled, Change Strings will save its Inputs not into the current composition file but into the global Fusion Preferences. This means, that you will keep the inputs of Change Strings even if you switch between compositions.

Note, that this is also a global setting. Disabling this will disable this for every composition, and the other way around.

There is no harm in only enabling this if you need to. As I believe, that saving these settings into the composition file is usually preferred.

DaVinci Resolve

In DaVinci Resolve, local saving to the composition is not supported because it does not save Fusion compositions. You can export them, yes. But internally I can’t save the preferences to any composition file. This is why currently Change Strings will always save its settings globally and there is no way of changing this through the UI. The script would need to be rewritten. But let’s be honest, it does not limit Change Strings actual job, finding and replacing text.

Print Actions

This is enabled by default and means that most actions of Chang Strings will be visible in the console.

Disabling this will reduce the amount of console messaged drastically without changing any functionality. Please enable this if Change Strings did not work as intended.

This should explain everything, but of course, If you have any questions or requests, drop a comment down below!

On the next page is the Download link, Changelog and some more background information

Quickly share this!

Subscribe
Notify of
guest
4 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Scroll to top
4
0
Would love your thoughts, please comment.x