Go to: Synopsis. Return value. Keywords. Flags. MEL examples.

Synopsis

filePathEditor [-force] [-listDirectories string] [-listFiles string] [-nodeType string] [-preview] [-recursive] [-refresh] [-registeredNodeTypes] [-repath string] [-status] [-typeLabel string] [-withNode]

filePathEditor is undoable, queryable, and NOT editable.

Maya scene can reference and use external files, for example, texture files, reference other Maya scene files. This command is used to get information about files used in Maya scene. Now four kind of file types are supported: texture file, reference file, audio and image plane file. This command can list directories that contain files used by Maya and list files in each directory. This command can remap files to resolve the files in Maya scene. By specifying a target directory, the old file path can be replaced with the new path.

Return value

None

In query mode, return type is based on queried flag.

Keywords

filepath, editor, repath

Flags

force, listDirectories, listFiles, nodeType, preview, recursive, refresh, registeredNodeTypes, repath, status, typeLabel, withNode
Long name (short name) Argument types Properties
-registeredNodeTypes(-rnt) query
Query supported Maya node types. This command only processes file paths for supported Maya nodes.
-typeLabel(-tl) string query
Return localized string label of the specified node type

In query mode, this flag needs a value.

-nodeType(-nt) string query
Query the type of the node that is associated with a specified file.
-status(-s) query
Query the existence of a file or files under a directory. Used with flag "listDirectories" and "listFiles". For directory, its status depends on the files directly under it, not related to the files under its subdirectory. There are three status: 0 - file is nonexistent; for directory, the directory is nonexistent or all files under it are nonexistent; 1 - file exists; for directory, all files under it exist; 2 - only for directory. Some files under this directory exist, some are nonexistent.
-listDirectories(-ld) string query
List all subdirectories that contain files under one directory. If pass an empty string, all directories that contain files are returned.

In query mode, this flag needs a value.

-listFiles(-lf) string query
List files under one directory. Using flag "listDirectories" to get directory that contains files.

In query mode, this flag needs a value.

-withNode(-wn) query
Used with flag "listFiles" to return Maya node name that associated with the file. For example, if stone.jpg is connected to node "file1", then the string returned is an ordered pair : "stone.jpg file1".
-refresh(-rf) create
The information returned by this command will not be automatically refreshed as the scene is modified (although it will be cleared on file new). The refresh flag is used to clear the current path information so that it will be refreshed the next time the command is invoked.
-repath(-r) string create
Specify the new directory path to map files to.
-preview(-p) create
Used with flag "repath". Return the status which indicating the existence of the file and the new file path after repathing. The status and the path name will be listed in pairs.
-recursive(-rc) create
Used with flag "repath". Search files in the remapping target directory and its subdirectories recursively. If it is on, only remap files if file with same name can be found in the target path and its subdirectories. If it is off, remap old file paths with the target path, i.e., simply replace the old file paths with target path.
-force(-f) create
Used with flag "repath". Specify to do remap for all files, including existing resolved files. If it is off, only remap missing files. Default is off.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

//List all directories that include files that are used in Maya scene.
//
filePathEditor -query -listDirectories "";
//List all directories that include files that are used in Maya scene
//under specified directory.
//"status" flag will return the status if the files directly under this
//directory exist or are missing.
//
filePathEditor -query -status -listDirectories "c:/textures/";
//List files used in Maya scene under the specified directory directly.
//
filePathEditor -query -listFiles "c:/textures/";
//List files under specified directory directly.
//"withNode" flag will return associated Maya node.
//"status" flag will return status to indicate if the file exists
//or is missing.
//For example, if "stone.jpg" exists and is connected to node "file1",
//then the string returned is an ordered pair: "stone.jpg file1 1".
//
filePathEditor -query -withNode -status -listFiles "c:/textures/";
//Return localized string of the specified node type: audio, file,
//reference and imagePlane.
//
filePathEditor -query -typeLabel "imagePlane";
//Currently, we support four kind of file types:
//file(type of texture), reference, audio and imagePlane.
//This flag returns above four types.
//
filePathEditor -query -registeredNodeTypes;
//Query the node type of the Maya node, i.e., which kind of file
//the node is associated to.
//This returns one of the types: file(type of texture), reference,
//audio or imagePlane.
//
filePathEditor -query -nodeType "file1";
//Refresh all file path information collected from Maya scene.
//
filePathEditor -refresh;
//Get associated files used by the specified Maya nodes, and
//find and remap files in the new path.
//"force" means to remap all specified files.
//"recursive" means to find files in the new path and its subdirectory
//recursively. That is, only remap old file to existent new file with
//same file name.
//
filePathEditor -repath "e:/textures/" -force -recursive file1 file2
//Get associated files used by the specified Maya nodes, and
//remap missing files to the new path.
//
filePathEditor -repath "e:/textures/" file1 file2
//With the "preview" flag, only return the remap result, but do not do
//the remap.
//The result involves the file name and its status flag indicating if the file
//exists. They are listed in pairs.
//
filePathEditor -preview -repath "e:/textures/" file1 file2