MetaFusion/Reference/SuperRiggingEditor/scripts/SGUpdatePlugin.mel
2025-02-03 22:58:41 +08:00

45 lines
1.3 KiB
Plaintext

//******************************************************************************
//
// 版权所有: 玉溪时光科技有限公司
// 联系邮箱: q.100@qq.com
// 开发日期: 2024/03/20
//
//******************************************************************************
global proc SGUpdatePlugin ()
{
string $path_folder = `getenv("SG_PATH")` + "plug-ins-update";
if(`file -q -ex $path_folder`){
SGUnloadPlugin;
string $version[] = {"2018","2019","2020","2022","2023","2024"};
for($i=0; $i<size($version); $i++){
string $path_update = `getenv("SG_PATH")` + "plug-ins-update/" + $version[$i];
string $path = `getenv("SG_PATH")` + "plug-ins/" + $version[$i];
string $plugins[] = `getFileList -fld $path_update -fs "*.mll"`;
for($plugin in $plugins){
string $new = $path_update + "/" + $plugin;
string $old = $path + "/" + $plugin;
if(`sysFile -copy $old $new`){
print ($old + " update successd...\n");
sysFile -delete $new;
}
else{
print ($old + " update failing...\n");
}
}
sysFile -removeEmptyDir $path_update;
}
sysFile -removeEmptyDir $path_folder;
}
}
global proc SGUnloadPlugin ()
{
string $version = `about -v`;
if(`pluginInfo -q -l ("SuperRiggingEditor" + $version)`){
unloadPlugin ("SuperRiggingEditor" + $version);
}
}