Export by nodes

This commit is contained in:
Razmoth
2023-05-11 20:42:38 +04:00
parent 7411939a8f
commit 006a87938c
3 changed files with 100 additions and 1 deletions

View File

@@ -850,6 +850,45 @@ namespace AssetStudioGUI
});
}
public static void ExportNodesWithAnimationClip(string exportPath, List<TreeNode> nodes, List<AssetItem> animationList = null)
{
ThreadPool.QueueUserWorkItem(state =>
{
int i = 0;
Progress.Reset();
foreach (var node in nodes)
{
var name = node.Text;
StatusStripUpdate($"Exporting {name}");
var gameObjects = new List<GameObject>();
GetSelectedParentNode(node.Nodes, gameObjects);
if (gameObjects.Count > 0)
{
var subExportPath = exportPath + Path.Combine(node.Text, FixFileName(node.Text) + ".fbx");
try
{
ExportGameObjectMerge(gameObjects, subExportPath, animationList);
Progress.Report(++i, nodes.Count);
StatusStripUpdate($"Finished exporting {name}");
}
catch (Exception ex)
{
MessageBox.Show($"Export Model:{name} error\r\n{ex.Message}\r\n{ex.StackTrace}");
StatusStripUpdate("Error in export");
}
}
else
{
StatusStripUpdate("Empty node selected for export.");
}
}
if (Properties.Settings.Default.openAfterExport)
{
OpenFolderInExplorer(exportPath);
}
});
}
public static void GetSelectedParentNode(TreeNodeCollection nodes, List<GameObject> gameObjects)
{
foreach (TreeNode i in nodes)