RenameFiles
Renames files, with options for changing prefixes and suffixes, searching & replacing, replacing extensions and defining arbitrary names using expressions or spreadsheets.
Tip
Use the CopyFiles node to copy or move files between directories.
user
Container for user-defined plugs. Nodes should never make their own plugs here, so users are free to do as they wish.
preTasks
Input connections to upstream nodes which must be executed before this node.
postTasks
Input connections to nodes which must be executed after this node, but which don’t need to be executed before downstream nodes.
task
Output connections to downstream nodes which must not be executed until after this node.
dispatcher
Container for custom plugs which dispatchers use to control their behaviour.
dispatcher.batchSize
Maximum number of frames to batch together when dispatching tasks.
If the node requires sequence execution batchSize will be ignored.
dispatcher.immediate
Causes this node to be executed immediately upon dispatch, rather than have its execution be scheduled normally by the dispatcher. For instance, when using the LocalDispatcher, the node will be executed immediately in the dispatching process and not in a background process as usual.
When a node is made immediate, all upstream nodes are automatically considered to be immediate too, regardless of their settings.
dispatcher.tractor
Settings that control how tasks are dispatched to Tractor.
dispatcher.tractor.service
A Tractor “service key expression” used to select blades on which tasks will be executed.
files
The list of files to be renamed. It is common for this to be driven by a FileList node.
name
The new name for the file. If this name is non-empty then it takes precedence, and all other renaming operations are ignored.
Tip
The following context variables are defined when evaluating this plug :
source: The full path to the file being renamed.source:stem: The name of the file being renamed, excluding the extension.source:extension: The extension of the file being renamed.
deletePrefix
A prefix to remove from the start of the original name. Prefixes are removed before the suffixes and before the find and replace operation is performed.
deleteSuffix
A suffix to remove from the end of the original name. Suffixes are removed before the find and replace operation is performed.
find
A string to search for within the original name. All occurrences of this string
will be replaced with the value of replace. When useRegularExpressions
is on, the search string is treated as a regular expression, with the
following syntax :
Matching
.: Matches any character.[aef]: Matches any character in the set.[^aef]: Matches any character not in the set.[a-z]: Matches any character in the specified range.[[:digit:]]: Matches any numeric digit.[[:space:]]: Matches any whitespace character.
Repetition
*: Matches the preceding pattern any number of times (including none).+: Matches the preceding pattern 1 or more times.{N}: Matches the preceding pattern N times.{M,N}: Matches the preceding pattern between M and N times.
Alternatives
A|B: Matches either pattern A or pattern B.
Captures
(): Captures the subgroup of the pattern within the brackets, allowing it to be referenced by{}in thereplacestring.
replace
The replacement for strings matched by the find plug.
When useRegularExpressions is on, this can refer to
captured patterns using Python’s standard string formatting
syntax :
{0}: The entire string matched by the regular expression.{1}: The 1st subgroup captured within()brackets by thefindstring.{N}: The Nth subgroup captured within()brackets by thefindstring.{1:0>4}: The 1st subgroup, aligned to the right and padded to width 4.
useRegularExpressions
When on, the find string is treated as a regular expression,
allowing it to perform complex pattern matching and to capture sections
of the match to be referenced by the replace string.
addPrefix
A string to add at the start of the name. Prefixes are added last, after the find and replace operation has been performed.
addSuffix
A string to add at the end of the name. Suffixes are added last, after the find and replace operation has been performed.
replaceExtension
Replaces the file extension with the one specified
by the extension plug.
extension
The new extension to be used when replaceExtension is on.
overwrite
If a file already exists at the destination, then overwrites it rather than erroring. Defaults to off, to reduce the chance of accidental data loss.