IN THIS ARTICLE
Move or Delete Assets with Asset Processor Batch
There are many reasons that you might decide to move or delete assets during development of your project in Open 3D Engine (O3DE). If assets are moved manually, all of the references in Asset Processor are broken and the asset references must be manually updated. The Asset Cache is invalidated and has to be rebuilt, even if the assets haven’t changed.
To support asset relocation and removal, the Asset Processor Batch tool offers the
--delete commands. These commands can move or delete assets and update references in Asset Processor so the Asset Cache does not become invalidated.
Some assets that contain references may be in a binary format. For example,
.fbxfiles can be either ascii or binary format. References in binary format files are not automatically updated.
Because moving or deleting files might be a destructive operation, the
--deletecommands require an additional
--confirmoption to perform the operation. Using either command without the
--confirmoption only provides a preview of the results of the command.
You can use the
--move command below with Asset Processor Batch to move source assets in your project.
Use the below guidance when specifying
ToPath arguments to move assets.
ToPathcan be absolute paths or paths relative to a scan directory root, such as a project or Gem directory.
- The specified paths must refer to files, not directories. To rename a directory, use directory names with wildcards (
*) , for example,
ToPathmay contain wildcards that match any number of characters in a file or directory name at the current level. If the path ends with a wildcard, it recursively matches any number of characters at any directory level at or below the wildcard’s level.
ToPathmust contain the same number of wildcards.
The examples below illustrate how to use wildcards with the
|A wildcard at the end of a path recursively matches every file contained in a directory. It includes the contents of all subdirectories as well.|
|A wildcard in a file name matches every file at that directory level. In the example, every file with a |
|A wildcard at the end of a directory name won’t match any directory or file. Paths must refer to files since directories are not tracked in source control.|
You can use the
--delete command below with Asset Processor Batch to delete source assets in your project.
Use the below guidance when specifying a path argument to delete assets.
- The path can be an absolute path or path relative to a scan directory root, such as a project or Gem directory.
- The specified argument must refer to files, not directories. To delete a directory, use the directory name with a wildcard, for example,
- The path may contain wildcards that match any number of characters in a file or directory name at the current level. If the path ends with a wildcard, it recursively matches any number of characters at any directory level at or below the wildcard’s level.
You can use the additional command line options below when you move or delete assets with Asset Processor Batch.
|Performs a move or delete, modifying files on disk. Without this, move and delete only provide a preview of the result.|
|By default, empty folders are removed, even during a |
|By default, move and delete commands fail if there are broken dependencies. This forces the action to proceed despite broken dependencies.|
|This option is only available with the |
|Source Control Management is disabled by default in Asset Processor Batch. This enables the source control plugin so that the command can checkout files for edit/move/delete as appropriate.|