MEL#PROC#获取maya当前文件的各种路径

global proc string[] scenesNameAndPath(){
    //获取当前文件长路径,无MB路径,无文件名路径,文件名,无MB文件名,拍屏文件名,有文件名的拍屏路径
    string $sceneShortPath;
    string $sceneLongPath = `file -q -sceneName`;
    string $sceneName = `file -q -shn -sceneName`;
    $sceneShortPath = `substitute $sceneName $sceneLongPath ""`;
    string $sceneNameNoMB = `substitute ".mb" $sceneName ""`;
    string $sceneLongPathNoMB = `substitute ".mb" $sceneLongPath ""`;
    string $buff[];
    tokenize $sceneNameNoMB "_" $buff;
    string $playBlastName = $buff[0] +"_"+ $buff[1] +"_"+ $buff[2];
    string $playBlastPath = $sceneLongPathNoMB +$playBlastName;
    string $return[7] = {$sceneLongPath,$sceneLongPathNoMB, $sceneShortPath,$sceneName,$sceneNameNoMB,$playBlastName,$playBlastPath};
    return $return;
}

你可能感兴趣的:(MEL#PROC#获取maya当前文件的各种路径)